Yoko

All sides of Injection
It is currently 2025-10-15 11:55:00

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Item Id?
PostPosted: 2010-04-29 22:56:25 
Offline

Joined: 2010-04-29 22:33:50
Posts: 1
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!!

Quote:
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


Top
   
 Post subject: Re: Item Id?
PostPosted: 2010-04-30 08:14:45 
Offline
Expert!
User avatar

Joined: 2005-04-23 10:19:43
Posts: 388
You'd better used a loop checking the journal, not one "if" statement.
Like this:

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


Or a more complex way - with a timeout:
Code:
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


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited