variables and aliases

Posted by SugarAndTheSun on Mon 30 Aug 2004 09:47 PM — 6 posts, 21,603 views.

#0
<aliases>
<alias
match="t"
enabled="y"
sequence="100"
>
<send>$world->SetVariable("target", " ");</send>
</alias>
</aliases>

I'm not really sure how to change a variable with an alias so I figured I'd use my new found knowledge and script it up. Would this be the correct way to go about changing it? My intent was to Type in
T RAT
and it change the target to rat. And then all my other aliases would do something like FRENZY @TARGET.
USA #1
You need to change it to send to script (the send to pulldown menu).

And the alias works a little different, youll need to use a wildcard.

Match: t *

$world->SetVariable("target", "%1");

and then yes, you can use @target in other aliases/triggers (with expand variables checked).
#2
Thank you very much! Now might you have any idea on how I could do an #IF statement? Basically ZMUD does

#if(variable=x) {do this if true} {do this if false, but this part is not required}

so how about that in Perl?
USA #3
if ( some_boolean_condition ) {
statement to be executed;
} else {
another statement to be executed;
}

just like the rest of perl. (MC doesnt use any special commands, it sends it to the script engine to do everything, so anything you can do in perl (with some exceptions) you can do with MC)
#4
You're just so useful, :)
Thank you so very much. I'm loving MUSH more and more, I think it definately wins the best client award. Just takes a little learning before you like it.
Australia Forum Administrator #5
To change variables you don't need to use scripting.

Your example could be:

Match: T *
Send: %1
Send to: variable
Variable: target

Here it is ready to be pasted into the alias window:


<aliases>
  <alias
   match="T *"
   enabled="y"
   variable="target"
   send_to="9"
   sequence="100"
  >
  <send>%1</send>
  </alias>
</aliases>