Invalid number of arguments

General Injection issues

Moderators: Murderator+, Murderator

Post Reply
iRuLez
Posts: 104
Joined: 2006-05-04 18:40:42

Invalid number of arguments

Post by iRuLez »

how can pass the parameters to this function from the tab Hotkeys of injection?

Code: Select all

sub cast(spellname,target)
   uo.warmode(0)
   if (haveBandage() && uo.life < uo.str) then
      uo.deletejournal()
      uo.bandageself()
      while (not uo.injournal("Where"))
         wait(10)
      wend
   end if
   uo.cast(spellname,target)
end sub

example:
exec cast("Magic Reflection","self")
inj say me error: "function not found - cast("Magic Reflection","self")

or i must need of another function without parameters with call that method?
example:

Code: Select all

sub bolt()
   cast("Energy Bolt","laststatus")
end sub


i will wont dont create another script with call the main function, well is possible done in hotkeys command? :roll:
Destruction
Junior Expert
Posts: 3221
Joined: 2004-06-24 22:08:56

Post by Destruction »

>>i must need of another function without parameters with call that method

Yes, u right.
YokoInjection CodeSweeper
Function not found?
Possession of mathematics at the level of art - a gift that is only available for election.
Sorry for my clumsy English.
Telegram: @tatikom
Yoko
Site Admin
Posts: 1964
Joined: 2004-04-03 16:49:38
Contact:

Post by Yoko »

currently it isn't possible
iRuLez
Posts: 104
Joined: 2006-05-04 18:40:42

Post by iRuLez »

ok tnx 8)
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Re:

Post by Scripts Writer »

Yoko wrote:currently it isn't possible

печаль.
Mirage
Posts: 2802
Joined: 2009-05-28 09:58:28
Location: Иваново
Contact:

Re: Invalid number of arguments

Post by Mirage »

Вместо 1 строки 3. Подумаешь... Было бы удобнее но отсутствие не смертельно (как игноры).


ps некрофил :P
Scripts Writer
Posts: 2259
Joined: 2005-04-19 18:00:29
Location: Московская область
Contact:

Re: Invalid number of arguments

Post by Scripts Writer »

Mirage wrote:Вместо 1 строки 3. Подумаешь... Было бы удобнее но отсутствие не смертельно (как игноры).
ps некрофил :P


Да дело не в том что 1 строка или 3, а в том, что файл для пвп мог бы представлять из себя набор шаблонных функций, которые уже наглядно бы вызывались из хоткеев (каст, выпивание банки, одевание оружий, крафт поушенов, крафт свитков). Имеем 5 функций, с вызовами вида:

Code: Select all

,exec Cast Flame laststatus 0x0123 0x0483
,exec Cast Reflection self 0x0999 0x0888
,exec Cast Mass dispel self 0 0

Где первым параметром имя каста, затем цель, тип скролла и цвет. Вместо этого:

Code: Select all

sub Flame()
  Cast('Flame', 'laststatus', '0x0123', '0x0493')
end sub

sub Reflection()
  Cast('Reflection ', 'self', '0x0123', '0x0493')
end sub

sub MD()
  Cast('Mass dispel', 'self', '0', '0')
end sub

код разрастается до немалых размеров, когда кол-во кастов переваливает за десяток (а ведь там еще крафты и использование банок), и всё из за "подумаешь, 3 строки". Не говоря уже о том, что на десяток-другой написанных таких скриптов, придется ещё такой же десяток действий в самих хоткееях- 'exec Flame' и т.д..
Так что, тут отнюдь не "подумаешь".
Post Reply