Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ General ➜ Setting variable with alias

Setting variable with alias

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Oligo   (26 posts)  Bio
Date Fri 18 May 2012 02:49 AM (UTC)
Message
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>

mud.arctic.org : 2700
Top

Posted by Oligo   (26 posts)  Bio
Date Reply #1 on Fri 18 May 2012 03:41 AM (UTC)
Message
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?

mud.arctic.org : 2700
Top

Posted by Oligo   (26 posts)  Bio
Date Reply #2 on Fri 18 May 2012 04:56 AM (UTC)
Message
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.

mud.arctic.org : 2700
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #3 on Fri 18 May 2012 07:39 AM (UTC)

Amended on Fri 18 May 2012 07:40 AM (UTC) by Nick Gammon

Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,655 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.