but if it gets stuck in the middle i need to go back on the position is started and start over again...
so I wanted to put some ID when i start (so it will ask me where to start)... works fine but if i dont know the ID of the move (variable n in the script) then im fucked...
so al works fine, i can define ID where to start, but I need the script to show me the ID of every move i do
Code: Select all
UO.deletejournal()
n = readnumfromjournal()
while not uo.dead()
While not (way[n] == "X")
direction = ""
While not (way[n] == " ")
direction = direction + way[n]
n = n + 1
Wend
UO.Print("Action: " + direction + ", ID# " + n)
... blabla ...
end sub
sub WaitForJournal(text)
repeat
wait(200)
until uo.inJournal(text)
wait(500)
end sub
sub readnumfromjournal()
uo.deletejournal()
uo.print("ID to start:")
uo.click("self")
repeat
wait(100)
until sayi("1|2|3|4|5|6|7|8|9|0")
var radek = uo.injournal("1|2|3|4|5|6|7|8|9|0")-1
var m
var name = uo.getname("self")
while name == ""
uo.click("self")
wait(1000)
name = uo.getname("self")
wend
uo.print("Starting at ID# " + mid(uo.journal(radek), len(name)+2, 10))
return val(mid(uo.journal(radek), len(name)+2, 10))
end sub
sub sayi(text)
if uo.journalserial(uo.injournal(text)-1) == uo.getserial('self') then
return 1
else
return 0
endif
end sub
when try it shows error "Runtime error - Invalid operation for this type" on row UO.Print("Action: " + direction + ", ID# " + n), well i dont know how to print the n variable
anyway on the row uo.print("Starting at ID# " + mid(uo.journal(radek), len(name)+2, 10)) it actually prints it, just dont know what mid() and len() does, so it could be my second question what those functions does