Помогите вставить ходилку
Posted: 2010-04-10 18:38:55
в этот скрипт
Code: Select all
var Runebook='0x4054c16e'
var qman, vname, list, bankbox
list='BlankMap'
bankbox='0x400aaf93'
################################################################
### Основная Функция ####################################
################################################################
sub main()
var n,charges
dim rune[5]
rune[0]='21' ; Papua
rune[1]='46' ; Nujel'm
rune[2]='33' ; jhelom
rune[3]='58' ; Britain
rune[4]='64' ; Bank
uo.set('buydelay',5000)
uo.set('norbcheck','1')
uo.set('norbcalc','1')
uo.setdressspeed(750)
repeat
for n=0 to 4
rb(rune[n])
charges=mid(uo.LastGump('text',12),9,3)
uo.print('Зарядов осталось: '+charges)
if val(charges)<10 then
rb(rune[4])
bank()
uo.closeuo()
endif
if n<=3 then
buymap()
endif
next
wait(1000)
bank()
until uo.dead()
wait(5000)
end sub
################################################################
### Функция разгрузки ####################################
################################################################
sub bank()
var bag
uo.sayu(' bank ')
CheckLag()
wait(1000)
uo.findtype('0x0E76',-1,bankbox)
bag=uo.getserial('finditem')
CheckLag()
uo.useobject(bag)
CheckLag()
wait(1000)
repeat
uo.findtype('0x14EB','0x0000',bag)
if uo.findcount()>=255 then
uo.ignore(bag)
uo.findtype('0x0E76',-1,bankbox)
bag=uo.getserial('finditem')
endif
uo.findtype('0x14EB','0x0000','my')
uo.moveitem('finditem',0,bag)
wait(700)
CheckLag()
until uo.findcount()==0
end sub
################################################################
### Функция рекола ####################################
################################################################
Sub rb(num)
var x,y
uo.exec('terminate autohide')
uo.recall(Runebook,num)
CheckLag()
x=uo.getx()
y=uo.gety()
while x==uo.getx() && y==uo.gety()
wait(200)
if uo.injournal('fizzles') then
CheckLag()
uo.recall(Runebook,num)
endif
wend
end sub
################################################################
### Функция Скупки ####################################
################################################################
sub buymap()
uo.exec("exec autohide")
var s,gold
var timer=uo.timer()
var timercast=uo.timer()
gold=uo.gold
uo.print('My gold '+str(gold))
ws()
findvendor()
repeat
if uo.timer()>=timer+100 then
findvendor()
timer=uo.timer()
endif
if uo.timer()>=timercast+2400 then
return
endif
wait(1000)
until gold>uo.gold
end sub
################################################################
### Функция АвтоХайд ####################################
################################################################
sub autohide()
while not uo.dead()
if not uo.hidden() then
uo.warmode(0)
uo.useskill("Hiding")
InJournal("You have hidden|You can't seem",120)
endif
wait(1000)
wend
wait(5000)
end sub
################################################################
### Функция паузы по проверке журнала или таймера ########
################################################################
Sub InJournal(t,time)
;uo.print('EXEC INJOURNAL(T,TIME)')
var timer=uo.timer()
DelJournal(t)
if time==0 then
;uo.print('TIME==0')
while not uo.InJournal(t) && not uo.dead()
wait(200)
wend
else
;uo.print('TIME<>0')
while not uo.InJournal(t) && uo.timer()<timer+time && not uo.dead()
wait(200)
wend
endif
end sub
################################################################
### Функция удаления из журнала Текста ########################
################################################################
Sub DelJournal(msg) ; msg это параметр, см. выше как его передают
var nom=UO.InJournal(msg) ; ищем сообщение и в переменную его
if nom>0 then
UO.SetJournalLine(Nom - 1," ") ; подменим сообщение
DelJournal(msg) ; вызов функцией самой себя, рекурсия
endif
end sub
################################################################
### Функция отклик сервера ###############################
################################################################
Sub CheckLag()
DelJournal("backpack") ; вытрим ТОЛЬКО нужные нам сообщения в журнале
UO.Click('backpack') ; одиночный клик по вашему backpack
InJournal("backpack",0)
end sub
################################################################
### Функция World save now ####################################
################################################################
Sub ws()
if uo.injournal("World is saving now...") then
InJournal("World data saving",1800)
endif
end sub
################################################################
### Функция Статистики(лога) ####################################
################################################################
sub statistic()
UO.asmSetOption('AutoLogDateNeed','0')
UO.asmSetOption('AutoLogTimeNeed','1')
UO.asmSetOption('AutoLogTimeFormat','hh:nn:ss')
UO.asmSetOption('AutoLogFileName','logfile.txt')
var x,y
var name
x=uo.getx()
y=uo.gety()
var gold=uo.gold
var life=uo.life
repeat
if uo.gold<>gold then
uo.print(UO.asmGetTime('hh:nn:ss')+' сделал покупку')
gold=uo.gold
endif
if uo.life<life then
uo.print(UO.asmGetTime('hh:nn:ss')+' мне стало плохо на '+str(life-uo.life)+'
хп')
if str(life-uo.life)>2 then
uo.msg(' guards ')
endif
life=uo.life
endif
if uo.injournal('attacking you') then
name=uo.GetName(uo.JournalSerial(uo.InJournal('attacking you')-1))
uo.print(UO.asmGetTime('hh:nn:ss')+' меня атаковал '+name)
uo.msg(' guards ')
deljournal('attacking you')
endif
if uo.getx()<>x && uo.gety()<>y then
uo.print(UO.asmGetTime('hh:nn:ss')+' у меня в паке
'+str(uo.count('0x14EB','0x0000'))+' Blank map')
x=uo.getx()
y=uo.gety()
wait(1000)
endif
wait(100)
until uo.dead()
uo.print('Я умер '+UO.asmGetDate('d.m.yy')+' '+UO.asmGetTime('hh:nn:ss'))
UO.asmSetOption('AutoLogFileName','0')
end sub
################################################################
### Функция поиска вендоров ####################################
################################################################
sub findvendor()
uo.ignorereset()
repeat
uo.findman(-1)
qman=uo.findcount()
if uo.getdistance('finditem')<6 && qman>0 && left(uo.getcolor('finditem'),3)<>'0x8' && uo.getserial('finditem')<>'0x00000000' then
uo.getstatus('finditem')
vname=uo.getname('finditem')
WalkN(uo.getx('finditem'),uo.gety('finditem'),2)
ws()
uo.buy(list,vname)
wait(1000)
endif
uo.ignore('finditem')
wait(5)
until qman==0
end sub