Setting variable with alias

Posted by Oligo on Fri 18 May 2012 02:49 AM — 4 posts, 19,508 views.

#0
I'm long-time Wintin.Net user but starting to port stuff over to MUSHClient.

I read through FAQ and some tutorials, and even a YouTube video. But coming from a tintin syntax and C#, MUSH is taking some time to get used to.

I'm setting up basic drink/food variables for my hungry/thirsty triggers.

I used to have an alias like

#alias {setdrink} {#var {drink} {%%0}}


That would set my drink variable.

I tried something similar in MUSH and using VBScript as the scripting language. But it doesn't seem to work, I've tried a number of variations of the below. Any help would be greatly appreciated.


<aliases>
  <alias
   match="setdrink"
   enabled="y"
   expand_variables="y"
   send_to="10"
   sequence="100"
  >
  <send>/SetVariable "drink", "%1"</send>
  </alias>
</aliases>
#1
Well I think I got a basic version working with VBScript.

<aliases>
  <alias
   match="setdrink*"
   enabled="y"
   expand_variables="y"
   send_to="12"
   sequence="100"
  >
  <send>world.SetVariable "drink", "%1"</send>
  </alias>
</aliases>


But now my question is, how do I tell if an argument is provided or not to the alias?
#2
Well I think I've answered all my own questions myself with the help files and FAQ:
http://mushclient.com/forum/?id=7794#50

Maybe this thread will help other MUSH newbies.
Australia Forum Administrator #3
Quote:

world.SetVariable "drink", "%1"


That looks like VBscript to me. If you are using Lua it would be:


SetVariable ("drink", "%1")


You can also use "send to variable" for something simple like that.