[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]  MUSHclient Triggers that Include Variables

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

MUSHclient Triggers that Include Variables

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


Posted by RashinLord   Canada  (29 posts)  [Biography] bio
Date Tue 13 Dec 2005 06:19 AM (UTC)  quote  ]
Message
what would one put in the trigger line of a trigger to represent a variable?

for example, in wintin/tintin, it would look as such:

#variable {attack} {kick}
#variable {target} {Nick}
#acton {$target has arrived.}{$attack $target}
[Go to top] top

Posted by RashinLord   Canada  (29 posts)  [Biography] bio
Date Reply #1 on Tue 13 Dec 2005 07:13 AM (UTC)  quote  ]
Message
Would it be @target? Searching around the site, that's what I see but then my question would be, "Are script globals defined in plugins avaiable to other plugins, or do I have to use MUSHclient variables?
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Reply #2 on Tue 13 Dec 2005 07:39 AM (UTC)  quote  ]
Message
The equivalent in MUSHclient would be (this is Lua, but other languages are very similar):

/SetVariable ("attack", "kick")
/SetVariable ("target", "Nick")

(These were typed into the command window, hence the slash). You could make an alias "target" to do the above, this has been covered quite a few times in the forum.

The trigger, copied from the trigger list:


<triggers>
  <trigger
   custom_colour="2"
   enabled="y"
   expand_variables="y"
   match="@target has arrived."
   sequence="100"
  >
  <send>@attack @target</send>
  </trigger>
</triggers>


You are right, it is @target and @attack, with "expand_variable" checked.

Quote:

Are script globals defined in plugins avaiable to other plugins ...


No, each plugin has its own script space, which is separate again from the main script space (the one used by the command window, and "main" triggers etc.)

This is for 2 main reason:


  • Each plugin author is entitled to know s/he has their own set of variables, and that if another plugin happens to use (say) "counter" it won't adversely affect their plugin.

  • Plugins can be in different languages, so that things like Lua threads or tables would not have a ready representation in (say) VBscript.


However you can use MUSHclient variables, to an extent, to communicate between plugins. For example, GetPluginVariable will get the variables from another plugin. However you cannot change another plugin's variables for much the same reason they share different script spaces - to make each plugin self-contained.

You can *ask* another plugin to change its variables in various ways, one being the BroadcastPlugin script call, or CallPlugin. Another way is simply to make a "dummy" command that is sent to be executed (using the Execute script function), that another plugin can trap by using an alias.

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


1,369 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]