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


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, 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.
[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  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] Refresh page


Posted by Unregistered user   (72 posts)  [Biography] 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
[Go to top] top

Posted by Nick Gammon   Australia  (23,042 posts)  [Biography] 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:



 
/world.setvariable




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


10,818 views.

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

Go to topic:           Search the forum


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

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

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

[Best viewed with any browser - 2K]    [Hosted at HostDash]