Perpetual Mining Macro With Tinker (RUO V1.0 RC0 TESTED)
Posted: 2004-09-27 07:01:02
Here you go. This macro was scripted and tested on a RUO V1.0 RC0 emu. It requires a little work to setup, but once you get it goin you cash in big.
First you need to place a customizable house to smelt ore, drop ingots, and get picks at. I use a 7x7 customizable house for this.
Second you need some type of container and a forge to place at the house. Once you have this setup you need to get the id from the box and the x,y coords outside the house close enough to access the box and forge.
Next you map the area you want to mine using ,infotile command and looking at the x,y display on injection in the taskbar. This tells the macro where to stand and where to mine. Write these values down for each spot you want to mine. You can have as many spots as you like, but try and make sure they are fairly close to the house, and that the mountain is fairly straight.
What I do is mine a spot dry and try every tile along the cliff untill I find the next spot, then record that spot and repeat. The values you will get will be called orex,orey,minex,miney,minez for each spot.
Once you have all of this information it can be plugged into the macro.
This macro was tested on Dark Other, which is a shard running RUO version 1.0 RCO. http://www.darkother.com/
You can check out some info for runuo here:
http://www.runuo.com/
First you need to place a customizable house to smelt ore, drop ingots, and get picks at. I use a 7x7 customizable house for this.
Second you need some type of container and a forge to place at the house. Once you have this setup you need to get the id from the box and the x,y coords outside the house close enough to access the box and forge.
Next you map the area you want to mine using ,infotile command and looking at the x,y display on injection in the taskbar. This tells the macro where to stand and where to mine. Write these values down for each spot you want to mine. You can have as many spots as you like, but try and make sure they are fairly close to the house, and that the mountain is fairly straight.
What I do is mine a spot dry and try every tile along the cliff untill I find the next spot, then record that spot and repeat. The values you will get will be called orex,orey,minex,miney,minez for each spot.
Once you have all of this information it can be plugged into the macro.
This macro was tested on Dark Other, which is a shard running RUO version 1.0 RCO. http://www.darkother.com/
You can check out some info for runuo here:
http://www.runuo.com/


Code: Select all
# ^^^^^^^^^^^^^^^^^^^ #
# 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 smeltx
var smelty
var picks
var numloc
var cweight
#!!!!!!!!!!!!!!!!!!!!!!!!!#
# you must enter these values for your area #
boxid = 0x4000014F
boxx = 1226
boxy = 459
smeltx = 1226
smelty = 459
numloc = 12
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=1217
orey=459
minex=1216
miney=459
minez=-90
end if
if (loc == 2) then
orex=1215
orey=463
minex=1214
miney=463
minez=-90
end if
if (loc == 3) then
orex=1215
orey=464
minex=1214
miney=464
minez=-90
end if
if (loc == 4) then
orex=1217
orey=472
minex=1216
miney=472
minez=-90
end if
if (loc == 5) then
orex=1217
orey=480
minex=1216
miney=480
minez=-90
end if
if (loc == 6) then
orex=1216
orey=482
minex=1215
miney=482
minez=-90
end if
if (loc == 7) then
orex=1215
orey=488
minex=1214
miney=488
minez=-90
end if
if (loc == 8) then
orex=1215
orey=496
minex=1214
miney=496
minez=-90
end if
if (loc == 9) then
orex=1212
orey=504
minex=1211
miney=504
minez=-90
end if
if (loc == 10) then
orex=1208
orey=508
minex=1207
miney=508
minez=-90
end if
if (loc == 11) then
orex=1202
orey=512
minex=1201
miney=512
minez=-90
end if
if (loc == 12) then
orex=1199
orey=513
minex=1199
miney=512
minez=-90
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,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,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( 0, 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