должны быть включены: ,set norbcalc 1 ,set norbcheck 1
по крайней мере на дрв, хотя на других вообще хрен будет работать
функции для запуска:
интерфейса гейта:
Code: sub GateUI() UI(1) endsub
интейрфеса рекола:
Code: sub RecUI() UI(0) endsub
сам движок гейта:
Code: Sub BookGate(idbook,n) if UO.Targeting() then UO.CancelTarget() endif var rune='0x1F14' #Rune Type DIM RUNEN[9] runen[1]='0x000C' runen[2]='0x000D' runen[3]='0x000E' runen[4]='0x000F' runen[5]='0x0010' runen[6]='0x0011' runen[7]='0x0012' runen[8]='0x0013' runen[9]='0x0014' UO.FindType(rune) for var i=0 to UO.FindCount() UO.FindType(rune) UO.Ignore('finditem') next UO.Print('All Runes in backpack added to ignore list...') UO.Recall(idbook,runen[n]) DynWait('You put','This is a free','@','@','@') if UO.InJournal('This is a free') then Print('В этом слоте нет руны!','red') return endif UO.Print('Rune number '+str(n)+' removed...') UO.FindType(rune) var BookRune=UO.GetSerial('finditem') UO.Print('Removed rune ID: '+BookRune) UO.Print('Casting Gate Travel') CastSpell('Gate Travel',BookRune) UO.WaitTargetObject(BookRune) UO.Recall(idbook,'0x000B') Print('Gate Travel Casted successfully, rune added back to runebook','green') endsub
интерфейс, требующий асм:
Code: Sub UI(gate) var choise if gate<>1 and gate<>0 then Print('Ошибка! Агрумент gate должен быть либо 1, либо 0','red') Print(' 1. - для того чтобы открыть гейт','red') Print(' 0. - для того чтобы реколится','red') return endif DIM buks[10],B[10],R[9] var i,j=0,runebook booksel: for i=1 to 10 buks[i]='0x00000000' next UO.IgnoreReset() UO.FindType('0x0EFA','0x0510','backpack') for i=1 to UO.FindCount()+1 UO.FindType('0x0EFA','0x0510','backpack') buks[i]=UO.GetSerial('finditem') UO.Click('finditem') UO.Ignore('finditem') j=i next if j==0 then Print('РУНБУКИ НЕ НАЙДЕНЫ','red') return endif if gate==1 then Print("GATE TRAVEL","green") else Print("RECALL","green") endif Print('Выберите рубуку и нажмите [ENTER] или [ESC] для отмены:','cyan') for i=1 to 10 B[i]=normalise(UO.GetName(buks[i])) next choise=UO.asmInputList("'Выберите буку:'"," "+B[1]+";"+B[2]+" "+B[3]+";"+B[4]+" "+B[5]+";"+B[6]+" "+B[7]+";"+B[8]+" "+B[9]+";"+B[10]+" ") if choise==0 then Print('CANCELLED','red') return endif runebook=buks[choise] UO.Recall(runebook,"0x0000") CheckLag() choise='nothing' for i=0 to 8 R[i]=normalise(UO.LastGump('text',i)) next Print('Выберите руну и нажмите [ENTER]','cyan') choise=UO.asmInputList("'Выберите руну:'"," "+R[0]+";"+R[1]+" "+R[2]+";"+R[3]+" "+R[4]+";"+R[5]+" "+R[6]+";"+R[7]+" "+R[8]+";'Назад'") if choise==9 then goto booksel endif if choise==0 then Print('CANCELLED','red') return endif if gate==1 then BookGate(runebook,choise) endif if gate==0 then Recall(runebook,choise) endif UO.IgnoreReset() endsub
движок рекола:
Code: sub Recall(idrb,nrune) Dim gumpreturn[9] gumpreturn[1]="0x0015" gumpreturn[2]="0x0021" gumpreturn[3]="0x002E" gumpreturn[4]="0x003A" gumpreturn[5]="0x0040" gumpreturn[6]="0x0049" gumpreturn[7]="0x0058" gumpreturn[8]="0x005E" gumpreturn[9]="0x0401" UO.Recall(idrb,gumpreturn[nrune]) endsub
дополнительные используемые функции:
Code: Sub print(text,color) if color=='red' then color='0x26' endif if color=='yellow' then color='0x35' endif if color=='green' then color='0x44' endif if color=='blue' then color='0x4' endif if color=='cyan' then color='0x5A' endif UO.concolor(color) UO.Print(text) UO.concolor('0x0440') endsub
Sub WaitManaChange(now) var timer=0 while UO.Mana>=now or timer<=100 timer=timer+1 wait(50) wend UO.SetGlobal('Casting','0') endsub
sub DynWait(event1,event2,event3,event4,event5) var Time=0; DeleteJournal(event1) DeleteJournal(event2) DeleteJournal(event3) DeleteJournal(event4) DeleteJournal(event5) Time=0 repeat wait(100) Time=Time+1 if UO.InJournal('World is saving') then repeat wait(500) until UO.InJournal('World data saved in') endif until UO.InJournal(event1) or UO.InJournal(event2) or UO.InJournal(event3) or UO.InJournal(event4) or UO.InJournal(event5) or Time==50 endsub
Sub DeleteJournal( string1 ) VAR nom = UO.InJournal( string1 ) If nom > 0 Then UO.SetJournalLine( Nom - 1, 'string replaced' ) DeleteJournal( string1 ) Endif endsub
Sub CastSpell(spell,target) var timer=0,f=0 cast: UO.DeleteJournal() UO.Cast(spell,target) repeat timer=timer+1 wait(10) until UO.InJournal('In|Mani|Kal|Ort|Xen|Wis|An|Ex|Por|Lor|Des|Rel|You lack') or timer==300 if UO.InJournal('You lack') then if UO.InJournal('sufficient mana') then if UO.Count('0x0F0E','0x09DF') then Mana() goto cast else Print('КАСТ НЕВОЗМОЖЕН - НЕТУ МАНЫ','red') return 'nomana' endif else Print('КАСТ НЕВОЗМОЖЕН - НЕТУ РЕГОВ','red') return 'noregs' endif endif if UO.InJournal('line|see the target') then Print('ЦЕЛЬ НЕ ВИДАТЬ','red') return 'notarg' endif WaitManaChange(UO.Mana) UO.Print('КАСТ ОКОНЧЕН') return 'success' endsub
Sub normalise(string) DIM Chars[64] var NewString='' for var nChars=0 to LEN(string) if Left(string,1)<>' ' then NewString=NewString+Left(string,1) else NewString=NewString+'_' endif string=Right(string,LEN(string)-1) next return NewString endsub
|