Perpetual Mining Macro With Tinker (RUO V1.0 RC0 TESTED)

Anything and all.

Moderators: Murderator+, Murderator

Post Reply
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Perpetual Mining Macro With Tinker (RUO V1.0 RC0 TESTED)

Post by Dmagic »

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/

Image

Image


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
Last edited by Dmagic on 2004-10-15 05:58:00, edited 2 times in total.
seffignoz
Posts: 3
Joined: 2004-09-07 18:23:47

Post by seffignoz »

That macro is great, thank you man.. but there is a problem...

when picks are < 50, it tryes to make 'em through Tinkering.. so, it open the box and take 200 ingots..
my macro stops just here, it appear a message box saying "Parse Error at line 906 <- (the end of the script)

i can't find any error on the script...

it stops about here

uo.UseObject(boxid)
wait(700)
uo.findtype(0x1bf2,0x0000,boxid)
uo.exec ("grab 200 finditem")
..........
.........

can you check it please?
Sfagnum
Expert!
Posts: 1284
Joined: 2004-07-04 00:14:58
Contact:

Post by Sfagnum »

seffignoz wrote:my macro stops just here, it appear a message box saying "Parse Error at line 906 <- (the end of the script)

i can't find any error on the script...
it's like, that somewhere inverted commas are not closed, check it

seffignoz wrote:uo.exec ("grab 200 finditem")
Try to change this to uo.Grab('200', 'finditem'), maybe it'll help you.
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Not sure

Post by Dmagic »

Im not sure what is going on there. I just copied the macro off the post and it looks like it is working. You could try doing the same and just pasting your info back into it. I think I have seen that error before when a loop is not closed, like a while or an if statment.
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Use it?

Post by Dmagic »

Hey, if you use this macro let me know what you think. Any ideas on what to add? Is it any good? Just let me know what you think. I have some more macros finished, all I got to do is make them look pretty and ill post em.
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Error Fixed

Post by Dmagic »

I finially got the parse error. Looks like i forgot an end if in the tinker function. The new section of code should look like this:

Code: Select all


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



Sorry it took so long to get this fixed. I didnt get the error untill I modified the script for another shard. Enjoy!

EDIT: The whole macro code in the first post has been updated.

-Dmagic
punkesito
Posts: 46
Joined: 2004-10-16 12:30:54
Location: Argentina
Contact:

Re: Perpetual Mining Macro With Tinker (RUO V1.0 RC0 TESTED)

Post by punkesito »

Dmagic wrote:

Code: Select all

#0000000000000000000000000000000000000000000000000000#


time = time + 1

if (time > 10) then
uo.say(",resend")
time = 0
end if

#xxxxxxxxx Attempts to free stuck char xxxxxxxxx#

change uo.say(",resend") for uo.resend(), and don't use UO.say use UO.ServerPrint
PD: good script(tested in other runuo rc0 shard(http://www.osiris-uo.com.ar/))
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

yes

Post by Dmagic »

Yes, there are a few things that can be changed to enhance the code. I have been using this script for a while, and it is my first MAJIOR script, so there is probably better ways to do alot of the things. It is hard to learn to script for injection because most of the resources are in russian, but it is not impossible. Thanks for the input.

-Dmagic
punkesito
Posts: 46
Joined: 2004-10-16 12:30:54
Location: Argentina
Contact:

very usefull script for locations

Post by punkesito »

very usefull script for locations

Code: Select all

sub location()
var sss,x,y,z,i,c
uo.exec("infotile")
wait(2000)
uo.textclear()
sss=UO.lasttile()
i=strlen(sss)
c=0
while sss[i]<>" "
i=i-1
c=c+1
wend
z=right(sss,c-1)
i=i-1
while sss[i]<>" "
i=i-1
c=c+1
wend
y=right(sss,c)
y=left(y,4)
i=i-1
while sss[i]<>" "
i=i-1
c=c+1
wend
x=right(sss,c+1)
x=left(x,4)
uo.textprint("if (loc==x) then")
uo.textprint("orex="+str(uo.getx("self")))
uo.textprint("orey="+str(uo.gety("self")))
uo.textprint("minex="+x)
uo.textprint("miney="+y)
uo.textprint("minez="+z)
uo.textprint("end if")
end sub

edited:now it does not use injournal
Last edited by punkesito on 2004-12-15 06:23:27, edited 1 time in total.
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Cool!

Post by Dmagic »

Nice! Ill have to try that out when I get a chance.

Thanks,
Dmagic
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Where?

Post by Dmagic »

I was just wondering what RUO shards you guys were using this script on? I like to look and see what servers people are playing on.
BHTrix
Posts: 10
Joined: 2004-12-20 14:27:48

Post by BHTrix »

Mm
I'm trying to mine in malas mines, and whatever I try, still I'm getting the "cannot see target" "bug?". Any one any clue what might cause this?

I tried changing the tyle type, but also on a wall, it just won't budge
BHTrix
Posts: 10
Joined: 2004-12-20 14:27:48

Hmmk

Post by BHTrix »

I fixed that, had to trough the macro around a bit

instead of:

Code: Select all

uo.waittargettile( 0,str(minex), str(miney), str(minez)) 

I added the variable minet (which is the tile code)

Code: Select all

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: 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 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
BHTrix
Posts: 10
Joined: 2004-12-20 14:27:48

k

Post by BHTrix »

Here's how far I got
It recalls to location, using same movething
u dont need to add orex and y nemore.

I just need to fix the tinker thing so it makes shovels, and make it so it or :: can buy regs, or gets regs from bank.
And am trying to add a food thing but it won't find me stakes in bank ;/
tinker is main prob though. Ow it's full stealth btw too

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                                                    ;X and Y locations of where you are standing

RECALL:
UO.DeleteJournal()
IF    UO.Waiting() THEN                                          ;IF a target is up THEN
   UO.CancelTarget()                                           ;the target is cancelled.
ENDIF

MX = UO.GetX("self")                                           ;Gets the X Coord
MY = UO.GetY("self")                                           ;Gets the Y Coord

UO.DeleteJournal()                                              ;Deletes Journal
UO.Say('Bank')                                                 ;Opens the Bank Box
UO.Cast('Recall','0x40011A87')                                     ;Recalls to mine
wait(4000)

   IF NOT UO.GetX("self") <> MX and not UO.GetY("self") <> MY THEN       ;IF you're still standing on the same spot
   GOTO RECALL                                                ;We try again
   ENDIF
   
end sub

Sub Bank()

VAR MX, MY                                                    ;X and Y locations of where you are standing

RECALL:
UO.DeleteJournal()
IF    UO.Waiting() THEN                                          ;IF a target is up THEN
   UO.CancelTarget()                                           ;the target is cancelled.
ENDIF

MX = UO.GetX("self")                                           ;Gets the X Coord
MY = UO.GetY("self")                                           ;Gets the Y Coord

UO.DeleteJournal()                                              ;Deletes Journal
UO.UseSkill('Hiding')                                          ;Hides
wait(1000)
UO.Cast('Recall','0x40011A89')                                     ;Recalls to bank
wait(4000)

   IF NOT UO.GetX("self") <> MX and not UO.GetY("self") <> MY THEN       ;IF you're still standing on the same spot
   GOTO RECALL                                                ;We try again
   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
Dmagic
Posts: 11
Joined: 2004-09-26 05:52:58

Walk Bug

Post by Dmagic »

What did you notice with the walk function?
Post Reply