|
Interitus Novice
Joined: 16 Mar 2003 Posts: 45 Location: Russia
|
Posted: Tue Mar 25, 2003 5:46 pm
%random returns the same number every time |
#SHOW %random(1,10) command shows different numbers every time I enter it, but if I define alias #ALIAS RAND1 {#SHOW %random(1,10)} zMUD always returns 7 insteat of random number.
How to solve this problem? |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Tue Mar 25, 2003 8:38 pm |
I wasn't able to replicate this problem using the latest beta (6.55a). Looking through the zMUD version history doesn't show any recent changes (ie, not since 5.47) with %random so... what version of zMUD are you using?
- Charbal |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Mar 25, 2003 8:40 pm |
Check the alias after it is created. Does it still contain the %random function, or was it by any chance expanded at the moment of creating the alias and it is just a number now?
Kjata |
|
|
|
Interitus Novice
Joined: 16 Mar 2003 Posts: 45 Location: Russia
|
Posted: Wed Mar 26, 2003 8:23 am |
quote:
Check the alias after it is created. Does it still contain the %random function, or was it by any chance expanded at the moment of creating the alias and it is just a number now?
It expanded to number. How do I prevent function from expanding? |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Wed Mar 26, 2003 8:27 am |
It sounds like you have the Expand Vars option on in your preferences. This option is provided for the people that want it but in practice can cause more issues (like this) than it solves. So it is off by default.
To turn it back off, do View, Preferences, General, Script Parser and uncheck Expand Vars.
That should fix the problem.
- Charbal |
|
|
|
Interitus Novice
Joined: 16 Mar 2003 Posts: 45 Location: Russia
|
Posted: Wed Mar 26, 2003 8:32 am |
Kjata and Charbal, thanks alot, I have solved my problem.
|
|
|
|
|
|