I fixed that, had to trough the macro around a bit
instead of:
Code: uo.waittargettile( 0,str(minex), str(miney), str(minez)) I added the variable minet (which is the tile code)
Code: uo.waittargettile(str(minet), str(minex), str(miney), str(minez)) Making it able to mine in dungeons
Script would look like this, notice the locations have to have the correct tile code, else you will get "cannot see target". also orex and minex can be same now. (if u info tile, the first set of numbers are the tile code)
I'll try to get orex and orey out of the script and add recall + bank container instead of walk house container since the walking is kinda bugged
Code: # ^^^^^^^^^^^^^^^^^^^ # # Perpetual Mining Macro V1.0 # # By: Weeder \ Tweaker # # Email: lobo707@hotmail.com # # Use RUO Emu at Dark Other # # www.darkother.com #
sub main()
var loc var boxid var boxx var boxy var orex var orey var minex var miney var minez var minet var smeltx var smelty var picks var numloc var cweight
#!!!!!!!!!!!!!!!!!!!!!!!!!# # you must enter these values for your area #
boxid = 0x4003276D boxx = 1103 boxy = 1471 smeltx = 1101 smelty = 1470 numloc = 16 cweight = 365 #!!!!!!!!!!!!!!!!!!!!!!!!!#
loc=1
repeat if (loc == (numloc + 1)) then loc = 1 end if
#!!!!!!!!!!!!!!!!!!!!!!!!!# # Here is where you place ore locatons and mine locations#
if (loc==1) then orex=1117 orey=1462 minex=1118 miney=1462 minez=-95 minet=1340 end if
if (loc==2) then orex=1120 orey=1462 minex=1121 miney=1462 minez=-95 minet=1343 end if
if (loc==3) then orex=1124 orey=1462 minex=1125 miney=1462 minez=-95 minet=1342 end if
if (loc==4) then orex=1128 orey=1462 minex=1129 miney=1462 minez=-95 minet=1340 end if
if (loc==5) then orex=1132 orey=1462 minex=1133 miney=1462 minez=-95 minet=1340 end if
if (loc==6) then orex=1140 orey=1462 minex=1140 miney=1461 minez=-95 minet=1342 end if
if (loc==7) then orex=1137 orey=1457 minex=1137 miney=1456 minez=-95 minet=1339 end if
if (loc==8) then orex=1137 orey=1452 minex=1137 miney=1451 minez=-95 minet=1339 end if
if (loc==9) then orex=1137 orey=1448 minex=1137 miney=1447 minez=-95 minet=1341 end if
if (loc==10) then orex=1134 orey=1447 minex=1133 miney=1447 minez=-95 minet=1353 end if
if (loc==11) then orex=1133 orey=1451 minex=1133 miney=1452 minez=-95 minet=1340 end if
if (loc==12) then orex=1132 orey=1456 minex=1132 miney=1456 minez=-95 minet=1339 end if
if (loc==13) then orex=1129 orey=1456 minex=1128 miney=1456 minez=-95 minet=1343 end if
if (loc==14) then orex=1125 orey=1456 minex=1124 miney=1456 minez=-95 minet=1343 end if
if (loc==15) then orex=1124 orey=1459 minex=1124 miney=1460 minez=-95 minet=1341 end if
if (loc==16) then orex=1120 orey=1460 minex=1120 miney=1460 minez=-95 minet=1343 end if
# end lore locations#
UO.deletejournal()
moveto(orex,orey) wait(500)
UO.FindType(0x0e86) wait(300) picks = UO.FindCount() wait(200) if picks == 0 then getpick(boxid,boxx,boxy) wait(500) end if
Mine(minex,miney,minez,minet,orex,orey,cweight) wait(500)
if uo.injournal("Next") then loc = loc + 1 end if wait(500)
if uo.injournal("Full! Go smelt") then SmeltOre(smeltx,smelty,boxid,boxx,boxy) end if wait(500)
until (loc == 500)
end sub
#====================# # Mine Function V1.1 # #====================#
sub mine(minex,miney,minez,minet,orex,orey,cweight) var exit var getpick var picks
picks=0 getpick=0 exit=0
uo.print("MINING") moveto(orex,orey) UO.FindType(0x0e86) wait(500) picks = UO.FindCount() wait(500)
repeat
UO.deletejournal() uo.waittargettile(str(minet), str(minex), str(miney), str(minez)) wait(500) UO.Exec("usetype 0x0e86") wait (2000)
if uo.injournal("cliloc# 0xAD00") then uo.say("Next") exit=1 wait(500) end if
if uo.injournal("cliloc# 0xEE46") then picks = picks - 1 wait(500) end if
if (picks == 0) then uo.say("Out of picks") getpick = 1 wait(500) end if
if uo.injournal("cliloc# 0xA2DE") then moveto(orex,orey) wait(500) end if
if uo.injournal("cliloc# 0xA20D") then moveto(orex,orey) wait(500) end if
if (uo.weight >= cweight) then uo.say("Full! Go smelt.") end if
until (uo.weight >= cweight) or (exit == 1) or (getpick == 1)
end sub
#=====================# # Smelt Function V1.1 # #=====================#
sub SmeltOre(smeltx,smelty,boxid,boxx,boxy) var fail var ingots var picks
fail = 0
uo.print("SMELTING")
moveto(smeltx,smelty)
repeat uo.findtype(0x19b9) uo.waittargetground(0x0fb1) UO.UseType(0x19b9) wait(2000) if uo.injournal("cliloc# 0xA2DE") then moveto(smeltx,smelty) end if 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) end if if (fail == 3) then moveto(boxx,boxy) fail = 0 end if fail = fail +1 if (ingots==0) then UO.FindType(0x0e86) wait(300) picks = UO.FindCount() wait(200) if picks < 2 then getpick(boxid,boxx,boxy) end if end if until ingots == 0
end sub
#========================# # Get Pick Function V1.1 # #========================#
sub getpick(boxid,boxx,boxy) var picks var cx var cy var fail var pamt var bstat
pamt = 2 fail = 0
cx=uo.getx() cy=uo.gety()
repeat
UO.FindType(0x0e86) wait(300) picks = UO.FindCount() wait(200) if UO.FindCount() < pamt then moveto(boxx,boxy) wait(500) uo.UseObject(boxid) wait(1000) uo.FindType (0x0e86,-1,boxid) bstat = UO.FindCount() wait(300) if (bstat < 50) then tinker(boxid,boxx,boxy) end if uo.exec ("grab 1 finditem") if uo.injournal("cliloc# 0xA2DE") then moveto(boxx,boxy) end if wait (1000) end if if (fail == 3) then moveto(boxx,boxy) fail = 0 end if
fail = fail +1 until (picks > 1)
end sub
#_+_+_+_+_+_+_+_+_+_+_+_+_+_# # TINKER PICK FUNCTION V1.1 # #_+_+_+_+_+_+_+_+_+_+_+_+_+_#
sub tinker(boxid, boxx, boxy) var i var amount var tool var picks var j
tool = 0 amount = 49 i = amount
UO.Set('norbcheck','1') UO.Set('norbcalc','1') wait(900)
uo.UseObject(boxid) wait(700) uo.findtype(0x1bf2,0x0000,boxid) uo.exec ("grab 200 finditem")
UO.FindType(0x1EB8) wait(300) tool = UO.FindCount() wait(200) if UO.FindCount() < 1 then moveto(boxx,boxy) wait(500) uo.UseObject(boxid) wait(1000) uo.FindType (0x1EB8,-1,boxid) wait(600) uo.exec ("grab 1 finditem") wait(600) if uo.injournal("cliloc# 0xA2DE") then moveto(boxx,boxy) end if end if
wait(700) uo.recall(0x000141B5, 0x00000008) wait(700) UO.Exec("usetype 0x1EB8") wait(700)
while (i>0)
UO.Recall(0x000141B5, 0x0000006B) wait(650) UO.Exec("usetype 0x1EB8") wait(700)
if uo.injournal("cliloc# 0xEE46") then tool = tool - 1 UO.deletejournal() wait(500) UO.Set('norbcheck','1') UO.Set('norbcalc','1') wait(900) end if
if (tool == 0) then UO.FindType(0x1EB8) wait(300) tool = UO.FindCount() wait(200) if UO.FindCount() < 1 then moveto(boxx,boxy) wait(500) uo.UseObject(boxid) wait(1000) uo.FindType (0x1EB8,-1,boxid) wait(300) uo.exec ("grab 1 finditem") wait(700) if uo.injournal("cliloc# 0xA2DE") then moveto(boxx,boxy) end if end if end if i=i-1 wend
UO.Recall(0x000141B5, 0x00000017) wait(700) UO.Exec("usetype 0x1EB8") wait(700)
uo.findtype(0x0e86,-1,2) picks = UO.FindCount() while (picks > 0) uo.findtype(0x0e86,-1,2) picks = UO.FindCount() uo.moveitem ("finditem",1,boxid) wait(650) wend
uo.findtype(0x1EB8,-1,2) tool = UO.FindCount() while (tool > 0) uo.findtype(0x1EB8,-1,2) tool = UO.FindCount() uo.moveitem ("finditem",1,boxid) wait(650) wend
uo.findtype(0x0e86,-1,1) picks = UO.FindCount() while (picks > 0) uo.findtype(0x0e86,-1,1) picks = UO.FindCount() uo.moveitem ("finditem",1,boxid) wait(650) wend
end sub
#===============================+====# # Ultra Move function v1.25 With Mining Overload Addon # #=================+==================# sub moveto(lx,ly) var cx var cy var cx1 var cy1 var cx2 var cy2 var mx1 var my1 var mx2 var my2 var steps var count var movex var movey var diffx var diffy var stuck var 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
#0000000000 Checks to see if char is stuck 0000000000# count = count + 1 if (count == 1) then cx1=uo.getx() cy1=uo.gety() end if if (count == 2) then cx2=uo.getx() cy2=uo.gety() count=0 end if if (cx1 == cx2) then movex=1 end if if (cy1 == cy2) then movey=1 end if stuck = movex + movey #0000000000000000000000000000000000000000000000000000#
time = time + 1
if (time > 10) then uo.say(",resend") time = 0 end if
#xxxxxxxxx Attempts to free stuck char xxxxxxxxx# if (stuck == 2) then
mx1 = uo.getx() my1 = uo.gety()
stuck = 1
#---------------------------------------------------------------- Case 1 # if (lx <= cx AND ly > cy AND stuck == 1) then uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) mx2=uo.getx() uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) my2=uo.gety() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) end if
#---------------------------------------------------------------- Case 2 # if (lx <= cx AND ly < cy AND stuck == 1) then uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) mx2=uo.getx() uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) my2=uo.gety() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) end if
#---------------------------------------------------------------- Case 3 # if (lx < cx AND ly <= cy AND stuck == 1) then uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) my2=uo.gety() uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) mx2=uo.getx() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if end if
#---------------------------------------------------------------- Case 4 # if (lx > cx AND ly <= cy AND stuck == 1) then uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) my2=uo.gety() uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) mx2=uo.getx() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) end if
#---------------------------------------------------------------- Case 5 # if (lx >= cx AND ly < cy AND stuck == 1) then uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) mx2=uo.getx() uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) my2=uo.gety() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if end if
#---------------------------------------------------------------- Case 6 # if (lx >= cx AND ly > cy AND stuck == 1) then uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) mx2=uo.getx() uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) uo.press(35) wait(250) my2=uo.gety() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250)
end if
#---------------------------------------------------------------- Case 7 # if (lx > cx AND ly >= cy AND stuck == 1) then uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) my2=uo.gety() uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) uo.press(34) wait(250) mx2=uo.getx() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if end if
#---------------------------------------------------------------- Case 8 # if (lx < cx AND ly >= cy AND stuck == 1) then uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) uo.press(33) wait(250) my2=uo.gety() uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) uo.press(36) wait(250) mx2=uo.getx() diffx = mx2 - mx1 diffy = my2 - my1 if (diffx < 0) then diffx = diffx * (-1) end if if (diffy < 0) then diffy = diffy * (-1) end if if (diffx > 0 AND diffy > 0) then stuck = 0 end if end if
cx1=0 cy1=0 cx2=5 cy2=5 movex=0 movey=0 end if
# &&&&&&&& If lag causes the char to overload this fixes it &&&&&&&& #
if uo.injournal("cliloc# 0xA18D") then uo.findtype(0x19b9,0x0000,2) uo.waittargettype (0x19b9,0x0000) uo.drop(5,1,"finditem") UO.deletejournal() wait(10000) end if if uo.injournal("cliloc# 0xA18E") then wait(10000) UO.deletejournal() end if
# &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& #
# %%%% Moves char in direction of destination %%%% #
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 end if
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 end if
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 end if
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 end if
until (lx == cx and ly == Cy) end sub
|