Yoko

All sides of Injection
It is currently 2024-04-19 15:27:57

All times are UTC+02:00




Post new topic  Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Opitional Parameters
PostPosted: 2012-09-27 21:29:03 
Offline

Joined: 2012-09-10 20:18:54
Posts: 14
Is there a way to create a function that may receive 0 OR 1 OR 2 parameters.

For example:

0 parameters:
Magery() ; Would cast a default spell without waiting the result of the cast

1 parameter:
Magery('Magic Arrow') ; Would cast 'Magic Arrow' into a target without waiting the result of the cast

2 parameters:
Magery('Magic Arrow',5000) ; Would cast 'Magic Arrow' into a target and wait up to 5sec for the result


I've tryed using Sub Magery(param1) and Sub Magery(param1,param2) in my autoload and Injection only checked one of them for parameter number.

The objective is to be able to use ,exec Magery ingame and Magery(...) with as much parameters as I need



One more thing... Is there a way to use ,exec with functions with parameters?


Top
   
 Post subject: Re: Opitional Parameters
PostPosted: 2012-09-28 00:51:54 
Offline

Joined: 2011-06-11 19:54:23
Posts: 820
With this script.dll. viewtopic.php?f=12&t=16689

Function overloading:
Code:
Sub Magery(p)
...
end sub

Sub Magery(p1,p2)
...
end sub

Sub Magery(p1,p2,p3)
...
end sub
etc...


,exec with functions with parameters - see example in latest post.


Top
   
 Post subject: Re: Opitional Parameters
PostPosted: 2012-09-28 15:20:35 
Offline

Joined: 2012-09-10 20:18:54
Posts: 14
Thx for the info!

I might not use this, since I script for other players, and they usually have issues for not following instructions like "download this script.dll and paste it in your Injection folder". Yeah.. they usually don't even read XD

But it's nice to know that there are some developments going around!


Top
   
 Post subject: Re: Opitional Parameters
PostPosted: 2012-09-28 23:31:44 
Offline
Junior Expert
User avatar

Joined: 2004-06-24 22:08:56
Posts: 3220
U can set global variables and then call required function.

To simplfy developing process, u can write like Juicy advises and write some converter to compatible version (its not so hard..).

_________________
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.
Skype: d119060


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

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 25 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