Thanks for the pointers Nick, they helped me a lot.
I wrote a little plugin to handle the displaying. I have the miniwindow shown and I can move it around. The image display doesn't seem to work though.
The individual commands work, at least when I tested them in the Immediate window.
Within the plugin I defined the following triggers.
<triggers>
<trigger
enabled="y"
match="*gets stuck in*"
send_to="12"
sequence="100"
>
<send>showStuck</send>
</trigger>
<trigger
enabled="y"
match="^You * in *: Unstuck"
send_to="12"
sequence="100"
>
<send>showClear</send>
</trigger>
<trigger
enabled="y"
match="^You * in *: Stuck"
send_to="12"
sequence="100"
>
<send>showStuck</send>
</trigger>
</triggers>
The called functions are:
function showStuck()
local f = assert (io.open ("D:\Program Files (x86)\MUSHclient\images\black.png", "rb")) -- open read-only, binary mode
local image_data = f:read ("*a") -- read all of it
f:close () -- close it
WindowLoadImageMemory (win, "im1", image_data) -- load image from memory
WindowDrawImage (win, "im2", 5, 5, 115, 115, miniwin.image_stretch) -- draw it
end
function showClear()
local f = assert (io.open ("D:\Program Files (x86)\MUSHclient\images\weapon.png", "rb")) -- open read-only, binary mode
local image_data = f:read ("*a") -- read all of it
f:close () -- close it
WindowLoadImageMemory (win, "im2", image_data) -- load image from memory
WindowDrawImage (win, "im1", 5, 5, 115, 115, miniwin.image_stretch) -- draw it
end
The second and third trigger are meant to be used for testing, so that I can say stuff , the plugin trigger catches the said and then triggers the appropiate functions.
The images, im1 and im2 are loaded within the function PluginInstall, where the function ImageLoad is called.
function ImageLoad()
local f = assert (io.open ("D:\Program Files (x86)\MUSHclient\images\black.png", "rb")) -- open read-only, binary mode
local image_data = f:read ("*a") -- read all of it
f:close () -- close it
WindowLoadImageMemory (win, "im1", image_data) -- load image from memory
local f = assert (io.open ("D:\Program Files (x86)\MUSHclient\images\weapon.png", "rb")) -- open read-only, binary mode
local image_data = f:read ("*a") -- read all of it
f:close () -- close it
WindowLoadImageMemory (win, "im2", image_data) -- load image from memory
end -- end ImageLoad
When the first trigger is called, the client returns:
Compile error
Plugin: Yoriks_Graphical_Reminder (called from world: Geas)
Immediate execution
[string "Trigger: "]:1: '=' expected near '<eof>'
Please help |