Yoko
http://forum.yoko.com.ua/

problem with substring
http://forum.yoko.com.ua/viewtopic.php?f=20&t=11415
Page 1 of 1

Author:  Taya [ 2007-02-10 16:21:36 ]
Post subject:  problem with substring

hi alltogether,

i try to write a little sort script (again :) )

here a snippet

Code:
sub SR()
    uo.canceltarget()
    uo.exec('addobject LootBeutel')
    while uo.targeting()
        wait(100)
    Wend
    uo.useobject('LootBeutel')

    var tZirkel1  = '0x497F5633'
    var tZirkel2  = '0x49E187B8'
    var tZirkel3  = '0x49E187BF'
    var tZirkel4  = '0x49E187D6'
    var tZirkel5  = '0x49E187DE'
    var tZirkel6  = '0x49E187E6'
    var tZirkel7  = '0x49E187EF'
    var tZirkel8  = '0x49E187F3'
    var tMusik    = '0x4875662D'
    var tArtefakt = '0x40DB7717'

    var ZeilenNummer
    var ZeilenText

    uo.FindType('-1','-1','LootBeutel')
    while uo.FindCount()
        uo.DeleteJournal()
        if uo.FindCount() then
            uo.Click('finditem')
            wait(250)
            ZeilenNummer = uo.InJournal('You see') - 1
            if ZeilenNummer > 0 then
                ZeilenText = Journal(ZeilenNummer)
                if 'Essen' in ZeilenText then
                    uo.moveitem('finditem','all',tZirkel1)
                else
                    uo.ignore('finditem')
                end if
                wait(750)
            end if
        end if
        uo.FindType('-1','-1',container)
    wend
end sub


but the line

Code:
if 'Essen' in ZeilenText then


brings up an error.

Please can you help me?

thanks

taya

Author:  Taya [ 2007-02-10 16:23:08 ]
Post subject: 

sorry. seems to be the wrong section. but i can't delete it

Author:  Nmy [ 2007-02-10 18:00:19 ]
Post subject: 

Code:
if 'Essen' in ZeilenText

Code:
if ZeilenText=="Essen"


well i think injection doesnt see the message "You see ... etc"

Author:  Taya [ 2007-02-11 09:44:09 ]
Post subject: 

hi NMY,

thank you for your answer. but this is not exactly what i need. the hole text is something like

4 Spruchrolle "Essen"

the 4 means there are actually 4 items in a stack. Spruchrolle is in english "mage scroll" i think. on our shard there many different of them: Essen, Trinken, Schutz, etc. (it's a german shard, yes :) )

thus i can't imagine another way to sort different scroll than to get the substring "Essen" to put it in the right bag.

how can i find this substring in string? or is it possible to use multiple inJournal? like in

Code:
if inJournal('Essen') then
    move-to-bag1
end if
if inJournal('Trinken') then
    move-to-bag2
end if
if inJournal('Schutz') then
    move-to-bag3
end if

...


thank you

taya

Author:  Nmy [ 2007-02-11 19:54:14 ]
Post subject: 

yea and you must do that way and its the only way :roll:

well maybe they have different types ?its better to get type not to click

Author:  Taya [ 2007-02-27 00:07:53 ]
Post subject: 

yeah thats the problem. they have the same type. e.g. we have diferent skulls. the normal skull in white. the troll-skull in darc grey. the deamon skill in red. the centaur skill in a kind of silver. the dragon skull in nearly the same color. and all this skulls have the same type.

thats the reason why i try it with injection. otherwise i had use easyUO. but the is no

click objectID

command :)

Page 1 of 1 All times are UTC+02:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/