Wait, my example is fine isn't it? Ok now I'm confused but I can't find the version I fixed. I'll see if I can break it again and repost the actual script instead of my pseudoscript hehe.
Here is the actual code that wasn't working correctly, note that this is still WiP code:
;################################################
; SUB MAKEMAP
;################################################
sub MakeMap
repeat
{
finditem !BlankScrollTypes C_ , #BackPackID
if #findkind = -1
{
gosub Restock !BlankScrollTypes !Secure !ScrollAmount
if ! #RESULT
{
Display You seem to be out of scrolls. Please restock and start again. Script Halting!
halt
}
}
finditem !PenTypes C_ , #BackPackID
if #findkind = -1
{
gosub Restock !PenTypes !Secure 1
if ! #RESULT
{
Display You seem to be out of Mapmaker Pens. Please restock and start again. Script Halting!
halt
}
}
finditem !PenTypes C_ , #backpackid
set #lobjectid #findid
event macro 17
wait !sWait
gosub ClickNWait 28 91 #TRUE
if %CurrentMap = LocalMap
gosub ClickNWait 235 70 #TRUE
if %CurrentMap = CityMap
gosub ClickNWait 235 90 #TRUE
if %CurrentMap = SeaChart
gosub ClickNWait 235 110 #TRUE
if %CurrentMap = WorldMap
gosub ClickNWait 235 130 #TRUE
if %CurrentMap = WallMapSouth
gosub ClickAndWait 235 150 #TRUE
if %CurrentMap = WallMapEast
gosub ClickAndWait 235 170 #TRUE
finditem !MapTypes C_ , #backpackid
wait !sWait
}
until #findkind <> -1
return
;################################################
; SUB RESTOCK
;################################################
; %1 ItemType to restock
; %2 Container to restock from
; %3 Number of items to take
sub Restock
set %Item2Stock %1
set %Container %2
set %Amount2Stock %3
finditem %Item2Stock C_ , %Container
if #findkind = -1
Return #FALSE
if #findstack < %Amount2Stock
set %Amount2Stock #findstack
exevent drag #findid %Amount2Stock
wait !sWait
exevent dropc #backpackid
wait !sWait
return
This code should be fine, right? However, I was actually running through without displaying "Out of mapmaker pens" when the return from the restock sub was #FALSE until I changed the line "IF ! #RESULT" to "IF #RESULT = #FALSE" but these two lines should mean the exact same thing, correct? I must have missed something else.
X