i THINK there is just problem on this part
Code: Select all
while i <= max
bag[i] = "maps_bag_"+str(i)
while uo.getserial(bag[i]) <> "0x00000000"
as ive got MANY objects called maps_bag_NUMBER (NUMBER is variable of course)
so i need to use them somehow in the script and i thing when i use bag[i] = "maps_bag_"+str(i) then it is concerned as a text, not as a object anymore...
any solution?
Code: Select all
sub maps()
uo.deletejournal()
VAR main_bag = "0x400C2379"
VAR i = 1
VAR max = 16
DIM bag[16] # must be same as VAR max
VAR journal,buffer,exit
VAR map,map_x,map_y
VAR journal_new,buffer_new,exit_new
VAR map_new,map_x_new,map_y_new
VAR search
# savebag
uo.print("Where to put maps?")
uo.addobject("maps_savebag")
while uo.targeting()
wait(100)
wend
# bag
while i <= max
uo.addobject("maps_bag_"+str(i))
while uo.targeting()
wait(100)
wend
i = i + 1
wend
# mapa
uo.print("Choose one map")
uo.addobject("maps_catchmap")
while uo.targeting()
wait(100)
wend
wait(500)
# zjisti pozici mapy
uo.useobject("maps_catchmap")
while NOT uo.injournal("Map opened to")
wait(100)
wend
journal = uo.journal(uo.injournal('Map opened to')-1)
# map_x
buffer = ""
exit = 0
i=15
while exit <> 1
if journal[i] <> ":" then
buffer = buffer + journal[i]
else
exit = 1
endif
i = i + 1
wend
map_x = val(buffer)
# map_y
buffer = ""
exit = 0
while exit <> 1
if journal[i] <> "" then
buffer = buffer + journal[i]
else
exit = 1
endif
i = i + 1
wend
map_y = val(buffer)
search = "Coordinates: "+str(map_x)+"x"+str(map_y)
uo.print(str(search))
i = 1
uo.deletejournal()
while i <= max
bag[i] = "maps_bag_"+str(i)
while uo.getserial(bag[i]) <> "0x00000000"
uo.moveitem(bag[i],1,"backpack")
wait(500)
repeat
uo.findtype("0xFFFF","0xFFFF",bag[i])
if uo.findcount() > 0 then
uo.useobject("finditem")
while NOT uo.injournal("Map opened to")
wait(100)
wend
journal_new = uo.journal(uo.injournal('Map opened to')-1)
# map_x_new
buffer_new = ""
exit_new = 0
i=15
while exit_new <> 1
if journal_new[i] <> ":" then
buffer_new = buffer_new + journal_new[i]
else
exit_new = 1
endif
i = i + 1
wend
map_x_new = val(buffer_new)
# map_y_new
buffer_new = ""
exit_new = 0
while exit_new <> 1
if journal_new[i] <> "" then
buffer_new = buffer_new + journal_new[i]
else
exit_new = 1
endif
i = i + 1
wend
map_y_new = val(buffer_new)
if ((((map_x - 30) <= (map_x_new)) AND ((map_x_new) <= (map_x + 30))) AND (((map_y - 30) <= (map_y_new)) AND ((map_y_new) <= (map_y + 30)))) then
uo.moveitem("finditem",1,"maps_savebag")
wait(500)
else
uo.ignore("finditem")
wait(1000)
endif
endif
until uo.findcount() == 0
wend
i = i + 1
wend
end sub