Files
aardwolf/Spellbook.xml
2024-10-08 01:25:08 +03:00

184 lines
4.1 KiB
XML

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Tuesday, October 08, 2024, 12:58 am -->
<!-- MuClient version 5.07-pre -->
<!-- Plugin "Spellbook" generated by Plugin Wizard -->
<muclient>
<plugin
name="Spellbook"
author="Chen Asraf &lt;contact@casraf.dev&gt;"
id="cd6018d26b76bece198ecad8"
language="Lua"
purpose="Lists all spells in a sticky window for reference"
save_state="y"
date_written="2024-10-08 00:56:30"
requires="5.07"
version="1.0"
>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
group="spellbook"
match=" Spell name Mana Learned Spell#"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>--</send>
</trigger>
<trigger
group="spellbook"
match="^\s+ ([\w\s]+[\w])\s+([\d]+)\s+([\d]+)%\s+([\d]+)$"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>local name = "%1"
local mana = "%2"
local learned = "%3"
local spn = "%4"
table.insert(spWinData, {
level = spWinLv,
name = name,
mana = mana,
learned = learned,
id = spn
})</send>
</trigger>
<trigger
group="spellbook"
match="^Level ([\d]+)\s*: ([\w\s]+[\w])\s+([\d]+)\s+([\d]+)%\s+([\d]+)$"
omit_from_output="y"
regexp="y"
send_to="12"
sequence="100"
>
<send>spWinLv = %1
local name = "%2"
local mana = "%3"
local learned = "%4"
local spn = "%5"
table.insert(spWinData, {
level = spWinLv,
name = name,
mana = mana,
learned = learned,
id = spn
})</send>
</trigger>
<trigger
enabled="y"
group="spellup"
match="You are no longer able to breathe underwater."
sequence="100"
>
<send>c 'underwater breathing'</send>
</trigger>
<trigger
group="spellbook"
match="To see all skills/spells for your class, use 'allspells &lt;class&gt;'"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>string.lpad = function(str, len, char)
if char == nil then char = ' ' end
return string.rep(char, len - #str) .. str
end
string.rpad = function(str, len, char)
if char == nil then char = ' ' end
return str .. string.rep(char, len - #str)
end
local lv = 0
for i, sp in ipairs(spWinData) do
local line = ""
if sp.level &gt; lv then
line = line .. "@W" .. string.rpad("lv " .. sp.level, 7)
lv = sp.level
else
line = line .. string.rpad("", 8)
end
line = line .. "@M[@G" .. string.lpad(sp.id, 3) .. "@M] "
line = line .. "@C" .. string.rpad(sp.name, 40)
line = line .. "@Y" .. string.lpad(sp.learned .. "%", 4)
spWin:add_text(line)
end
ColourNote("yellow", "black", "Output captured to window.")
EnableTriggerGroup("spellbook", false)</send>
</trigger>
<trigger
group="spellbook"
match="-----------------------------------------------------------"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>--</send>
</trigger>
<trigger
group="spellbook"
match="---------- -------------------------- ---- ------- ------"
omit_from_output="y"
send_to="12"
sequence="100"
>
<send>--</send>
</trigger>
</triggers>
<!-- Aliases -->
<aliases>
<alias
match="^(sp|spe|spell|spells)( .+)?$"
enabled="y"
group="spellbook"
regexp="y"
send_to="12"
sequence="100"
>
<send>require "themed_miniwindows"
spWin = ThemedTextWindow("spWin", 200, 200, 600, 500, "Spellbook", "center", true, true, true)
EnableTriggerGroup("spellbook")
spWinData = {}
Send("spells%2")
</send>
</alias>
</aliases>
<!-- Timers -->
<timers>
<timer enabled="y" minute="10" second="0.00" offset_second="0.00" send_to="12"
group="keepawake" >
<send>Send("")</send>
</timer>
</timers>
<!-- Variables -->
<variables>
<variable name="themed_miniwindow_heightspWin">649</variable>
<variable name="themed_miniwindow_widthspWin">340</variable>
<variable name="mw_spWin_windowy">347</variable>
<variable name="mw_spWin_windowx">1216</variable>
</variables>
</muclient>