To use a plugin simply copy them to your /plugins/ directory. Then
start the client and it will load each plugin. The /plugins/
directory should be in one of the following locations depending on
the type of system you're using:
unix: ~/.tkMOO-lite/plugins
mac: PREF_FOLDER:plugins
pc: plugins directory in the same directory as the
tkmoo.tcl script.
The text to be displayed on the status bar can come from any source and the client's API has been extended to make it easy for code to modify the text displayed. In this screenshot the local time for a mud in Texas is being displayed. The message is actually composed on the mud and transferred to the client using a simple XMCP/1.1 message. A small plugin script handles the XMCP/1.1 message and displays the message.
edittriggers.register_alias
call. A plugin is the ideal way to do this.
Here's an example plugin that allows Triggers to detect incoming
paged messages and which displays them inside their own dialog box.
#
# popup.tcl
#
client.register popup start
proc popup.start {} {
edittriggers.register_alias dialog popup.dialog
}
proc popup.dialog { {message ""} } {
set popup .[util.unique_id popup]
toplevel $popup
label $popup.l -text $message -font {helvetica 10} -bd 1 -relief raised
button $popup.b -text Ok -command "destroy $popup"
pack $popup.l -side top -fill x
pack $popup.b -side bottom
}
window.displayCR "Loading popup.tcl"
This plugin creates a new command dialog
which your
Triggers can use. You need to add a new Trigger to your client
which calls this new command. Select the 'Tools->Edit Triggers'
menu option and type in the following code:
trigger -regexp {^(.*) pages, (.*)} -command {dialog "$m1 pages, $m2"}
This trigger detects lines like:
Andrew pages, "Hi!"
And then produces the following simple dialog box: