Yoko

All sides of Injection
It is currently 2025-11-15 08:26:52

All times are UTC+02:00




Post new topic  Reply to topic  [ 9 posts ] 
Author Message
PostPosted: 2007-04-14 18:49:40 
Offline

Joined: 2006-03-08 20:53:28
Posts: 115
помогите ошибку выдает

Code:
#RUNEBOOK GATE. © pro aka to4a. 
sub BookGate(idbook,n)
 if UO.Targeting() then
  UO.CancelTarget()
 endif
 var cast='no'
 var rune='0x1F14' #Rune Type
 DIM RUNEN[10]
 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.Set('quiet','1')
 UO.OnGump('anygump',runen[n])
 UO.UseObject(idbook)
 UO.Set('quiet','0')
 DynWait('You put','This is a free','@','@','@')
 if UO.InJournal('This is a free') then
  UO.Print('В этом слоте нет руны!')
  goto end
 endif
 UO.Print('Rune number '+str(n)+' removed...')
 UO.FindType(rune)
 var BookRune=UO.GetSerial('finditem')
 UO.Print('Removed rune ID: '+BookRune)
 UO.WaitTargetObject(BookRune)
 UO.Print('Casting Gate Travel')
 repeat
  cast=CastSpell('Gate Travel',0)
  wait(50)
 until cast=='success'
 UO.WaitTargetObject(BookRune)
 UO.Set('quiet','1')
 UO.OnGump('anygump','0x000B')
 UO.UseObject(idbook)
 UO.Set('quiet','0')
 UO.Print('Gate Travel Casted successfully, rune added back to runebook')
 end:
endsub


Top
   
 Post subject:
PostPosted: 2007-04-14 22:36:25 
Offline

Joined: 2006-03-10 00:19:11
Posts: 265
Location: http://drw.ru/
какую ошибку, где?
если ты играешь не на дрв то рунбуки там другие, если на дрв то с тех пор как я писал этот скрипт рунбуки уже немного изменили, следовательно немного и скрипт надо исправить...


Top
   
 Post subject:
PostPosted: 2007-04-16 09:55:21 
Offline

Joined: 2006-03-08 20:53:28
Posts: 115
Блин точняк забыл записать ошибку) извените:) invalid number of oruments - BookGate
если дело в том что изменились рунбуки то скажите плз где менять:)


Top
   
 Post subject:
PostPosted: 2007-04-16 10:32:44 
Offline

Joined: 2006-03-10 00:19:11
Posts: 265
Location: http://drw.ru/
тю блин так этот скрипт не предназначен для запуска его напрямую, перечитай ещё раз тот топик из которого ты взял этот скрипт(если взял конечно из топика, иначе - поиск и найди) там для него лежит интерфейс, который правда асм требует...


Top
   
 Post subject:
PostPosted: 2007-04-16 10:41:28 
Offline

Joined: 2006-03-10 00:19:11
Posts: 265
Location: http://drw.ru/
должны быть включены:
,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


Last edited by to4a on 2007-04-18 00:14:58, edited 6 times in total.

Top
   
 Post subject:
PostPosted: 2007-04-17 09:28:54 
Offline

Joined: 2006-03-08 20:53:28
Posts: 115
Пришет функтион нот фоунд NORMALISE что делать?:)


Top
   
 Post subject:
PostPosted: 2007-04-17 15:34:13 
Offline

Joined: 2006-03-10 00:19:11
Posts: 265
Location: http://drw.ru/
вырезано цензурой


Last edited by to4a on 2007-04-17 23:49:25, edited 1 time in total.

Top
   
 Post subject:
PostPosted: 2007-04-17 22:00:14 
Offline

Joined: 2006-03-08 20:53:28
Posts: 115
Блин опять ошибка функтион нот ваунд uo.asminputlist Ещё забыл?:)


Top
   
 Post subject:
PostPosted: 2007-04-17 23:47:09 
Offline

Joined: 2006-03-10 00:19:11
Posts: 265
Location: http://drw.ru/
нет не забыл, я ж сказал нужен асм, если не знаешь что это - юзай поиск, и кстати я обновил опять скрипты, и исправил их в предыдущем посте так что скопируй их ещё раз, ф-цию нормалайз тоже подшил в предыдущий пост...

вместо 1 функции интерфейса с асм, можно кончено забиндить дофига(по 9 фунций на рунбуку) функций вида:
Code:
sub GateB1R1()
BookGate(RUNEBOOK_ID, N)
endsub

где RUNBOOK_ID - айди книги, N - номер руны сверху.

но гораздо удобнее юзать интерфейс


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 9 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited