собственно изменения которые он претерпел с 1 вопроса это ода строчка с NEXT ;D в 400 строке
Code:
sub main()
uo.Exec('terminate Reconnector')
wait(1000)
uo.Exec('exec Reconnector')
wait(1000)
while not uo.dead()
recall()
gomine()
gominback()
gomine()
wend
endsub
Sub gomine()
go(1459,1510,1)
go(1458,1507,1)
go(1457,1506,1)
go(1455,1505,1)
go(1452,1506,1)
go(1450,1509,1)
go(1450,1512,1)
go(1450,1513,1)
go(1448,1515,1)
go(1451,1517,1)
go(1452,1519,1)
go(1451,1521,1)
go(1448,1522,1)
go(1445,1523,1)
go(1445,1525,1)
go(1447,1527,1)
go(1448,1528,1)
go(1450,1530,1)
go(1452,1529,1)
go(1454,1529,1)
endsub
Sub gominback()
go(1446,1533,0)
go(1441,1524,0)
go(1447,1504,0)
go(1460,1504,0)
endsub
Sub kopka()
var kirka='0x0E85'
var i,j,x,y,z
var ms1="Try mining"
var ms2="You put"
var ms3="There is no ore"
var ms4="You loosen"
x=uo.getx('self')
y=uo.gety('self')
z=uo.getz('self')
hiding()
for i=-1 to 1
for j=-1 to 1
repeat
uo.deletejournal()
uo.waittargettile(0,x+i,y+j,z)
wait(100)
uo.usetype(kirka)
wait(100)
repeat
wait(100)
until uo.injournal(ms1) or uo.injournal(ms2) or uo.injournal(ms3) or uo.injournal(ms4)
until uo.injournal(ms1) or uo.injournal(ms3)
next
next
endsub
Sub Hiding()
var ms1="You have hidden"
var ms2="You can't"
if uo.Hidden('self') then
wait(100)
else
repeat
uo.deletejournal()
uo.useskill('Hiding')
repeat
wait(100)
until uo.injournal(ms1) or uo.injournal(ms2)
until uo.injournal(ms1)
endif
endsub
Sub go(x,y,k)
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
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 Then
Exit=1
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
if k==1 then
kopka()
endif
end sub
Sub StepEdit(x,y,dir,key)
VAR walkwait=400
VAR ErrLevel=0
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
If x==UO.GetX() AND y==UO.GetY() Then
ErrLevel=1
Endif
Endif
Return ErrLevel
endsub
Sub StepArrow(x,y,dir,ldir,rdir,key)
VAR walkwait=400
VAR ErrLevel=0
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
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
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
ErrLevel=1
Endif
Endif
Endif
Return ErrLevel
endsub
Sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
Wait(50)
until UO.InJournal('backpack')
endsub
Sub recall ()
Uo.exec("set norbcheck 1"); для рекола
uo.exec("set norbcalc 1"); тоже
wait(100)
UO.FindType('0x19B9')
if UO.GetQuantity('finditem')>0 then
CheckLag()
uo.exec("recall 0x40294E90 21") ; домой ( в рунбуке слот 1 )
CheckLag()
wait(10000)
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
VAR UnloadCont='0x404D7327';--------айди сундука куда кидать руду
DIM Ore[5]
Ore[0]=0x19B9 ; 4 and more ore
Ore[1]=0x19B7 ; 1 ore
Ore[2]=0x19BA ; 2 ore
Ore[3]=0x19B8 ; 3 ore
UO.SetReceivingContainer(UnloadCont)
wait(500)
For a=0 to 3
Exit=0
repeat
UO.FindType(Ore[a])
if UO.GetQuantity('finditem')>0 then
UO.Grab('0','finditem')
wait(1500)
Else
Exit=1
endif
until Exit==1
next
UO.UnSetReceivingContainer()
CheckLag()
uo.exec("recall 0x40294E90 33") ; скала ( в рунбуке слот 2 )
CheckLag()
wait(10000)
endif
end sub
Sub Reconnector()
var ReconnectTime, RFlag
ReconnectTime = '0'
RFlag = 1
Repeat
While (uo.ObjAtLayer('Bpack') == '')
if RFlag Then
ReconnectTime = MakeTime()
RFlag = 0
endif
Wait(70000) # WorldSave Protection
uo.Say('')
Wait(5000)
uo.Say('')
Wait(5000)
uo.Say('')
Wait(5000)
uo.LDblClick(357,164)
uo.LClick(616,459)
Wait(5000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
uo.TextOpen()
uo.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
#uo.useobject('self')
#wait(2000)
uo.useobject('backpack')
wait(2000)
uo.Exec('terminate main')
wait(5000)
uo.Exec('exec main')
wait(5000)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub
Sub MakeTime()
VAR D, T, Ret, U
Ret = STR(uo.Time())
T = ""
For U = 0 To Len(Ret)
T = Ret[Len(Ret)-U] + T
If (U == 2) OR (U == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(uo.Date())
D = ""
For U = 0 To Len(Ret)
D = Ret[Len(Ret)-U] + D
If (U == 2) OR (U == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub