You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
249 lines
5.4 KiB
249 lines
5.4 KiB
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE muclient>
|
|
<!-- Saved on Thursday, May 01, 2008, 9:38 AM -->
|
|
<!-- MuClient version 4.23 -->
|
|
|
|
<!-- Plugin "Command_Throttler" generated by Plugin Wizard -->
|
|
|
|
<muclient>
|
|
<plugin
|
|
name="Watchmen_Envenomer"
|
|
author="Trachx"
|
|
id="40b23d22e11ea1ffafa98f09"
|
|
language="Lua"
|
|
purpose="Manage received weapons and return them when envenomed"
|
|
date_written="2008-05-01 09:34:22"
|
|
requires="4.18"
|
|
version="1.01"
|
|
>
|
|
|
|
</plugin>
|
|
|
|
<triggers>
|
|
<trigger enabled="y" regexp="y" sequence="90" keep_evaluating="y" omit_from_output="n" name="Envenom"
|
|
script="TRIGGER_Envenom"
|
|
match="^You coat (?<item>.*) with deadly poison\.$"
|
|
></trigger>
|
|
|
|
<trigger enabled="y" regexp="y" sequence="90" keep_evaluating="y" omit_from_output="n" name="Giver"
|
|
script="TRIGGER_Giver"
|
|
match="^You receive (?<item>.*) from (?<giver>.*)\.$"
|
|
></trigger>
|
|
|
|
<trigger enabled="y" regexp="y" sequence="90" keep_evaluating="y" omit_from_output="y" name="InvMon"
|
|
script="TRIGGER_InvMon"
|
|
match="^\{invmon\}(?<Action>\d+),(?<ID>\d+),(?<Container>-?\d+),(?<Wear>-?\d+)$"
|
|
></trigger>
|
|
|
|
<trigger enabled="y" regexp="y" sequence="91" keep_evaluating="y" omit_from_output="y" name="InvDataItem"
|
|
script="TRIGGER_InvItem"
|
|
match="^\{invitem\}(?<ID>\d+),(?<Flags>[^,]+)?,(?<Name>.+),(?<Level>\d+),(?<Type>\d+),(?<Unique>[01]),(?<Wear>-?\d+),(?<Expire>-?\d+)$"
|
|
></trigger>
|
|
|
|
</triggers>
|
|
|
|
|
|
<!-- Aliases -->
|
|
|
|
<aliases>
|
|
<alias
|
|
match="env clear"
|
|
enabled="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>
|
|
ColourNote ("lime", "", "Deleted " .. #queue .. " outstanding item(s) from the queue.")
|
|
queue = {} -- queue is now empty
|
|
</send>
|
|
</alias>
|
|
|
|
<alias
|
|
match="env show"
|
|
enabled="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>
|
|
if #queue == 0 then
|
|
ColourNote ("red", "", "Pending envenom queue is empty")
|
|
return
|
|
end -- if
|
|
|
|
ColourNote ("lime", "", "Envenom queue:")
|
|
for k, v in ipairs (queue) do
|
|
ColourNote ("yellow", "", v.name .. ", " .. v.id .. ", " .. v.giver)
|
|
end -- for
|
|
ColourNote ("lime", "", #queue .. " outstanding item(s) in the envenom queue.")
|
|
</send>
|
|
</alias>
|
|
|
|
<alias
|
|
match="env del"
|
|
enabled="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>
|
|
if #queue == 0 then
|
|
ColourNote ("red", "", "Pending envenom queue is empty")
|
|
return
|
|
end -- if
|
|
|
|
item = table.remove(queue, 1)
|
|
|
|
ColourNote ("lime", "", "Removed item ID: " .. item.id .. " from " .. item.giver)
|
|
</send>
|
|
</alias>
|
|
|
|
<alias
|
|
match="env give"
|
|
enabled="y"
|
|
send_to="12"
|
|
sequence="100"
|
|
>
|
|
<send>
|
|
if #queue == 0 then
|
|
ColourNote ("red", "", "Pending envenom queue is empty")
|
|
return
|
|
end -- if
|
|
|
|
item = queue[1]
|
|
|
|
state = 16
|
|
Send ("envenom " .. item.id)
|
|
</send>
|
|
</alias>
|
|
</aliases>
|
|
|
|
<!-- Script -->
|
|
|
|
|
|
<script>
|
|
<![CDATA[
|
|
|
|
require "getlines"
|
|
require "gmcphelper"
|
|
|
|
queue = {}
|
|
state = 0
|
|
item_id = 0
|
|
item_name = ""
|
|
|
|
|
|
function TRIGGER_Envenom(name, line, wildcards, styles) -- {{{
|
|
state = 17
|
|
end -- }}}
|
|
|
|
function TRIGGER_Giver(name, line, wildcards, styles) -- {{{
|
|
if state == 2 then
|
|
state = 2
|
|
item = {}
|
|
flags = utils.split(wildcards.giver, " ")
|
|
|
|
item.id = item_id
|
|
item.name = item_name
|
|
item.giver = flags[#flags]
|
|
|
|
|
|
table.insert (queue, item)
|
|
|
|
Note("received weapon " .. item_id)
|
|
Note("received weapon " .. wildcards.item .. " giver: " .. wildcards.giver)
|
|
|
|
|
|
else
|
|
state = 0
|
|
end
|
|
end -- }}}
|
|
|
|
|
|
function TRIGGER_InvMon(name, line, wildcards, styles) -- {{{
|
|
if state == 1 then
|
|
state = 2
|
|
else
|
|
state = 0
|
|
end
|
|
end -- }}}
|
|
|
|
|
|
function TRIGGER_InvItem(name, line, wildcards, styles) -- {{{
|
|
|
|
if state == 17 then
|
|
if next (queue) == nil then
|
|
Note("Item was envenomed outside the queue")
|
|
state = 0
|
|
return
|
|
end
|
|
|
|
item = queue[1]
|
|
if item.id == wildcards.ID then
|
|
Send("give " .. item.id .. " " .. item.giver)
|
|
table.remove(queue, 1)
|
|
state = 0
|
|
else
|
|
Note("Item was envenomed outside the queue")
|
|
state = 0
|
|
end
|
|
return
|
|
end
|
|
|
|
state = 0
|
|
|
|
if tonumber(wildcards.Type) == 5 then
|
|
state = 1
|
|
item_id = wildcards.ID
|
|
item_name = wildcards.Name
|
|
end
|
|
|
|
end -- }}}
|
|
|
|
function OnPluginInstall()
|
|
InstallMessage()
|
|
|
|
end
|
|
|
|
function InstallMessage()
|
|
ColourNote("green", "", "-----------------|Envenomer|-----------------")
|
|
|
|
ColourNote("lime", "",
|
|
"| Envenomer Installed!- type 'env help' |")
|
|
|
|
ColourNote("green", "", "-----------------|Envenomer|-----------------")
|
|
end
|
|
|
|
function OnHelp()
|
|
|
|
Note("")
|
|
ColourNote("lime", "", "---------------------|Envenomer Help|-----------------------")
|
|
ColourNote("lime", "", "env help : ", "white", "", "Brings you here.")
|
|
ColourNote("lime", "", "env show : ", "white", "", "Display outstanding envenoms.")
|
|
ColourNote("lime", "", "env give : ", "white", "", "Envenoms and return to giver.")
|
|
ColourNote("lime", "", "env del : ", "white", "", "Deletes first item")
|
|
ColourNote("lime", "", "env clear : ", "white", "", "Clears envenom list")
|
|
ColourNote("red", "", "Note : ", "white", "", "invmon must be on for it to work")
|
|
|
|
ColourNote("lime", "", "---------------------|Envenomer Help|-----------------------")
|
|
Note("")
|
|
|
|
end
|
|
|
|
|
|
]]>
|
|
</script>
|
|
|
|
|
|
<!-- Plugin help -->
|
|
|
|
<aliases>
|
|
<alias
|
|
script="OnHelp"
|
|
match="env help"
|
|
enabled="y"
|
|
>
|
|
</alias>
|
|
</aliases>
|
|
</muclient>
|
|
|
|
|