Mining For DRW. Кто поможет найти ошибку?
Posted: 2005-01-06 15:59:14
var mx, my, mz, i, j
var cavenumber=0
var maxcaves=5 #Номер рунки последней шахты
Uo.exec("set norbcheck 1")# для рекола
uo.exec("set norbcalc 1") # для рекола
sub AddObj()
uo.print('Выбери Лопату!')
uo.exec('addobject Shovel')
while uo.targeting()
wait(100)
wend
uo.print('Выбери Рунбук!')
uo.exec('addobject Runebook')
while uo.targeting()
wait(100)
wend
uo.print('Руна!')
uo.exec('addobject runeHome')
while uo.targeting()
wait(100)
wend
end sub
sub mining()
UO.DeleteJournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-4 to mx+4
for j = my-4 to my+4
while not UO.Hidden()
UO.Exec('warmode 0')
UO.UseSkill('Hiding')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied')
wend
UO.Print("Копаем в координатах: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock") and not UO.InJournal("Rose") and not UO.InJournal("Copper") and not UO.InJournal("Bronze") and not UO.InJournal("Rusty") and not UO.InJournal("Iron") and not UO.InJournal("Silver")
UO.DeleteJournal()
if uo.waiting() then
uo.canceltarget()
endif
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Useobject("Shovel")
while not UO.InJournal("You put") and not UO.InJournal("heavy") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait (500)
wend
if uo.weight > 500 then
GoHome()
RunebookRecall()
endif
Wend
UO.DeleteJournal()
Next
Next
GoHome()
RunebookRecall()
Wend
End Sub
sub GoHome()
var Time
mx = UO.GetX("self")
my = UO.GetY("self")
repeat
UO.Exec("recall Runebook 21") # Home
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs')
cavenumber=cavenumber+1
if cavenumber==maxcaves then
cavenumber=0
end sub
sub RunebookRecall()
dim runes[5]
runes[0]=33 # Slot 2
runes[1]=46 # Slot 3
runes[2]=58 # Slot 4
runes[3]=64 # Slot 5
runes[4]=73 # Slot 6
var Time
mx = UO.GetX("self")
my = UO.GetY("self")
repeat
uo.exec("recall Runebook " + Str(runes[cavenumber]))
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs')
cavenumber=cavenumber+1
if cavenumber==maxcaves then
cavenumber=0
end sub
sub UnloadOre()
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
VAR UnloadCont='0x4010A242';--------айди сундука куда кидать руду
DIM Ore[4]
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()
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('backpack')
end sub
var cavenumber=0
var maxcaves=5 #Номер рунки последней шахты
Uo.exec("set norbcheck 1")# для рекола
uo.exec("set norbcalc 1") # для рекола
sub AddObj()
uo.print('Выбери Лопату!')
uo.exec('addobject Shovel')
while uo.targeting()
wait(100)
wend
uo.print('Выбери Рунбук!')
uo.exec('addobject Runebook')
while uo.targeting()
wait(100)
wend
uo.print('Руна!')
uo.exec('addobject runeHome')
while uo.targeting()
wait(100)
wend
end sub
sub mining()
UO.DeleteJournal()
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-4 to mx+4
for j = my-4 to my+4
while not UO.Hidden()
UO.Exec('warmode 0')
UO.UseSkill('Hiding')
repeat
wait(50)
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide') OR UO.InJournal('preoccupied')
wend
UO.Print("Копаем в координатах: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("no ore here") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("in rock") and not UO.InJournal("Rose") and not UO.InJournal("Copper") and not UO.InJournal("Bronze") and not UO.InJournal("Rusty") and not UO.InJournal("Iron") and not UO.InJournal("Silver")
UO.DeleteJournal()
if uo.waiting() then
uo.canceltarget()
endif
UO.Waittargettile("1341", str(i), str(j), str(mz))
UO.Useobject("Shovel")
while not UO.InJournal("You put") and not UO.InJournal("heavy") and not UO.InJournal("location") and not UO.InJournal("no ore") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("in rock")
wait (500)
wend
if uo.weight > 500 then
GoHome()
RunebookRecall()
endif
Wend
UO.DeleteJournal()
Next
Next
GoHome()
RunebookRecall()
Wend
End Sub
sub GoHome()
var Time
mx = UO.GetX("self")
my = UO.GetY("self")
repeat
UO.Exec("recall Runebook 21") # Home
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs')
cavenumber=cavenumber+1
if cavenumber==maxcaves then
cavenumber=0
end sub
sub RunebookRecall()
dim runes[5]
runes[0]=33 # Slot 2
runes[1]=46 # Slot 3
runes[2]=58 # Slot 4
runes[3]=64 # Slot 5
runes[4]=73 # Slot 6
var Time
mx = UO.GetX("self")
my = UO.GetY("self")
repeat
uo.exec("recall Runebook " + Str(runes[cavenumber]))
CheckLag()
Time=uo.Timer()
repeat
wait(500)
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or Time+200<uo.Timer()
uo.DeleteJournal()
until not UO.GetX("self") <> mx And not UO.GetY("self") <> my or uo.Dead() or uo.InJournal('needs')
cavenumber=cavenumber+1
if cavenumber==maxcaves then
cavenumber=0
end sub
sub UnloadOre()
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
VAR UnloadCont='0x4010A242';--------айди сундука куда кидать руду
DIM Ore[4]
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()
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('backpack')
end sub