[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Setting variable with alias

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Setting variable with alias

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Oligo   (26 posts)  [Biography] bio
Date Fri 18 May 2012 02:49 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Oligo   (26 posts)  [Biography] bio
Date Reply #1 on Fri 18 May 2012 03:41 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Oligo   (26 posts)  [Biography] bio
Date Reply #2 on Fri 18 May 2012 04:56 AM (UTC)  quote  ]
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
[Go to top] top

Posted by Nick Gammon   Australia  (18,772 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Fri 18 May 2012 07:39 AM (UTC)  quote  ]

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
[Go to top] 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.


776 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]