Hiding works beautifully now. Thank you so much, Nick! :)
If it's not too much trouble and you're free, could you possibly help me have a look at what's wrong with my replace-cp-with-gq version, please..? It's alright if you aren't, just thought I'd ask anyway. :D
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- From Aardwolf_Campaign_Noter_v2 by Nick Gammon -->
<!-- Saved on Tuesday, July 15, 2008, 11:06 AM -->
<!-- MuClient version 4.33 -->
<!-- Plugin "Aardwolf_Gq_Noter" generated by Plugin Wizard -->
<muclient>
<plugin
name="Aardwolf_gq_Noter"
author="Nick Gammon -modified-"
id="23c3c91af0a26790c625f5d2"
language="Lua"
purpose="Shows remaining gq objectives"
date_written="2008-07-22"
requires="4.34"
version="1.0"
save_state="y"
>
<description trim="y">
<![CDATA[
Shows outstanding gq objectives.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
match="^You still have to kill (.*?) \* (.*?)$"
name="gq_item"
script="gq_item"
sequence="100"
regexp="y"
>
</trigger>
<trigger
enabled="y"
match="Congratulations, that was one of the GLOBAL QUEST mobs!"
send_to="10"
sequence="100"
>
<send>gq check</send>
</trigger>
<trigger
enabled="y"
match="Global Quest: The global quest has been won by"
sequence="100"
script="gq_done"
>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
name="gq_check"
script="gq_check"
match="^(gq|gquest) check$"
enabled="y"
regexp="y"
sequence="100"
>
<send>gq check</send>
</alias>
</aliases>
<!-- Script -->
<script>
<![CDATA[
require "commas"
background_colour = 0xE7FFFF
text_colour = 0x000000
heading_colour = 0x800080
time_colour = 0x82004B
gq_info = {}
function capitalize (s)
return string.sub (s, 1, 1):upper () .. string.sub (s, 2):lower ()
end -- capitalize
function gq_item (name, line, wildcards)
local text = wildcards [1]
text = string.sub (text, 1, 1):upper () .. string.sub (text, 2)
table.insert (gq_info, text)
max_width = math.max (max_width, WindowTextWidth (global, font_id, text))
end -- gq_item
function gq_done (name, line, wildcards)
WindowShow (global, false)
gq_info = {}
end -- gq_done
function Display_Line (i, text, id, colour)
local right = 5
local top = (i * font_height) - font_height
WindowText (global, id, text, left, top, 0, 0, colour)
end -- Display_Line
function show_gq_text ()
-- do nothing if no gq
if #gq_info == 0 or when_required == nil then
return
end -- if
-- recreate the Window the correct size
check (WindowCreate (global,
0, 0, -- left, top (auto-positions)
max_width + 10, -- width
(#gq_info + 2) * font_height + 5, -- height
7, -- auto-position: top middle
0, -- flags
0xE7FFFF) )
-- heading
local text = "Current gq. You need to kill:"
max_width = math.max (max_width, WindowTextWidth (global, font_id, text))
Display_Line (1, text, font_id, heading_colour)
-- list of mobs
for i, v in ipairs (gq_info) do
Display_Line (i + 1, v, font_id, text_colour)
end -- for
WindowShow (global, true)
end -- show_gq_text
function gq_check( name, line, wildcards)
check (EnableTrigger ("gq_item", true))
gq_info = {}
max_width = 0
end -- gq_check
function OnPluginInstall ()
global = GetPluginID ()
font_id = "fn"
font_name = "Comic Sans MS" -- the actual font
-- make window so I can grab the font info
check (WindowCreate (global,
0, 0, 1, 1,
1, -- irrelevant
0,
background_colour) )
check (WindowFont (global, font_id, font_name, 8, false, false, false, false, 0, 0)) -- normal
font_height = WindowFontInfo (global, font_id, 1) -- height
end -- OnPluginInstall
function OnPluginDisable ()
WindowShow (global, false)
end -- OnPluginDisable
]]>
</script>
</muclient>
|