|
Setting variable with alias
|
Reply to this subject
Start a new subject
 
Refresh page
| Posted by |
Oligo
(26 posts) 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 | top |
|
| Posted by |
Oligo
(26 posts) 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 | top |
|
| Posted by |
Nick Gammon
Australia (18,772 posts) 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 | 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
Start a new subject
 
Refresh page
top
Comments to:
Gammon Software support
Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )