Page 1 of 1

Item Id?

Posted: 2010-04-29 22:56:25
by mirre
I need an Item Identification script that itemid a rune place in runebook then again out from runebook and repeat.

I have already a script but it fails when i get messagne "Im not sure" then the runebooks opens up without the rune and the script cannot continue to work.

Please help!!

sub main()
while UO.life > 0
Var rune='0x1F14'
VAR runebook ='0x41efe022'

start:

UO.Useskill('Item Identification')
UO.waittargettype(rune)
wait(500)
If UO.InJournal("Im not sure") then #this doenst works as I like it, script fails!!!
wait(8100)
goto start
Endif
goto start1

start1:
IF uo.lastmessage()=="This is a normal item." then
UO.DeleteJournal()
UO.FindType(rune)
UO.MoveItem('finditem',0,runebook)
wait(500)
End if
goto start2

start2:

UO.LClick(143,499)
wait(1000)
UO.LClick(350,16)
wait(1000)
UO.LClick(69,119)
wait(1000)
goto start

wend
end sub

Re: Item Id?

Posted: 2010-04-30 08:14:45
by Beyonder
You'd better used a loop checking the journal, not one "if" statement.
Like this:

Code: Select all

while not UO.InJournal('...')
wait(100)
wend


Or a more complex way - with a timeout:

Code: Select all

var timeLeft
....
timeLeft = 5000 #Max time is 5 seconds
while (not UO.InJournal('...')) and (timeLeft > 0)
wait(100)
timeLeft = timeLeft - 100
wend

if (timeLeft > 0) then #If we found a line in journal
goto start1 #goto next step
else
goto start #otherwise - goto start, somewhy we got no message in journal
endif