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


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  VBscript
. . -> [Subject]  one variable - multiple triggers - how?

one variable - multiple triggers - how?

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


Posted by Doopsko   (2 posts)  [Biography] bio
Date Sat 16 Oct 2004 09:19 AM (UTC)
Message
Hi
I've got a problem with variables.
I want to do few triggers that will change one variable. I mean:
When I see 2 ways out: nw and ne I want set variable "position" to 1
When I see 2 others ways out: w and nw I want set variable "position" to 2
etc.

I wrote something like this but it doesn't work, because a name of variable is at once a name of trigger:
'World.AddTriggerEx "position", ": nw and ne", "3", 49, -1, 0, "", "", 9, 50
'World.AddTriggerEx "position", ": w and nw", "4", 49, -1, 0, "", "", 9, 50
'World.AddTriggerEx "position", ": ne, sw and e", "5", 49, -1, 0, "", "", 9, 50

I've found a specific place in my mud world and I want write a script that will know where I exactly am at the moment.

I want to write a nice-looking script, I dont want it to be like that:

<trigger
enabled="y"
match="nw and w"
send_to="10"
sequence="100"
>
<send>/world.setvariable &quot;position&quot;, &quot;1&quot;</send>
</trigger>

By the way Is it possible to write triggers available only for script? I dont want to see them in my Triggers Menu.

Thanks a lot for help.
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Sat 16 Oct 2004 05:49 PM (UTC)

Amended on Sat 16 Oct 2004 05:54 PM (UTC) by Flannel

Message
You had the right idea at the end there.
Use setvariable, get rid of the / (your script prefix) and change the "send to" dropdown box to "script".

Or you could write some logic to match on any directions, and then calculate your number.

And no, there is no way to "hide" triggers.
Although you could put them in a plugin. Then they would be in the plugin and not in the world file's triggers.

You know, you can also make triggers without a name (so you dont get the conflict, or make them named something informative) and then send to variable and use the "variable" box.
But the scripting solution is the way most of us do it, I think.

And are you trying to create new triggers from the command line? Those AddTrigger commands are designed to be used by a script, not really by people. Its easier to use the trigger interface. You get all the functionality (addtrigger cant set certain things).

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Nick Gammon   Australia  (22,982 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Sat 16 Oct 2004 09:28 PM (UTC)
Message
Quote:

By the way Is it possible to write triggers available only for script?


If you don't want to see them in your triggers list, you can put them into a plugin. This is really easy to do - first get them right in the usual place, then use the plugin wizard to move them to a plugin. That way you won't see them in the list but (provided you install the new plugin) they will have the same effect.

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


8,908 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]