вопрос
Moderators: Murderator+, Murderator
Code: Select all
var MaxWeight=400 ## - Вес при котором скрипт выключиться.
sub Options()########################################## Конфиг
UO.Say("Добрый день. Вас привествует скрипт настройщик!")
wait(3000)
UO.Say("Следуйте инструкциям!")
wait(3000)
UO.Say("Вы должны стоять лицом к сундуку для сброса покупок!")
wait(4000)
UO.Say("Укажите Рунбук ")
UO.AddObject('RuneB1')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("Укажите сундук прицелом")
UO.AddObject('Sunduk')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("Отлично")
UO.UseObject('Sunduk')
wait(3000)
UO.Say("Укажите сумку для рар рыбы")
UO.AddObject('StoreFish')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("Укажите сумку для прайз рыбы")
UO.AddObject('StorePRFish')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
UO.Say("Укажите сумку для Карт")
UO.AddObject('StoreMAP')
While UO.Targeting()==2
wait(500)
Wend
UO.SaveConfig()
wait(3000)
UO.Say("Настройка закончена. Для изменения параметров запустите скрипт повторно.")
end sub
sub Fishing()
var mX, mY, mZ, i, j
var f
var a=0
####################
### Меню/Options ###
####################
#########################################################################
###
var TryToHide=1 ## 1 - Включить уход(перед ловлей) в хайд, 0 - выключить.
###
var TakeFish=0 ## 1 - Включить сбор обычной рыбы, 0 - выключить.
###
var TakeMaps=1 ## 1 - Включить сбор карт, 0 - выключить.
###
var TakeRareFish=1 ## 1 - Включить сбор рарной рыбы, 0 - выключить.
###
var TakePrizeFish=1 ## 1 - Включить сбор приз рыбы, 0 - выключить.
###
###
#########################################################################
###################
### Массив рыбы ###
###################
dim Fish[6]
Fish[0]=0x09CC
Fish[1]=0x09CD
Fish[2]=0x09CE
Fish[3]=0x09CF
Fish[4]=0x14EB
Fish[5]=0x0DD6
Fish[6]=0x0DD6
Beginning:
uo.Set('finddistance','6')
mX = uo.getX("self")
mY = uo.getY("self")
mZ = uo.getZ("self")
uo.DeleteJournal()
for i = mX-6 to mX+6
for j = mY-6 to mY+6
if uo.Dead() then
return
end if
if TryToHide==1 then
ToHide()
end if
uo.Print("Сейчас ловим: "+str(mx-i)+" "+str(my-j))
while not uo.InJournal("You pull") and not uo.InJournal("in water") and not uo.InJournal("no fish") and not uo.InJournal("far away")
uo.DeleteJournal()
uo.Waittargettile("1341", str(i), str(j), str(mZ))
uo.Usetype('0x0DC0')
while not uo.InJournal("You pull") and not uo.InJournal("location") and not uo.InJournal("no fish") and not uo.InJournal("but fail") and not uo.InJournal("far away") and not uo.InJournal("in water")
wait (100)
if uo.InJournal("You pull") then
if a>0 then
uo.print(STR(a))
end if
if TakeFish==1 then
uo.Print('Собираем рыбу.')
for f=0 to 3
uo.FindType(Fish[f],"-1","ground")
if uo.Count(Fish[2])> 0 then
a= a+1
end if
uo.MoveItem("finditem","1","backpack")
wait(200)
next
end if
if TakeMaps==1 then
uo.Print('Собираем карты.')
for f=4 to 4
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","backpack")
wait(200)
next
end if
if TakeRareFish==1 then
uo.Print('Собираем рар рыбу.')
for f=5 to 5
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","backpack")
wait(200)
next
end if
if TakePrizeFish==1 then
uo.Print('Собираем приз рыбу.')
for f=6 to 6
uo.FindType(Fish[f],"-1","ground")
uo.MoveItem("finditem","-1","backpack")
wait(200)
next
end if
end if
wend
wend
uo.DeleteJournal()
next
next
end sub
Sub RunebookRecall(n)
var OldX, OldY, time
OldX=uo.GetX()
OldY=uo.GetY()
repeat
uo.Exec('warmode 0')
uo.UseObject('RuneB1')
CheckLag()
uo.LClick(135, n*15+55)
CheckLag()
time=uo.Timer()
repeat
wait(500)
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs') or uo.InJournal('fizzles') or time+200<uo.Timer()
until OldX<>uo.GetX() or OldY<>uo.GetY() or uo.Dead() or uo.InJournal('needs')
end sub
sub ToHide()
while not uo.Hidden()
uo.Exec('warmode 0')
uo.Print('Пытаемся уйти в хайд...')
uo.DeleteJournal()
uo.UseSkill('Stealth')
wait(4100)
wend
wait(100)
end sub
sub Drop()
if uo.Waiting() then
uo.CancelTarget()
end if
var Exit
var f
;var a=0
dim Fish[6]
Fish[0]=0x09CC
Fish[1]=0x09CD
Fish[2]=0x09CE
Fish[3]=0x09CF
Fish[4]=0x14EB
Fish[5]=0x0DD6
Fish[6]=0x0DD6
UO.UseObject('Sunduk')
wait(1000)
UO.UseObject('StoreFish')
wait(1000)
UO.UseObject('StoreMAP')
wait(1000)
UO.UseObject('StorePRFish')
wait(500)
exit=0
repeat
for f=0 to 3
uo.FindType(Fish[f],"-1","backpack")
uo.SetReceivingContainer('StoreFish')
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
exit=0
repeat
for f=4 to 4
uo.FindType(Fish[f],"-1","backpack")
uo.SetReceivingContainer('StoreMAP')
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
exit=0
repeat
for f=5 to 5
uo.FindType(Fish[f],"0x01BB","backpack")
uo.SetReceivingContainer('StorePRFish')
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"0x01BB","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
repeat
for f=6 to 6
uo.FindType(Fish[f],"backpack")
uo.SetReceivingContainer('StoreFish') ;rar
if uo.GetQuantity('finditem')>0 then
repeat
uo.FindType(Fish[f],"-1","backpack")
uo.Grab('0','finditem')
wait(1000)
until uo.FindCount()==0
else
exit=1
next
uo.UnSetReceivingContainer()
end if
until Exit==1
end sub
sub nazad()
gotoxy(2640,1181,'')
gotoxy(2640,1258,'')
gotoxy(2607,1258,'')
gotoxy(2607,1255,'')
gotoxy(2575,1255,'')
gotoxy(2575,1257,'')
end sub
## no fish here
sub adad()
UO.Exec('terminate Reconnector')
wait(1000)
UO.Exec('exec Reconnector')
wait(1000)
RunebookRecall(2)
begin:
gotoxy(2538,1265,'')
Fishing()
gotoxy(2549,1265,'')
Fishing()
gotoxy(2557,1265,'')
Fishing()
gotoxy(2557,1257,'')
gotoxy(2575,1257,'')
Fishing()
gotoxy(2586,1257,'')
Fishing()
gotoxy(2597,1257,'')
Fishing()
gotoxy(2604,1257,'')
gotoxy(2604,1260,'')
Fishing()
gotoxy(2613,1260,'')
gotoxy(2613,1263,'')
Fishing()
gotoxy(2624,1263,'')
Fishing()
gotoxy(2633,1263,'')
Fishing()
gotoxy(2633,1261,'')
gotoxy(2644,1257,'')
gotoxy(2653,1257,'')
Fishing()
gotoxy(2653,1244,'')
Fishing()
gotoxy(2649,1244,'')
gotoxy(2649,1237,'')
Fishing()
gotoxy(2644,1237,'')
gotoxy(2644,1226,'')
Fishing()
gotoxy(2643,1226,'')
gotoxy(2643,1218,'')
Fishing()
gotoxy(2642,1218,'')
gotoxy(2642,1210,'')
Fishing()
gotoxy(2642,1200,'')
Fishing()
gotoxy(2642,1190,'')
Fishing()
gotoxy(2642,1181,'')
gotoxy(2643,1181,'')
Fishing()
gotoxy(2643,1167,'')
gotoxy(2647,1167,'')
Fishing()
gotoxy(2647,1156,'')
gotoxy(2654,1156,'')
Fishing()
gotoxy(2654,1145,'')
gotoxy(2670,1145,'')
Fishing()
if uo.Weight>MaxWeight then
RunebookRecall(1)
Drop()
RunebookRecall(2)
end if
nazad()
goto begin
end sub
sub tohide()
while NOT UO.Hidden()
UO.DeleteJournal()
UO.UseSkill('Stealth')
repeat
until UO.InJournal('You have hidden') OR UO.InJournal('seem to hide')
wend
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(50)
until UO.InJournal('backpack')
end sub
sub getcoord()
var a,b,c
a = UO.GetX("self")
b = UO.GetY("self")
c = UO.GetZ("self")
UO.Print("Position "+STR(a)+", "+STR(b)+", "+STR(c))
end sub
sub Terminate()
uo.DeleteJournal()
uo.Print('OFF!')
uo.Exec('terminate all')
wait(100)
end sub
sub gotoxy(x,y,Target) ########################################## Ходилка
VAR LastTimer
LastTimer=UO.Timer()
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
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
; UO.Print("Target locked!")
If UO.GetDistance(Target)<2 OR LastTimer+3000<UO.Timer() Then
wait(4000)
Exit=1
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 OR LastTimer+3000<UO.Timer() Then
Exit=1
Endif
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
end sub
sub StepEdit(x,y,dir,key)
VAR walkwait=120
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
;zatik
ErrLevel=1
Endif
Endif
Return ErrLevel
end sub
sub StepArrow(x,y,dir,ldir,rdir,key)
VAR walkwait=100
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
; zatik
ErrLevel=1
Endif
Endif
Endif
Return ErrLevel
end sub
sub CheckLag()
UO.DeleteJournal()
UO.Click('backpack')
repeat
wait(500)
until UO.InJournal('backpack')
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(20000) # WorldSave Protection
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.Say('')
Wait(3000)
UO.LDblClick(357,164)
UO.LClick(616,459)
Wait(3000)
WEnd
Wait(3000)
if (RFlag == 0) and (ReconnectTime <> '0') Then
UO.Exec('terminate adad')
UO.Exec('exec adad')
UO.TextOpen()
UO.TextPrint('Disconnected & Reconnected @ '+ReconnectTime)
RFlag = 1
ReconnectTime = '0'
endif
Until false
end sub
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
sub rasklad()
var map='0x14EB'
while uo.Targeting()
wait(100)
wend
uo.FindType(map,'-1','backpack')
while uo.FindCount()
uo.FindType(map,'-1','backpack')
uo.moveitem('finditem','1','meshok')
wait(500)
wend
end sub