thanks works fine now....
well another issue is on row 148: Runtime error - Attempting to access array out of bounds (i marked the row in the script for you)
basicly it opens the map i choose, then it moves the first bag[i] as it should, then it should open every map in the bag[i] and by position it should work with the map... but it opens just one map, then the error occurs
which i dont understand why this error occurs, by my opinion it should would...
please have a look at that as im sure im just missing a detail

Code:
sub mapy()
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])
uo.moveitem(bag[i],1,"backpack")
wait(500)
uo.useobject(bag[i])
wait(500)
uo.findtype("0x14EB","0x0000",bag[i])
while uo.findcount() > 0
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
148: uo.findtype("0x14EB","0x0000",bag[i])
endif
wend
wend
i = i + 1
wend
uo.moveitem("finditem",1,"maps_savebag")
uo.ignorereset()
end sub