I decided to redo my plugin to use miniwindows instead of the infobar but somehow I got some trigger problems again...
I trimmed the code down to one spell to make it less verbose.
The triggers on the prio1up and prio1down triggers work it seems but the triggers on the affects command:
You are affected by:
Spell: 'desensitize' for a short time.
Spell: 'fly' for a very short time.
Spell: 'ocular enhancement' for a short time.
Spell: 'ocular enhancement' for a short time.
Spell: 'ocular enhancement' for a short time.
Spell: 'invis' for a medium time.
Seem not to work at all.
Neither the trigger on "You are affected by" nor the prio1affectregex I used.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, February 19, 2008, 2:31 PM -->
<!-- MuClient version 4.14 -->
<!-- Plugin "Spellup_Script" generated by Plugin Wizard -->
<muclient>
<plugin
name="Spellup_Script"
author="Rodriguez"
id="f9e3698e93e4ac3786236acf"
language="Lua"
purpose="Keep track of affects"
date_written="2008-02-19 14:26:09"
requires="3.23"
version="1.0"
>
<description trim="y">
<![CDATA[
This plugin will keep track of your affects.
]]>
</description>
</plugin>
<!-- Variables -->
<variables>
<variable name="prio1spell">c 'desensitize'</variable>
<variable name="prio1downmessage">You feel pain normally once again.</variable>
<variable name="prio1upmessage">You will the sensation of pain to retreat from your flesh.</variable>
<variable name="prio1affectregex">Spell\: \'desensitize\'</variable>
<variable name="prio1do"> =desensitize= </variable>
<variable name="prio1up"> desensitize </variable>
<variable name="prio1current"> =desensitize= </variable>
</variables>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
match="You are affected by"
name="clearstat"
sequence="100"
send_to="12"
>
<send>
SetVariable ("prio1current", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1do'))
</send>
</trigger>
<trigger
custom_colour="7"
enabled="y"
match="@prio1downmessage"
expand_variables="y"
name="p1down"
sequence="100"
send_to="12"
>
<send>
SetVariable ("prio1current", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1do'))
</send>
</trigger>
<trigger
enabled="y"
match="@prio1upmessage"
expand_variables="y"
name="p1up"
sequence="100"
send_to="12"
>
<send>
SetVariable ("prio1current", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1up'))
</send>
</trigger>
<trigger
enabled="y"
match="@prio1affectregex"
regexp="y"
expand_variables="y"
name="p1stat"
sequence="100"
send_to="12"
>
<send>
SetVariable ("prio1current", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1up'))
</send>
</trigger>
</triggers>
<!-- Timers -->
<timers>
<timer enabled="y" second="1.00" send_to="12">
<send>
require "var"
-- make window if required
if not setup_affects_window then
affects_win = GetPluginID () .. ":affects" -- get a unique name
WindowCreate (affects_win , 0, 0, 250, 310, 6, 1, ColourNameToRGB("black")) -- create window
WindowFont (affects_win, "f", "FixedSys", 9) -- define font
target_font_height = WindowFontInfo (affects_win , "f", 1)
setup_affects_window = true
end -- if first time
-- blank existing window contents
WindowRectOp (affects_win, 2, 0, 0, 0, 0, WindowInfo (affects_win, 9))
-- framing rectangle
WindowRectOp (affects_win, 5, 0, 0, 0, 0, 5, 15)
-- variables for text position (the top updates as we move down)
local left = 5
local top = 5
-- current queue
WindowText (affects_win, "f", "Placeholder: " .. (var.target or "none"),
left, top, 0, 0, ColourNameToRGB("white"))
top = top + target_font_height + 10
-- Current Affects
if string.find(GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1current'),"=") == nil then
WindowText (affects_win, "f", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1current'),
left, top, 0, 0, ColourNameToRGB("green"))
else
WindowText (affects_win, "f", GetPluginVariable ('f9e3698e93e4ac3786236acf', 'prio1current'),
left, top, 0, 0, ColourNameToRGB("red"))
end
top = top + target_font_height
-- make visible, or refresh if already visible
WindowShow (affects_win , true)
</send>
</timer>
</timers>
<!-- Plugin help -->
<aliases>
<alias
script="OnHelp"
match="Spellup:help"
enabled="y"
>
</alias>
</aliases>
<script>
<![CDATA[
function OnHelp (sName, sLine, wildcards)
World.Note (World.GetPluginInfo (World.GetPluginID, 3))
end
]]>
</script>
</muclient>
Any ideas or is there a way to debug plugins? The regex seem to work but some bug must be in there. :/ |