Code: Select all
;===---====----===---===---= Mining =---=-=-=-=-=--=-=-=-=-=-=-
sub mine()
VAR i,TileY,TileX,DirX,DirY
UO.Exec('exec alarm')
While NOT UO.Dead()
DirX=1
DirY=1
For TileY=1 to 4
For TileX=1 to 17
ToHide()
digit()
walk(1*DirX,0)
next
ToHide()
digit()
DirX=-1*DirX
walk(0,1*DirY)
next
ToHide()
digit()
DirY=-1*DirY
walk(989-UO.GetX(),1584-UO.GetY())
wend
end sub
sub digit()
VAR Last=0,LastTimer
VAR MaxWeight=290
if UO.Weight>MaxWeight then
unloadore()
endif
repeat
CheckLag()
UO.WaitTargetSelf()
UO.UseType('0x0e85') ;add pickaxe to object type
LastTimer=UO.Timer()
repeat
wait(100)
until 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+150<UO.Timer()
wait(1000)
if UO.InJournal('You put') then
repeat
wait(100)
until UO.InJournal("You put") OR LastTimer+105<UO.Timer()
endif
until UO.InJournal('You loosen') OR UO.InJournal("There is no") OR UO.InJournal("That is too")
wait(1000)
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(50)
until UO.InJournal('backpack')
end sub
sub unloadore()
VAR TempX,TempY,i,Exit
DIM Ore[5]
TempX=UO.GetX()
TempY=UO.GetY()
walk(5298-TempX,2024-TempY)
ToHide()
Ore[0]=0x19b9; 4 and more ore
Ore[1]=0x19B7 ; 1 ore
Ore[2]=0x19BA ; 2 ore
Ore[3]=0x19B8 ; 3 ore
UO.SetReceivingContainer('0x4004570A') ; serial of store container
wait(500)
Exit=0
For i=0 to 3
repeat
UO.FindType(Ore[i])
CheckLag()
if UO.GetQuantity('finditem')>0 then
UO.Grab('0','finditem')
CheckLag()
wait(2000)
Else
Exit=1
endif
until Exit==1
Next
UO.UnSetReceivingContainer()
walk(TempX-5292,TempY-2021)
ToHide()
end sub
sub tohide()
while NOT UO.Hidden()
UO.DeleteJournal()
UO.UseSkill('Hiding')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide')
wend
end sub
sub walk(dx,dy)
VAR i, walkwait=400
If dx<>0 then
If dx>0 then
If UO.GetDir()<>2 then
UO.Press(34)
wait(walkwait)
Endif
For i=1 to dx
UO.Press(34)
wait(walkwait)
next
Else
If UO.GetDir()<>6 then
UO.Press(36)
wait(walkwait)
Endif
For i=1 to dx*-1
UO.Press(36)
wait(walkwait)
next
Endif
endif
If dy<>0 then
If dy>0 then
If UO.GetDir()<>4 then
UO.Press(35)
wait(walkwait)
Endif
For i=1 to dy
UO.Press(35)
wait(walkwait)
next
Else
If UO.GetDir()<>0 then
UO.Press(33)
wait(walkwait)
Endif
For i=1 to dy*-1
UO.Press(33)
wait(walkwait)
next
Endif
endif
wait(1000)
end sub
sub alarm()
while NOT UO.Dead()
wait(1000)
if UO.Life<50 then
gong(1)
endif
wend
end sub
sub gong(times)
VAR i
for i=1 to times
UO.Exec("playwav C:\cow")
wait(1200)
next
end sub
Если вам не сложно, напишите, что какая функция соответствует, и к чему каждая координата(пример: TempX-5292,TempY-2021) я очень хочу разобраться! Заранее спасибо!!!