After I looked over this, I figured I'd Give it a try. Now, after toiling with it all day I've managed to come up with this, which is in my "catch all" trigger. Now when I go to see if it works, a little box shows up in the top left hand side of my screen, which I wanted to. Problem is, there is no map to go with it. I don't get any errors at the moment, but I think there is nothing in the table to display. You can see where I tried inserting everything the "catch all" trigger caught, but to no success. Help would be greatly appreciated. Here is the trigger:
<triggers>
<trigger
expand_variables="y"
keep_evaluating="y"
match="^(.*?)$"
name="middle"
omit_from_log="y"
omit_from_output="y"
regexp="y"
send_to="14"
sequence="100"
>
<send>
local win = GetPluginID () .. ":map"
local font = "f"
WindowCreate (win, 0, 0, 0, 0, 4, 0, 0)
WindowFont (win, font, "Lucida Console", 9)
local map = {}
local line, wildcards, styles = "%1"
table.insert (map, styles)
local max_width = WindowTextWidth (win, font, "Map")
max_width = math.max (max_width, WindowTextWidth (win, font, line))
local font_height = WindowFontInfo (win, font, 1)
local window_width = max_width + 10
local window_height = font_height * (#map + 2) + 10
WindowCreate (win, 0, 0, window_width, window_height, 4, 0, ColourNameToRGB "#373737")
WindowRectOp (win, 5, 0, 0, 0, 0, 5, 15 + 0x1000)
WindowText (win, font, "Map", 5, 5, 0, 0, ColourNameToRGB "yellow")
local y = font_height * 2 + 5
for i, styles in ipairs (map) do
local x = 5
for _, style in ipairs (styles) do
x = x + WindowText (win, font, style.text, x, y, 0, 0, style.textcolour)
end -- for
y = y + font_height
end -- for each map item
WindowShow (win, true)
</send>
</trigger>
</triggers>
|