т.е когда чар выкопал элема он не отходит...м
вот полный скрипт вроде все пральНО??
Code: Select all
sub mining()
var mx, my, mz, i, j, jor, ser, noto
Uo.exec("set norbcheck 1"); для рекола
uo.exec("set norbcalc 1"); тоже
uo.print('!!Выбери Лопату!! ')
uo.exec('addobject Shovel')
while uo.targeting()
wait(100)
wend
uo.print('!!Выбери Руну ДОМОЙ !! ')
uo.exec('addobject runeHome')
while uo.targeting()
wait(100)
wend
uo.print('!!Выбери Руну В ПЕЩЕРУ !! ')
uo.exec('addobject runeCave')
while uo.targeting()
wait(100)
wend
na4alo:
mx = UO.GetX("self")
my = UO.GetY("self")
mz = UO.GetZ("self")
UO.DeleteJournal()
for i = mx-2 to mx+2
for j = my-2 to my+2
while not UO.Hidden()
UO.Warmode("0")
uo.print("Прячемся...")
UO.UseSkill("Hiding")
wait(4000)
wend
UO.Print("Копаем в координатах: "+str(mx-i)+" "+str(my-j))
while not UO.InJournal("There is nothing") and not UO.InJournal("location") and not UO.InJournal("far away") and not UO.InJournal("Iron Ore") and not UO.InJournal("Copper") and not UO.InJournal("Rusty Ore") and not UO.InJournal("You can't use the %s where it is") and not UO.InJournal("Try mining elsewhere")
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("There is nothing") and not UO.InJournal("but fail") and not UO.InJournal("far away") and not UO.InJournal("You can't use the %s where it is") and not UO.InJournal("Try mining elsewhere")
wait (500)
if uo.injournal("heavy") then
WalkN('6028,1243')
wait(500)
Save()
pwav()
end if
if uo.injournal("Wow! a treasure! Oops!") then
wait(1000)
pwav()
wait(1000)
end if
for jor = 0 to 9
ser = uo.journalserial(jor)
noto = uo.getnotoriety(ser)
if noto <> 1 and noto <> 0 and not uo.injournal("elemental") then ;чтоб он сматывался только от пк то:(if noto <> 1 and noto <> 0 and not uo.injournal("elemental") then ) а это чтоб от всех (if noto <> 0 and not uo.injournal("elemental") then )
if uo.waiting() then
uo.canceltarget()
endif
Save()
pwavw()
wait(180000) ; время в секундах при ожидании пока уйдет ПК
loot()
wait(3000)
goto reccal
endif
next
wend
if uo.weight > 600 then ; Максимальный вес при котором домой с рудой
goto end
endif
wend
UO.DeleteJournal()
next
next
goto na4alo
end:
if uo.waiting() then
uo.canceltarget()
endif
uo.waittargetobject('runeHome') ; домой
wait(500)
uo.cast('Recall')
wait(3000)
loot()
wait(3000)
reccal:
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
endif
uo.waittargetobject('runeCave') ; в шахту
wait(500)
uo.cast('Recall')
mx = UO.GetX("self")
my = UO.GetY("self")
wait(10000)
if not UO.GetX("self") <> mx and not UO.GetY("self") <> my then
goto reccal
endif
goto na4alo
end sub
sub loot() ; перекладка руды в сундук
if uo.waiting() then
uo.canceltarget()
endif
VAR a,Exit
VAR UnloadCont='0x40187609' ; АЙДИ сундука для руды
DIM Ore[5]
Ore[0]=0x19B9
Ore[1]=0x19B8
Ore[2]=0x19BA
Ore[3]=0x1BEC
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 Save() ; Реколл от ПК при их появлении (в паке рунка в безопасное место и реги)
var mx, my
reccal:
uo.deletejournal()
if uo.waiting() then
uo.canceltarget()
endif
mx = UO.GetX("self")
my = UO.GetY("self")
UO.DeleteJournal()
uo.waittargetobject('runeHome') ; домой
wait(500)
uo.cast('Recall')
wait(4000)
if not UO.GetX("self") <> mx and not UO.GetY("self") <> my then
goto reccal
endif
end sub
sub pwav() ; звук при выкапывании ЭЛЕМЕНТАЛА
uo.playwav("D:\Gamezz\ULTIMA ONLINE\Inject\SOUND\alert.wav")
endsub
sub pwavw(); звук при появлении ПК
uo.playwav("D:\Gamezz\ULTIMA ONLINE\Inject\SOUND\alert.wav")
endsub
sub Pause() ; Пауза скрипта если выкопали Элема (продолжить сказав GO )
UO.DeleteJournal()
REPEAT
WAIT(3000)
UO.Print("!!!СКРИПТ НА ПАУЗЕ!!!!")
UNTIL UO.InJournal('GO')
UO.Print("!!!СКРИПТ ПРОДОЛЖЕН!!!!")
endif
end sub
sub WalkN(x,y,Target)
VAR i,StepSucess
VAR dx,dy,Exit=0
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
If UO.GetDistance(Target)<2 Then
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
UO.Print('Left '+STR(dx)+' steps to target. ')
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
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
Endif
Endif
If dx>0 AND dy<0 Then
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
Endif
Endif
Endif
If dx<0 AND dy>0 Then
StepSucess=Go(5,37,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
Endif
Endif
Endif
If dx<0 AND dy<0 Then
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
StepSucess=Go(5,37,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
Endif
Endif
Endif
Endif
If dx<>0 AND dy==0 Then
If dx>0 Then
StepSucess=Go(2,34,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
Endif
StepSucess=Go(2,34,300)
Endif
Endif
If dx<0 Then
StepSucess=Go(6,36,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
StepSucess=Go(6,36,300)
Endif
Endif
Endif
If dx==0 AND dy<>0 Then
If dy>0 Then
StepSucess=Go(4,35,300)
If StepSucess==-1 Then
StepSucess=Go(3,40,300)
If StepSucess==-1 Then
StepSucess=Go(5,37,300)
Endif
StepSucess=Go(4,35,300)
Endif
Endif
If dy<0 Then
StepSucess=Go(0,33,300)
If StepSucess==-1 Then
StepSucess=Go(1,39,300)
If StepSucess==-1 Then
StepSucess=Go(7,38,300)
Endif
StepSucess=Go(0,33,300)
Endif
Endif
Endif
Wend
end sub
sub Go(dir,key,walkwait)
VAR x,y, OldDir
x=UO.GetX()
y=UO.GetY()
OldDir=UO.GetDir()
If UO.GetDir()<>dir Then
UO.Press(key)
wait(walkwait)
If UO.GetDir()<>dir Then
Endif
Endif
UO.Press(key)
wait(walkwait)
if x==UO.GetX() AND y==UO.GetY() Then
Endif
If x==UO.GetX() AND y==UO.GetY() AND OldDir<>UO.GetDir() Then
UO.Press(key)
wait(walkwait)
Endif
If x==UO.GetX() AND y==UO.GetY() Then
Endif
If x==UO.GetX() AND y==UO.GetY() Then
UO.Print("Stuck. Try move else!")
return -1
Else
return 1
Endif
end sub