findItem ZBN
set #lobjectID #findID
set #ltargetKind 1 ; < --- you are not really using any targeting in the script, why are you using this?
event macro 17 0
wait 5
Well your main problem is you dont check where to look for the item, and if you have found the item or not. And you are missing brackets in which case even if you havent found the item, the following lines will be executed - and that's wrong. But if you are having brackets and the statement is true( the way you want it ) it will execute only the code within the brackets. So this little code should look something like this.
finditem ZBN C_ , #backpackid ; looking for zbn in your main backpack.
if #findcnt > 0 ; if found more than 0
{ ; open statement found more than 0
set #lobjectID #findID ; set last objectid from #findid
event macro 17 0 ; use last object
wait 5 ; wait 0,25s
} ; close statement found more than 0
else ; if nothing found
{ ; open statement else
display did not find ZBN ; displays [ok] messagebox with text "did not find ZBN"
stop ; stops the script
} ; close statement else
set #contPosX 10
set #contPosY 10
contpos
wait 5
you could just use
contpos 10 10
msg vendor buy$
To prevent errors(as this "msg" is direct key pressing - and you may have some writen stuff allready -, so I would suggest to use the method bellow, which is just a direct messaging trough event
event macro 1 1 vendor buy
Then you have a looping error. The line 27 says "Start", and the line 100 says "loop".
But it should be
Start:
.....................
goto Start
I would recomend you using ScriptUO software, that has syntax error checker inside. It would help you prevent many problems you may encounter. Hope this will help and you will understand what I have writen here down.Anyway, keep on working, it's a good start.