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