I fixed the mining tile, you have to give the value after a ,infotile. but u can customise your own mining spot with this
It's FULLY stealthed, except for recalling for smelt, and recalling back.
(Am going to make it so, that AFTER you recalled back, it will FIRST hide/stealth instead of walking directly to your mining spot, this will posses no significant problem)
It now recalls using rune ID (on my shard runebooks no work)
It uses >BANK< instead of house box.
I did this because the move system (which I couldn't script better btw) sometimes gets stuck.
I removed the stuck part of the script. (I'm sry, I >think< it's now unnesacery, unless you mine in a really complicated mine, and make your locations criss-cross trough it.
No more orex and orey, these are now minex, and miny.
It no longer prints or says "Next", and by adding an extra journal condition in the main sub, it WILL move to the next LOC.
Here are my problems:
The Tinker new Shovels part, I have absolutely NO clue, how to script this.
The eat food script I inserted before the smelting (currently removed from script) can't find the food in my bank. Here's a stand alone version.
Code: Select all
sub Food
VAR FOOD
FOOD = 0
WHILE FOOD < 1
UO.Exec("usetype 0x097B")
wait(600)
IF UO.InJournal("you are simply") THEN
FOOD = 1
ENDIF
WEND
FOOD = 0
end sub
Final question, I want it to check if it's already hidden / stealthing, how do I do that?
Code: Select all
sub main()
VAR LOC, BOXID, MINEX, MINEY, MINEZ, MINET, SHOVELS, NUMLOC, CWEIGHT, MX, MY
MX = UO.GetX("self")
MY = UO.GetY("self")
BOXID = 0x4000B484
NUMLOC = 20
CWEIGHT = 405
LOC=1
REPEAT
IF (LOC == (NUMLOC + 1)) THEN
LOC = 1
ENDIF
if (loc==1) then
minex=1174
miney=1408
minez=-95
minet=1340
end if
if (loc==2) then
minex=1174
miney=1406
minez=-95
minet=1341
end if
if (loc==3) then
minex=1174
miney=1403
minez=-95
minet=1340
end if
if (loc==4) then
minex=1174
miney=1400
minez=-95
minet=1343
end if
if (loc==5) then
minex=1174
miney=1397
minez=-95
minet=1342
end if
if (loc==6) then
minex=1170
miney=1397
minez=-95
minet=1340
end if
if (loc==7) then
minex=1170
miney=1401
minez=-95
minet=1340
end if
if (loc==8) then
minex=1170
miney=1404
minez=-95
minet=1342
end if
if (loc==9) then
minex=1170
miney=1404
minez=-95
minet=1342
end if
if (loc==10) then
minex=1171
miney=1410
minez=-95
minet=1340
end if
if (loc==11) then
minex=1171
miney=1413
minez=-95
minet=1340
end if
if (loc==12) then
minex=1171
miney=1416
minez=-95
minet=1343
end if
if (loc==13) then
minex=1171
miney=1419
minez=-95
minet=1340
end if
if (loc==14) then
minex=1171
miney=1423
minez=-95
minet=1343
end if
if (loc==15) then
minex=1171
miney=1427
minez=-95
minet=1340
end if
if (loc==16) then
minex=1173
miney=1424
minez=-95
minet=1341
end if
if (loc==17) then
minex=1174
miney=1420
minez=-95
minet=1343
end if
if (loc==18) then
minex=1174
miney=1416
minez=-95
minet=1341
end if
if (loc==19) then
minex=1174
miney=1413
minez=-95
minet=1340
end if
if (loc==20) then
minex=1174
miney=1408
minez=-95
minet=1340
end if
UO.DeleteJournal()
MoveTo(minex,miney)
wait(500)
UO.UseSkill('Hiding')
Wait(500)
UO.FindType(0x0F39)
wait(300)
SHOVELS = UO.FindCount()
wait(200)
IF SHOVELS == 0 THEN
Bank()
wait(1000)
getSHOVEL(BOXID)
wait(1000)
GoMine()
ENDIF
wait(6000)
UO.UseSkill('Stealth')
Mine(MINEX,MINEY,MINEZ,MINET,CWEIGHT)
wait(500)
IF UO.InJournal("cliloc# 0xAD00") THEN
LOC = LOC + 1
ENDIF
wait(500)
IF UO.Weight >= CWEIGHT THEN
Bank()
wait(1000)
SmeltOre(BOXID)
wait(1000)
GoMine()
ENDIF
wait(500)
UNTIL (LOC == 500)
end sub
sub Mine(MINEX,MINEY,MINEZ,MINET,CWEIGHT)
VAR EXIT, GETSHOVEL, SHOVELS
SHOVELS=0
GETSHOVEL=0
EXIT=0
UO.Print("MINING")
;GoMine()
UO.FindType(0x0F39)
wait(500)
SHOVELS = UO.FindCount()
wait(500)
REPEAT
UO.DeleteJournal()
UO.WaitTargetTile(str(MINET), str(MINEX), str(MINEY), str(MINEZ))
wait(500)
UO.Exec("usetype 0x0F39")
wait (2000)
IF uo.injournal("cliloc# 0xAD00") THEN
exit=1
wait(500)
ENDIF
IF UO.InJournal("cliloc# 0xEE46") THEN ;???????//
SHOVELS = SHOVELS - 1
wait(500)
ENDIF
IF (SHOVELS == 0) THEN
UO.Print("Out of Shovels")
getSHOVEL = 1
wait(500)
ENDIF
IF UO.InJournal("cliloc# 0xA2DE") THEN
MoveTo(minex,miney)
wait(500)
ENDIF
IF UO.InJournal("cliloc# 0xA20D") THEN
MoveTo(minex,miney)
wait(500)
ENDIF
IF (UO.Weight >= CWEIGHT) THEN
UO.Print("Full! Lets Smelt")
ENDIF
UNTIL (UO.Weight >= CWEIGHT) or (EXIT == 1) or (GETSHOVEL == 1)
end sub
sub GoMine()
VAR MX, MY
RECALL:
UO.DeleteJournal()
IF UO.Waiting() THEN
UO.CancelTarget()
ENDIF
MX = UO.GetX("self")
MY = UO.GetY("self")
UO.DeleteJournal()
UO.Say('Bank')
UO.Cast('Recall','0x40011A87')
wait(4000)
IF NOT UO.GetX("self") <> MX and not UO.GetY("self") <> MY THEN
GOTO RECALL
ENDIF
end sub
Sub Bank()
VAR MX, MY
RECALL:
UO.DeleteJournal()
IF UO.Waiting() THEN
UO.CancelTarget()
ENDIF
MX = UO.GetX("self")
MY = UO.GetY("self")
UO.DeleteJournal()
UO.UseSkill('Hiding')
wait(1000)
UO.Cast('Recall','0x40031727')
wait(4000)
IF NOT UO.GetX("self") <> MX and not UO.GetY("self") <> MY THEN GOTO RECALL
ENDIF
end sub
sub SmeltOre(BOXID)
VAR FAIL, INGOTS, SHOVELS
FAIL = 0
UO.Print("SMELTING")
UO.Say('Bank')
UO.UseSkill('Hiding')
wait(500)
repeat
UO.FindType(0x19b9)
UO.WaitTargetGround(0x0fb1)
UO.UseType(0x19b9)
wait(2000)
; IF UO.InJournal("cliloc# 0xA2DE") THEN
; moveto(smeltx,smelty)
; ENDIF
UNTIL UO.FindCount()==0
UO.DeleteJournal()
REPEAT
UO.FindType(0x1bf2)
INGOTS = UO.FindCount()
UO.MoveItem ("finditem",1000,boxid)
wait(1000)
; IF UO.InJournal("cliloc# 0xA2DE") THEN
; MoveTo(boxx,boxy)
; ENDIF
; IF (FAIL == 3) THEN
; MoveTo(boxx,boxy)
; FAIL = 0
; ENDIF
FAIL = FAIL +1
IF (INGOTS==0) THEN
UO.FindType(0x0F39)
wait(300)
SHOVELS = UO.FindCount()
wait(200)
IF SHOVELS < 2 THEN
GETSHOVEL(boxid)
ENDIF
ENDIF
UNTIL INGOTS == 0
end sub
sub getSHOVEL(boxid)
VAR SHOVELS, CX, CY, FAIL, PAMT, BSTAT
PAMT = 2
FAIL = 0
CX=UO.GetX()
CY=UO.GetY()
REPEAT
UO.Say('Bank')
UO.UseSkill('Hiding')
Wait(500)
UO.FindType(0x0F39)
wait(300)
SHOVELS = UO.FindCount()
wait(200)
IF UO.FindCount() < PAMT THEN
UO.UseObject(boxid)
wait(1000)
UO.FindType (0x0F39,-1,boxid)
BSTAT = UO.FindCount()
wait(300)
IF (BSTAT < 50) THEN
Tinker(boxid)
ENDIF
UO.Exec ("grab 1 finditem")
; IF UO.InJournal("cliloc# 0xA2DE") THEN
; MoveTo(boxx,boxy)
; ENDIF
wait (1000)
ENDIF
; IF (FAIL == 3) THEN
; MoveTo(boxx,boxy)
; FAIL = 0
; ENDIF
FAIL = FAIL +1
UNTIL (SHOVELS > 1)
end sub
sub Tinker(boxid)
VAR I, AMOUNT, TOOL, SHOVELS, J
TOOL = 0
AMOUNT = 5
I = AMOUNT
UO.Set('norbcheck','1')
UO.Set('norbcalc','1')
wait(900)
UO.Say('Bank')
UO.UseObject(boxid)
wait(700)
UO.FindType(0x1bf2,0x0000,boxid)
UO.Exec ("grab 50 finditem")
UO.FindType(0x1EB8)
wait(300)
TOOL = UO.FindCount()
REPEAT
UO.Exec("usetype 0x1EB8")
wait(700)
UO.WaitMenu ('Tinkering', 'Tools', 'NEXT PAGE', 'Shovel' )
wait(500)
IF UO.InJournal('You put') AND NOT UO.InJournal('fail') THEN
I = I+1
UNTIL (I == 5)
end sub
Sub MoveTo(lx,ly)
VAR CX, CY, CX1, CY1, CX2, CY2, MX1, MY1, MX2, MY2, STEPS, COUNT, MOVEX, MOVEY, DIFFX, DIFFY, TIME
COUNT=1
MOVEX=0
MOVEY=0
STEPS=0
CX1=1
CY1=1
CX2=2
CY2=2
TIME=0
CX=UO.GetX()
CY=UO.GetY()
REPEAT
TIME = TIME + 1
IF (TIME > 10) THEN
UO.Resend()
TIME = 0
ENDIF
CX=UO.GetX()
IF (LX < CX) THEN
REPEAT
UO.Press(36)
wait(250)
STEPS = STEPS + 1
CX=UO.GetX()
UNTIL (LX == CX) OR (STEPS == 5)
STEPS=0
ENDIF
CY=UO.GetY()
IF (LY < CY) THEN
REPEAT
UO.Press(33)
wait(250)
STEPS = STEPS + 1
CY=UO.GetY()
UNTIL (LY == CY) OR (STEPS == 5)
STEPS=0
ENDIF
CX=UO.GetX()
IF (LX > CX) THEN
REPEAT
UO.Press(34)
wait(250)
STEPS = STEPS + 1
CX=UO.GetX()
UNTIL (LX == CX) OR (STEPS == 5)
STEPS=0
ENDIF
CY=UO.GetY()
IF (LY > CY) THEN
REPEAT
UO.Press(35)
wait(250)
STEPS = STEPS + 1
CY=UO.GetY()
UNTIL (LY == CY) OR (STEPS == 5)
STEPS=0
ENDIF
UNTIL (LX == CX AND LY == CY)
end sub
Thx in advance for every helpfull reply
This script is currently working on an RUNUO shard btw (XUO)