 |
HariKari Wanderer
Joined: 16 Feb 2001 Posts: 57
|
Posted: Sun Feb 10, 2002 9:48 pm
Passing values to functions |
Is there any way to pass a value to a function (aka alias) ?
The only way I can think of is just using 'global variables' like any variable.
And thanks for the help with my other questions Kjata. |
|
|
 |
Darker GURU
Joined: 24 Sep 2000 Posts: 1237 Location: USA
|
Posted: Sun Feb 10, 2002 10:12 pm |
Aliases can take parameters and reference them using the %1..%n variables usually available to triggers. For instance:
#alias sayhi {say Hey %1, how ya doin?;smile %1}
zMUD 6 Online Help: All the power you'll ever need. |
|
|
 |
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Mon Feb 11, 2002 12:02 am |
%1...%99 will return the 1-99th argument to the alias. To get all of them from some starting point, use %-1...%-99
#alias say {emote says softly '%-1'}
- Charbal |
|
|
 |
HariKari Wanderer
Joined: 16 Feb 2001 Posts: 57
|
Posted: Mon Feb 11, 2002 12:08 am |
Oh wow how stupid am I?
heheheheh :P
I've used the %1 and %-1 etc stuff in my script already.. strange thing I didn't think of that :P
Thanks :) |
|
|
 |
HariKari Wanderer
Joined: 16 Feb 2001 Posts: 57
|
Posted: Mon Feb 11, 2002 12:12 am |
Oh and if anyone wanted to know.. I'm making a "Combo Trader" script for Medievia. It'll calculate the combos for items to trade from one place to a destination.
|
|
|
 |
|
|