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, 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.
Entire forum
MUSHclient
General
Trigger to set a variable
Trigger to set a variable
|
It is now over 60 days since the last post. This thread is closed.
  Refresh page
Posted by
| Unregistered user
(72 posts) bio
|
Date
| Thu 25 Jan 2001 (UTC) |
Message
| I am trying to make a trigger that sets the value of a variable. When I send /world.setvariable "FleeDir", "north" from the command window it works, but when I try to send it from within a trigger it just sends the text to the mud. I was hoping to avoid having to write a script for this, as I have NO scripting or programming experience (I've played with Pascal a little, but thats about it :P) Can anyone tell me how I would go about making this work? What I'm actually trying to do is:
Trigger: You go (north|east|south|west).
Send: /world.setvariable "Fleedir", %1
or however it's supposed to be done...
So can someone help me? :)
- Epirus | top |
|
Posted by
| Nick Gammon
Australia (23,042 posts) bio
Forum Administrator |
Date
| Reply #1 on Sat 27 Jan 2001 (UTC) |
Message
| MUSHclient does not interpret trigger responses as commands, and thus you cannot use:
... in the way you have attempted. However you can easily do it with a very simple script. Just three lines, see below, put them into a file with the built-in notepad, and then use the "scripts" configuration tab to make that your script file. The language is VBscript.
sub OnDirection (strTriggerName, trig_line, arrWildCards)
world.setvariable "Fleedir", arrWildCards (1)
End Sub
|
- 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.
10,818 views.
It is now over 60 days since the last post. This thread is closed.
  Refresh page
top
Quick links:
MUSHclient.
MUSHclient help.
Forum shortcuts.
Posting templates.
Lua modules.
Lua documentation.
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.