I have a mining script I modified from the very nice one @MB posted (http://www.uogamers.com/community/index.php?threads/564098/) and bits and parts I found elsewhere. It is working great for me, but this one little error checking issue is bothering me. Hopefully someone can shed light on it.
This script assumes the following:
Line 57 works correctly even though it looks like the syntax coloring has issues with it.
However if I add in the third condition the script fails:
Does anyone see something syntax-wise I'm missing there? Or maybe you can't have more than one 'or' in a statement in UOSteam?
Full code below for reference (don't laugh, I'm new at using this!)
This script assumes the following:
- Using magery
- No pet
- Tools are already made
Line 57 works correctly even though it looks like the syntax coloring has issues with it.
![](/community/proxy.php?image=http%3A%2F%2Fi.imgur.com%2For3nQyp.png&hash=4a34c8c2eb39adb5e133b00c0d03cab6)
However if I add in the third condition the script fails:
![](/community/proxy.php?image=http%3A%2F%2Fi.imgur.com%2F4OBQGSe.png&hash=1a4c80371dc60bf444bede657353a90c)
Does anyone see something syntax-wise I'm missing there? Or maybe you can't have more than one 'or' in a statement in UOSteam?
Full code below for reference (don't laugh, I'm new at using this!)
Code:
if not @findobject 'Toolbox'
promptalias 'Toolbox'
endif
if not @findobject 'Home'
promptalias 'Home'
endif
if not @findobject 'OreBookOne'
promptalias 'OreBookOne'
endif
if not @findobject 'OreBookTwo'
promptalias 'OreBookTwo'
endif
if not @findobject 'OreBookThree'
promptalias 'OreBookThree'
endif
if not listexists 'OreBook'
createlist 'OreBook'
pushlist 'OreBook' 'OreBookOne'
pushlist 'OreBook' 'OreBookTwo'
pushlist 'OreBook' 'OreBookThree'
endif
if not listexists 'Runes'
createlist 'Runes'
pushlist 'Runes' 5
pushlist 'Runes' 11
pushlist 'Runes' 17
pushlist 'Runes' 23
pushlist 'Runes' 29
pushlist 'Runes' 35
pushlist 'Runes' 41
pushlist 'Runes' 47
pushlist 'Runes' 53
pushlist 'Runes' 59
pushlist 'Runes' 65
pushlist 'Runes' 71
pushlist 'Runes' 77
pushlist 'Runes' 83
pushlist 'Runes' 89
pushlist 'Runes' 95
endif
//run through each rune on each runebook
For 0 to 'OreBook'
For 0 to 'Runes'
pause 500
clearjournal
pause 500
useobject OreBook[]
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 Runes[]
//tells you which rune you are on, see runelist above
sysmsg 'Rune' 33
sysmsg Runes[] 33
pause 2000
//set starting facing direction
turn 'North'
while not @injournal 'no metal here'
if @injournal "You can't mine there" or @injournal "You can't mine that"
//east
if direction == 0
turn 'east'
clearjournal
pause 500
//south
elseif direction == 2
turn 'south'
clearjournal
pause 500
//west
elseif direction == 4
turn 'west'
clearjournal
pause 500
//north
elseif direction == 6
turn 'north'
clearjournal
pause 500
endif
endif
pause 200
//use pickaxe or shovel to tile you are facing until specified weight is reached or we run out of ore or have no tool
pause 300
//shovel 0xf39, pickaxe 0xe86
if not @findobject 'tool'
if @findtype 0xf39 2419 'any' 'backpack'
@setalias 'tool' 'found'
elseif @findtype 0xf39 'any' 'backpack'
@setalias 'tool' 'found'
elseif @findtype 0xe86 2419'any' 'backpack'
@setalias 'tool' 'found'
elseif @findtype 0xe86 'any' 'backpack'
@setalias 'tool' 'found'
else
headmsg "No tools in backpack" "33"
@unsetalias 'tool'
pause 1000
//Go home to get more tools
useobject 'Home'
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 5
pause 2500
useobject 'toolbox'
pause 2000
if @findtype 0xf39 2419 'toolbox' 'any'
movetype 0xf39 'toolbox' 'backpack' 0 0 0 2419 1
pause 1000
@setalias 'tool' 'found'
elseif @findtype 0xf39 0 'toolbox' 'any'
movetype 0xf39 'toolbox' 'backpack' 0 0 0 0 1
@setalias 'tool' 'found'
elseif @findtype 0xe86 2419 'toolbox' 'any'
movetype 0xe86 'toolbox' 'backpack' 0 0 0 2419 1
@setalias 'tool' 'found'
elseif @findtype 0xe86 0 'toolbox' 'any'
movetype 0xe86 'toolbox' 'backpack' 0 0 0 0 1
@setalias 'tool' 'found'
else
headmsg "No tools in toolbox" "33"
sysmsg "Make more tools" "33"
@unsetalias 'tool'
stop
endif
pause 600
//recall back to where you were
useobject OreBook[]
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 Runes[]
pause 2000
endif
else
useobject 'tool'
waitfortarget '5000'
targettilerelative 'self' 1 'false'
pause 600
@unsetalias 'tool'
endif
// once weight is reached go home, if getting overweight, raise it
if diffweight < 30
useobject 'Home'
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 5
pause 2500
// organizer to put up ore
organizer 'Ore'
pause 8000
//recall back to where you were
useobject OreBook[]
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 Runes[]
pause 2000
endif
endwhile
endfor
endfor
//recall home at end
useobject 'Home'
waitforgump 0x554b87f3 5000
replygump 0x554b87f3 5
pause 2000
//put everything away
organizer 'Ore'
pause 8000