Code: Select all
sub main2()
uo.ignorereset()
uo.ignore('self')
uo.set('distance',1)
VAR DigDistance, TileNum, LastTimer
DIM BaseX[11], BaseY[11] ## ????????????? ????? ? ?????????, ( ??????? ?? ? ??? )?
VAR BaseZ, WayPoint, WayPoints
VAR MaxWeight, KillElemental
KillElemental='No'
MaxWeight=550
DigDistance=2
WayPoints=10 ## ????????????? ????? ? ?????????, ( ??????? ?? ? ??? )?
## ??? ????? ?????????? ????? ??? ??? ????? ???????? ? ???????? ??????, ?????? ?????? ??????????: 1111,2222 , ?????? ??????????: BaseX[0]=1111 , BaseY[0]=2222. ???? ??? ???? ????? ????? ??? ???? ?? ?????? ???? ???????? ?????( ?????? ???????? ????? ????? ??? ??? ???????????? ????? ?? ?????).
## ?????????? ?1
## ?????????? ?2
BaseX[1]=3434
BaseY[1]=3454
For WayPoint=1 to WayPoints-1
WalkMe(BaseX[WayPoint],BaseY[WayPoint],'')
digitstay(MaxWeight,DigDistance,KillElemental,BaseX[WayPoint],BaseY[WayPoint])
Next
wend
end sub
;-------------------- Try to mine under self ------------------
sub digitstay(MaxWeight,MaxDistance,KillElemental,BaseX,BaseY)
VAR x,y,z='0',TileNum='1339'
VAR Last=0, LastTimer
VAR MaxTimer=110
var myx, myy
For x=-MaxDistance to MaxDistance
uo.print('adasd')
Repeat
Del('You put|You are hungry|You loosen|is nothing|line of sight to that|That is too|You cannot|Try mining')
dig:
checklag()
UO.WaitTargetTile(TileNum,STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
LastTimer=UO.Timer()
Repeat
uo.deletejournal()
repeat
wait(100)
until UO.InJournal('is nothing|You are hungry|line of sight to that|That is too|You cannot|Try mining') OR LastTimer+250<UO.Timer() #OR uo.life < uo.str
Until UO.InJournal('is nothing|line of sight to that|That is too|You cannot|Try mining') OR LastTimer+60<UO.Timer()
if uo.weight>300 then
plavka()
end if
Next
Next
end sub
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;; W A L K E R ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
################# W A L K E R ######################
sub WalkME(x,y,Target)
VAR i
VAR dir,ldir,rdir,key,olddir
VAR dx,dy,Exit=0
VAR CacheLimit=9,CacheIndex="Text"
DIM CacheX[10], CacheY[10]
CacheX[0]="Test"
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
; UO.Print("Target locked!")
If UO.GetDistance(Target)<2 Then
return
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
Endif
Endif
If dx<>0 AND dy<>0 Then
If dx>0 AND dy>0 Then ; GoSE
dir=3
ldir=2
rdir=4
key=40 ; DownArrow
olddir=UO.GetDir()
If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
If olddir==2 Then ; GoNE
dir=1
ldir=0
rdir=1
key=39 ; RightArrow
While UO.GetDir()<>1
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSW
dir=5
ldir=5
rdir=6
key=37 ; LeftArrow
While UO.GetDir()<>5
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
If dx>0 AND dy<0 Then ; GoNE
dir=1
ldir=0
rdir=2
key=39 ; RightArrow
olddir=UO.GetDir()
If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
If olddir==0 Then ; GoWN
dir=7
ldir=6
rdir=7
key=38 ; UpArrow
While UO.GetDir()<>7
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSE
dir=3
ldir=3
rdir=4
key=40 ; DownArrow
While UO.GetDir()<>3
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
If dx<0 AND dy>0 Then ; GoSW
dir=5
ldir=4
rdir=6
key=37 ; LeftArrow
olddir=UO.GetDir()
If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
If olddir==6 Then ; GoWN
dir=7
ldir=7
rdir=0
key=38 ; UpArrow
While UO.GetDir()<>7
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSE
dir=3
ldir=2
rdir=3
key=40 ; DownArrow
While UO.GetDir()<>3
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
If dx<0 AND dy<0 Then ; GoWN
dir=7
ldir=6
rdir=0
key=38 ; UpArrow
olddir=UO.GetDir()
If StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key) Then
If olddir==0 Then ; GoNE
dir=1
ldir=1
rdir=2
key=39 ; RightArrow
While UO.GetDir()<>1
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSW
dir=5
ldir=4
rdir=5
key=37 ; LeftArrow
While UO.GetDir()<>5
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then ; GoE
dir=2
key=34 ; PgDown
olddir=UO.GetDir()
If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
If olddir==2 Then ; GoSE
dir=3
ldir=3
rdir=4
key=40 ; DownArrow
While UO.GetDir()<>3
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoNE
dir=1
ldir=1
rdir=0
key=39 ; RightArrow
While UO.GetDir()<>1
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
If dx<0 Then ; GoW
dir=6
key=36 ; Home key
olddir=UO.GetDir()
If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
If olddir==0 Then ; GoWN
dir=7
ldir=7
rdir=0
key=38 ; UpArrow
While UO.GetDir()<>7
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSW
dir=5
ldir=4
rdir=5
key=37 ; LeftArrow
While UO.GetDir()<>5
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then ; GoS
dir=4
key=35 ; End
If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
If olddir==2 Then ; GoSE
dir=3
ldir=2
rdir=3
key=40 ; DownArrow
While UO.GetDir()<>3
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoSW
dir=5
ldir=6
rdir=5
key=37 ; LeftArrow
While UO.GetDir()<>5
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
If dy<0 Then ;GoN
dir=0
key=33 ; PgUp
olddir=UO.GetDir()
If StepEdit(UO.GetX(),UO.GetY(),dir,key) Then
If olddir==2 Then ; GoNE
dir=1
ldir=1
rdir=2
key=39 ; RightArrow
While UO.GetDir()<>1
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Else ; GoWN
dir=7
ldir=7
rdir=6
key=38 ; UpArrow
While UO.GetDir()<>7
StepArrow(UO.GetX(),UO.GetY(),dir,ldir,rdir,key)
Wend
Endif
Endif
Endif
Endif
Wend
end sub
sub StepEdit(x,y,dir,key)
VAR walkwait=300
VAR ErrLevel=0
If UO.GetDir()<>dir Then
checkstam()
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
checkstam()
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
If x==UO.GetX() AND y==UO.GetY() Then
;zatik
ErrLevel=1
Endif
Endif
Return ErrLevel
end sub
sub StepArrow(x,y,dir,ldir,rdir,key)
VAR walkwait=300
VAR ErrLevel=0
If UO.GetDir()<>dir Then
checkstam()
UO.Press(key)
If UO.GetDir()<>dir AND UO.GetDir()<>ldir AND UO.GetDir()<>rdir Then
CheckLag()
Endif
Endif
If UO.GetX()==x AND UO.GetY()==y Then
checkstam()
UO.Press(key)
wait(walkwait)
If UO.GetDir()==dir AND UO.GetX()==x AND UO.GetY()==y Then
CheckLag()
If UO.GetDir()==dir AND UO.GetX()==x AND UO.GetY()==y Then
; zatik
ErrLevel=1
Endif
Endif
Endif
Return ErrLevel
end sub
sub checkstam()
var refresh = '0x0F0B'
if uo.stamina < 10 then
uo.findtype(refresh,-1,'backpack')
if uo.findcount() then
uo.usetype(refresh)
wait(1000)
else
uo.print("Nety Refreshey! Stoim...")
repeat
wait(500)
endif
else
endif
endsub
Sub CHECKLAG()
var i=0
del('backpack')
uo.click('backpack')
repeat
wait(10)
until uo.injournal('backpack') or i>1000
del('backpack')
endsub
Sub DEL(msg)
uo.setJournalLine(uo.injournal(msg)-1,"Is Empty!")
wend
endsub
sub GotoXY(x,y)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
for i=1 to 60
myX=uo.getX();
myY=uo.getY();
if LastX==myX and LastY==myY then
halt=halt+1
else
halt=0
end if
if halt>=10 then
if uo.GetDir()==1 then
for z=0 to 8
uo.Press(40)
next
end if
if uo.GetDir()==3 then
for z=0 to 8
uo.Press(37)
next
end if
if uo.GetDir()==5 then
for z=0 to 8
uo.Press(38)
next
end if
if uo.GetDir()==7 then
for z=0 to 8
uo.Press(39)
next
end if
halt=15
end if
if abs(x-myX)<=1 AND abs(y-myY)<=2 then
return 1
end if
if x<=MyX then
if y<=MyY then
for z=0 to 2
uo.press( 38 )
wait(50)
next
else
for z=0 to 2
uo.press(37)
wait(50)
next
end if
else
if y<=MyY then
for z=0 to 2
uo.press(39)
wait(50)
next
else
for z=0 to 2
uo.press(40)
wait(50)
next
end if
end if
lastX=myX
lastY=myY
wait(200)
next
return 0
end sub
Sub Abs(X)
if X>0 then
return X
else
return (-X)
end if
end sub
sub plavka()
var con='45745B0AG53'
gotoxy(5907,2850)
uo.deletejournal()
repeat
uo.say('bank')
wait(3000)
until uo.injournal('Contains')
repeat
uo.findtype(0x19B9)
uo.moveitem('finditem','all',con)
wait(2000)
until uo.count(0x19B9)<1
endsub
Sub CHECKLAG()
var i=0
uo.deletejournal()
uo.click('backpack')
repeat
i=i+1
wait(10)
until uo.injournal('backpack') or i>1000
endsub
sub test()
if uo.getgraphic('0x40062BC9')<>'0x06A6' then
uo.useobject(0x40062BC9)
checklag()
wait(100)
end if
end sub
sub smelt()
repeat
uo.deletejournal()
uo.findtype(0x19B9)
uo.useobject('finditem')
wait(2000)
if uo.injournal('mining is too low') then
uo.drop('all','0','0','0','finditem')
wait(12000)
end if
until not uo.findcount()
end sub
sub pereda4a()
var uolkov='0x0012F82B'
repeat
uo.findtype(0x1BEF)
uo.moveitem('finditem','all',uolkov)
wait(800)
until not uo.findcount()
uo.TradeCheck( uo.TradeCount()-1, "left", true )
wait(1000)
repeat
wait(100)
until uo.TradeCheck( uo.TradeCount()-1, "right" )
end sub
sub walkme2(x,y,f)
var myX,myY,lastX=0,lastY=0,i,halt=0,z,r=0
repeat
myX=uo.getX();
myY=uo.getY();
if abs(x-myX)<=0 AND abs(y-myY)<=0 then
return 1
end if
if x<=MyX then
if y<=MyY then
for z=0 to 1
uo.press( 38 )
wait(50)
next
else
for z=0 to 1
uo.press(37)
wait(50)
next
end if
else
if y<=MyY then
for z=0 to 1
uo.press(39)
wait(50)
next
else
for z=0 to 1
uo.press(40)
wait(50)
next
end if
end if
lastX=myX
lastY=myY
wait(200)
until uo.dead()
end sub
sub rasplav()
VAR Cont='0x400ED43D'
Repeat
UO.FindType('0x19B9',-1,'backpack')
wait(200)
If UO.FindCount() Then
UO.MoveItem('finditem',0,Cont)
Endif
wait(200)
Until NOT UO.FindCount()
repeat
; ToHide()
UO.FindType('0x19B9',-1,Cont)
wait(200)
If UO.FindCount() Then
UO.MoveItem('finditem','1','backpack')
Endif
CheckLag()
UO.UseType('0x19B7')
wait(250)
until NOT UO.FindCount()
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(250)
until UO.InJournal('backpack')
end sub