Code:
var Runehome, Runegorod, BlankRune, Runinetu, flagpolymorph=0
var Sunduk='0x404AEDFD'
var BlankRuneBag='0x404B65EB'
var Gpbag='0x402BB9A2'
var type='0x14FB' # тип вещей для продажи
var color='0x09BB' # цвет
var quantity='2000' # кол-во
var sellbag='0x4037DB23' # баг для продажи
sub main()
uo.addobject('Runehome')
while uo.targeting()
wait(500)
wend
Runehome=uo.getserial('Runehome')
uo.addobject('Runegorod')
while uo.targeting()
wait(500)
wend
Runegorod=uo.getserial('Runegorod')
Open(Sunduk)
GrabBlankRune()
uo.findtype(type,color,Sunduk)
while uo.findcount()
RegCheck()
polymorph()
grabitems()
RecallRune(Runegorod)
if uo.injournal('The recall rune fades completely.') then
Mark(BlankRune,0)
Runinetu=1
endif
market()
uo.morph('0x03DB')
walkn(5240,4041,'')
walkn(5247,4041,'')
sell()
walkn(5246,4041,'')
Open('0x40095898')
dropgp()
gorod()
RecallRune(Runehome)
if uo.injournal('The recall rune fades completely.') then
Mark(BlankRune,1)
Runinetu=1
endif
Open(Sunduk)
if Runinetu==1 then
GrabBlankRune()
endif
uo.findtype(type,color,Sunduk)
wend
endsub
sub dropgp()
uo.findtype('0x0EED',-1,'backpack')
while uo.findcount()
uo.moveitem('finditem',0,Gpbag)
checklag()
wait(700)
uo.findtype('0x0EED',-1,'backpack')
wend
uo.findtype('0x0EED',-1,Gpbag)
while uo.count('0x0EED')<200
uo.moveitem('finditem','200','backpack')
checklag()
wait(700)
uo.findtype('0x0EED',-1,'backpack')
wend
endsub
sub sell()
repeat
uo.waittargetobject(sellbag)
uo.usefromground('0x1173')
checklag()
wait(700)
uo.lclick(190,136)
wait(700)
until uo.injournal('You put the gold coin')
endsub
sub gorod()
var oldX,oldY
oldX = Uo.GetX()
oldY = Uo.GetY()
uo.recall('~0x0EDE','7') # '7' можно поменять на другой город
repeat
wait(500)
until oldX<>UO.GetX() AND oldY<>UO.GetY()
endsub
sub market()
var oldX,oldY
oldX = Uo.GetX()
oldY = Uo.GetY()
uo.recall('~0x0EDE','27')
repeat
wait(500)
until oldX<>UO.GetX() AND oldY<>UO.GetY()
endsub
sub Mark(RuneID,Place)
repeat
if uo.mana<33 then
meditation(33)
endif
checklag()
uo.Cast('Mark',RuneID)
WaitForMana()
until not uo.injournal('The spell fizzles')
if Place==0 then
Runegorod=uo.getserial(RuneID)
else
Runehome=uo.getserial(RuneID)
endif
endsub
sub RecallRune(nowrune)
uo.Print('улетаем по руне')
var oldX,oldY
oldX = uo.GetX()
oldY = uo.GetY()
repeat
if uo.mana<20 then
meditation(20)
endif
uo.Cast('Recall',nowrune)
WaitForMana()
until oldX<>uo.GetX() AND oldY<>uo.GetY()
uo.Useskill('Meditation')
end sub
sub WaitForMana()
VAR w,m=uo.mana
for w=0 to 150
if uo.mana<m then
wait(500)
return
endif
wait(500)
next
endsub
sub grabitems()
uo.findtype(type,color,Sunduk)
if uo.findcount() then
uo.moveitem('finditem',quantity,sellbag)
checklag()
wait(700)
endif
endsub
sub RegCheck()
VAR i,q
VAR kol=50
Dim Regs[4]
Regs[0]='0x0F7A' ; Black Pearl
Regs[1]='0x0F7B' ; Bood Moss
Regs[2]='0x0F86' ; Mandrake Root
Regs[3]='0x0F8D' ; SS
for i=0 to 3
if uo.count(Regs[i])<>kol then
q=kol-uo.count(Regs[i])
if q<>0 then
if q>0 then
uo.findtype(Regs[i],-1,Sunduk)
if uo.findcount() then
uo.moveitem('finditem',STR(q),'backpack')
wait(1000)
checklag()
uo.print('Берем реги для рекола...')
else
uo.msg('No regs')
return
endif
else
q=q*-1
uo.findtype(Regs[i],-1,'my')
if uo.findcount() then
uo.moveitem('finditem',STR(q),Sunduk)
wait(1000)
checklag()
uo.print('Регов больше чем надо. Кидаем лишнее в сундук')
endif
endif
endif
endif
next
if uo.count('0x0F0E','0x09DF')<1 then
uo.findtype('0x0F0E','0x09DF',Sunduk)
if uo.findcount() then
uo.moveitem('finditem','2','backpack')
checklag()
wait(1000)
endif
endif
endsub
sub polymorph()
if uo.str<201 or flagpolymorph>=6 then
repeat
meditation(uo.int)
checklag()
uo.waitmenu('What do you want to polymorph','Daemon')
uo.cast('Polymorph')
WaitForMana()
until not uo.injournal('spell fizzles')
flagpolymorph=0
endif
flagpolymorph=flagpolymorph+1
endsub
sub GrabBlankRune()
Open(BlankRunebag)
uo.findtype('0x1F14',-1,BlankRunebag)
if uo.findcount() then
Blankrune=uo.getserial('finditem')
uo.moveitem('finditem',0,'backpack')
checklag()
wait(700)
uo.print('Взяли бланк руну')
Runinetu=0
else
uo.print('Бланк рун больше нету! Скрипт остановлен.')
uo.exec('terminate all')
endif
endsub
sub Open(what)
uo.useobject(what)
checklag()
wait(700)
endsub
sub meditation(mn)
while uo.mana < mn
if uo.count('0x0F0E','0x09DF') then
uo.usetype('0x0F0E','0x09DF')
endif
uo.warmode(0)
uo.Useskill('Meditation')
waitformed(mn)
wait(1000)
wend
endsub
sub waitformed(mn)
var n
for n=0 to 100
if uo.injournal('You lose|You are at peace|thoughts of battle') or uo.mana>=mn then
return
endif
wait(500)
next
endsub
sub checklag()
repeat
uo.DeleteJournal()
uo.Click('backpack')
until backpack()==1
endsub
sub backpack()
var n
for n=0 to 400
if uo.injournal('a backpack') then
return 1
endif
wait(200)
next
endsub
sub WalkN(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"
uo.say('')
While Exit<>1
If Target<>"" Then
dx=UO.GetX(Target)-UO.GetX()
dy=UO.GetY(Target)-UO.GetY()
If UO.GetDistance(Target)<3 OR LastTimer+200<UO.Timer() Then
wait(1000)
return
Endif
Else
dx=x-UO.GetX()
dy=y-UO.GetY()
If dx==0 AND dy==0 OR LastTimer+200<UO.Timer() Then
return
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=250
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=250
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