| Message |
First, here is a "reload the plugin I am working on" alias:
<aliases>
<alias
match="rl"
enabled="y"
send_to="12"
sequence="100"
>
<send>
if ReloadPlugin ("97d89d35e4b6d88747267240") == error_code.eNoSuchPlugin then
check (LoadPlugin ("/program files/mushclient/worlds/plugins/some_plugin.xml"))
end
Note "plugin reloaded"
</send>
</alias>
</aliases>
I use a variant of that (you need to change the plugin ID and the filename) so that if the plugin is loaded, it reloads it, and if not loaded (eg. because of a syntax error) it loads it from scratch. Then to test I just type "rl" and start testing.
Then I have the plugin open in Crimson Editor, so I can just Alt+Tab back and forth and effortlessly change things as required. To add more triggers/aliases/timers, just enter them in the main GUI, then use the Copy button to get them on the clipboard, then delete them from the main world file. Then, just paste them into the plugin where required.
You should be able to get them to communicate with each other with BroadcastPlugin or CallPlugin, combined possibly with GetPluginVariable or GetPluginVariableList.
The approach of putting everything in the world file, first misses out on some of the plugin-specific callbacks, and also makes it hard to distribute your ideas to players who may already have their own scripts in their world file. The whole idea of plugins was that you could selectively add them, regardless of whatever they already might be using.
I suppose hotspot callbacks could be called in the main script file, but I am reluctant to do that. Effectively it would encourage non-modular distributions. If you were desperate, you could fudge around it by making a small plugin whose job was simply to add hotspots to miniwindows, and when the callback was called, generate some alias that communicates with the main script. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | top |
|