sub mine()
VAR DigDistance, TileNum, KillElemental
VAR ElemSignal, LastTimer
DIM BaseX[4], BaseY[4]
VAR BaseZ, WayPoint, WayPoints
VAR MaxWeight
VAR i,j,TileY,TileX,DirX,DirY
VAR Delta,BeginX,EndX,BeginY,EndY
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; TileNum='Num' - Use ",infotile" command on the floor
; Íîìåð òàéëà â êîòîðîì ìîæíî êîïàòü ,ïîòûêàéòå êîìàíäîé
; ",infotile" ïî ðàçíâì òàéëàì è ïîñìîòðèòå íå îòëè÷àþòñÿ ëè èõ
; íîìåðà.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TileNum='1339'
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Ìàêñèìàëüíûé âåñ, êîòîðûé ìîæåò ïîäíÿòü ÷àð. Ñòàâüòå åãî
; íåìíîãî ìåíüøå ðåàëüíîãî. Òî åñòü åñëè ÷àð ïîäíèìàåò 760, òî
; ñòàâèì 730.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
MaxWeight=25000
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; DigDistance=4 - Distance from tile where pickaxe targeting
; Ðàäèóñ êðóãà ïî êîòîðîìó áóäåò êîïàòü ÷àð, òî åñòü ðàññòîÿíèå
; äî êëåòêè êóäà ìîæíî äîòÿíóòüñÿ êèðêîé.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DigDistance=2
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; KillElemental='Yes'/'No' - Use 'Yes' if char skilled to morph
; in daemon and wrestling > 50
; Åñëè ÷àð äîñòàòî÷íî ïðîêà÷åí ÷òîá áèòü ýëåìîâ, ñòàâüòå 'Yes'
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
KillElemental='No'
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; ElemSignal='Off'/'On' - Play sound when elemental is digged
; Îïîâåøàòü ïðè ïîÿâëåíèè ýëåìà
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ElemSignal='Off'
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Çäåñü óêàçûâàåì êîîðäèíàòû òî÷åê êîïàíèÿ. Íóæíî âñòàòü íà
; ïîçèöèþ è ïîñìîòðåòü êîîðäèíàòû â èíæåêòå. Èõ è íóæíî
; ïîäñòàâèòü âìåñòî ìîèõ. ×àðà ñòàâüòå íà 4 êëåòêè îò ñòåí.
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
BaseX[0]=1647
BaseY[0]=2899
BaseZ=0
BaseX[1]=1648
BaseY[1]=2906
BaseZ=0
BaseX[2]=1651
BaseY[2]=2915
BaseZ=0
BaseX[3]=1653
BaseY[3]=2922
BaseZ=0
BaseX[4]=1655
BaseY[4]=2927
BaseZ=0
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
; Óêàçûâàåì êîëè÷åñòâî òî÷åê êîïàíèÿ
;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
WayPoints=5
CheckLag()
UO.UseObject('Sunduk')
LastTimer=UO.Timer()
Repeat
wait(500)
Until UO.InJournal('You can') OR UO.InJournal('What is the') OR UO.Timer()>LastTimer+100
If UO.InJournal('see the') Then
UO.Say("Podoydi k sunduku i tkni v nego pricelom!")
UO.AddObject('Sunduk')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.UseObject('Sunduk')
Else
; UO.Say("1")
Endif
CheckLag()
UO.UseObject('IronBag')
LastTimer=UO.Timer()
Repeat
wait(500)
Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
If UO.InJournal('see the') Then
UO.Say("1")
UO.AddObject('IronBag')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
Else
; UO.Say("1")
Endif
CheckLag()
UO.UseObject('OtherBag')
LastTimer=UO.Timer()
Repeat
wait(500)
Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
If UO.InJournal('see the') Then
UO.Say("1?")
UO.AddObject('OtherBag')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
Else
; UO.Say("1.")
Endif
CheckLag()
UO.UseObject('BestBag')
LastTimer=UO.Timer()
Repeat
wait(500)
Until UO.InJournal('You can') OR UO.InJournal('What is the')OR UO.Timer()>LastTimer+100
If UO.InJournal('see the') Then
UO.Say("V kakoy meshok kidat' vihu?")
UO.AddObject('BestBag')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
Else
; UO.Say("1.")
Endif
While NOT UO.Dead()
For WayPoint=0 to WayPoints-1
walkn(BaseX[WayPoint],BaseY[WayPoint],"")
digitstay(MaxWeight,DigDistance,KillElemental,ElemSignal,BaseX[WayPoint],BaseY[W
ayPoint])
Next
wend
end sub
; Ïðîâåðêà íóæíîñòè ðóäû. Çàêîìåíòèðîâàòü òî ÷òî íóæíî êîïàòü.
sub CheckOre()
VAR Cont=1, i=0, Exit=0
VAR Count=7 ; Ñêîëüêî ýëåìåíòîâ â ìàññèâå.
DIM Ores[15]
Ores[0]="Iron"
Ores[1]="Rusty"
Ores[2]="Old Copper"
Ores[3]="Dull Copper"
Ores[4]="Copper"
Ores[5]="Bronze"
Ores[6]="Silver"
; Ores[7]="Shadow"
; Ores[8]="Rose"
; Ores[9]="Gold"
; Ores[10]="Agapite"
; Ores[11]="Blood Rock"
; Ores[12]="Verite"
; Ores[13]="Valorite"
; Ores[14]="Mytheril"
While i<Count AND Exit==0
If UO.InJournal(Ores) Then
Cont=0
Exit=1
Endif
; UO.Print(STR(i))
; UO.Print(Ores)
i=i+1
Wend
return Cont
end sub
;-------------------- Try to mine under self ------------------
sub digitstay(MaxWeight,MaxDistance,KillElemental,ElemSignal,BaseX,BaseY)
VAR x,y,z='0',TileNum='1339'
VAR Last=0,LastTimer, ContFlag=1
VAR MaxTimer=110
For x=-MaxDistance to MaxDistance
For y=-MaxDistance to MaxDistance
Repeat
CheckLag() ; deleting journal
UO.WaitTargetTile(TileNum,STR(UO.GetX()+x),STR(UO.GetY()+Y),z)
UO.UseType('0x0E85')
LastTimer=UO.Timer()
Repeat
wait(500)
until UO.InJournal("You cannot") OR UO.InJournal("You put") OR UO.InJournal("You loosen") OR UO.InJournal("There is no") OR UO.InJournal("That is too") OR UO.InJournal("OOPS") OR UO.InJournal("attacking you") OR LastTimer+200<UO.Timer()
If NOT UO.InJournal('There is no') then
ContFlag=CheckOre()
Endif
If UO.InJournal('You loosen') then
repeat
wait(500)
until UO.InJournal("You put") OR LastTimer+MaxTimer<UO.Timer()
Endif
If UO.InJournal('something with ore') OR UO.InJournal("attacking you") then
If ElemSignal=='On' Then
Gong(2)
Endif
If KillElemental=='Yes' Then
KillElem()
walkn(BaseX,BaseY,"")
Else
; any user defined command when char digget elemental
Endif
Endif
If UO.InJournal("attacking you") then
gong(3)
Endif
If UO.Weight>=MaxWeight then
Endif
Until UO.InJournal("There is no") OR UO.InJournal("That is too") OR UO.InJournal("Try mining") OR ContFlag==0
Next
Next
end sub
sub GoW()
VAR walkwait=300
VAR x,y,dir=6
VAR key=36 ; Home key
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetX()+1==x Then
return -1
Else
return 1
Endif
end sub
sub GoN()
VAR walkwait=300
VAR x,y,dir=0
VAR key=33 ; PgUp
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetY()+1==y Then
return -1
Else
return 1
Endif
end sub
sub GoE()
VAR walkwait=300
VAR x,y,dir=2
VAR key=34 ; PgDown
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetX()-1==x Then
return -1
Else
return 1
Endif
end sub
sub GoS()
VAR walkwait=300
VAR x,y,dir=4
VAR key=35 ; End
x=UO.GetX()
y=UO.GetY()
while UO.GetDir()<>dir
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
wend
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetY()-1==y Then
return -1
Else
return 1
Endif
end sub
sub GoWN()
VAR walkwait=300
VAR x,y,dir=7
VAR key=38 ; UpArrow
x=UO.GetX()
y=UO.GetY()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub
sub GoNE()
VAR walkwait=300
VAR x,y,dir=1
VAR key=39 ; RightArrow
x=UO.GetX()
y=UO.GetY()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub
sub GoSE()
VAR walkwait=300
VAR x,y,dir=3
VAR key=40 ; DownArrow
x=UO.GetX()
y=UO.GetY()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub
sub GoSW()
VAR walkwait=300
VAR x,y,dir=5
VAR key=37 ; LeftArrow
x=UO.GetX()
y=UO.GetY()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
CheckLag()
Endif
Endif
If UO.GetDir()==dir Then
UO.Press(key)
wait(walkwait)
If x==UO.GetX() AND y==UO.GetY() Then
CheckLag()
Endif
If UO.GetDir()==dir Then
return -1
Else
return UO.GetDir()
Endif
Else
return UO.GetDir()
Endif
end sub
#==============================================================
# WalkN(X,Y,Serial) - char is walking by dX and dY step
# sub using Home, End, PgUp, PgDown keys
# d'not rebind this key from default action!
# walkwait - delay after keypress
#--------------------------------------------------------------
sub WalkN(x,y,Target)
VAR i
VAR dx,dy,Exit=0
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
Exit=1
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()
Endif
If dx>0 AND dy<0 Then
GoNE()
Endif
If dx<0 AND dy>0 Then
GoSW()
Endif
If dx<0 AND dy<0 Then
GoWN()
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
GoE()
Endif
If dx<0 Then
GoW()
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
GoS()
Endif
If dy<0 Then
GoN()
Endif
Endif
Wend
end sub
sub guards()
start:
If (UO.InJournal("an earth elemental") or UO.InJournal("a slime")) then
UO.DeleteJournal()
uo.Say('.guards')
endif
wait(100)
goto start
end sub
sub NewRecon()
while true
while UO.IsOnline()
wait(100)
wend
UO.TextOpen()
UO.TextPrint('Disconnected at '+MakeTime())
UO.Exec('terminate all')
connect:
UO.Say(' ')
wait(3000)
UO.LDblClick(616,455)
wait(3000)
UO.LDblClick(616,455)
wait(3000)
UO.LDblClick(616,455)
wait(3000)
UO.LDblClick(357,164)
if UO.IsOnline() then
UO.Exec('exec mine')
UO.TextOpen()
UO.TextPrint('Reconnected at '+MakeTime())
else
goto connect
endif
wend
endsub
Sub MakeTime()
VAR D, T, Ret, i
Ret = STR(UO.Time())
T = ""
For i = 0 To Len(Ret)
T = Ret[Len(Ret)-i] + T
If (I == 2) OR (I == 4) Then
T = ":" + T
EndIf
Next
Ret = STR(UO.Date())
D = ""
For i = 0 To Len(Ret)
D = Ret[Len(Ret)-i] + D
If (I == 2) OR (I == 4) Then
D = "." + D
EndIf
Next
Ret = T + " @ " + D
RETURN Ret
end sub
#==============================================================
# CheckLag() - click on backpack and awaiting "backpack"
# message in journal.
#
# Journal has been deleted!!!
#--------------------------------------------------------------
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('backpack')
end sub
вот макро, зделано Савагевом с дрв, переделанно мной ))) там все ясно и понятно.....