problem with substring

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Taya
Posts: 29
Joined: 2006-11-02 14:07:13
Location: near Cologne, GERMANY

problem with substring

Post by Taya »

hi alltogether,

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

here a snippet

Code: Select all

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: Select all

if 'Essen' in ZeilenText then


brings up an error.

Please can you help me?

thanks

taya
Taya
Posts: 29
Joined: 2006-11-02 14:07:13
Location: near Cologne, GERMANY

Post by Taya »

sorry. seems to be the wrong section. but i can't delete it
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

Code: Select all

if 'Essen' in ZeilenText

Code: Select all

if ZeilenText=="Essen"


well i think injection doesnt see the message "You see ... etc"
Taya
Posts: 29
Joined: 2006-11-02 14:07:13
Location: near Cologne, GERMANY

Post by Taya »

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: Select all

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
Nmy
Expert!
Posts: 2152
Joined: 2005-09-14 15:31:58
Location: Latvia

Post by Nmy »

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
Taya
Posts: 29
Joined: 2006-11-02 14:07:13
Location: near Cologne, GERMANY

Post by Taya »

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 :)
Post Reply