Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Message
| Here is a fun plugin I wrote for Aardwolf. It doesn't require any separate modules, or even a particularly recent version of MUSHclient.
When you type "consider" it simply colours the output in a way which indicates how much the mobs you are in the room with are to be feared.
To use, copy between the lines and save as Consider_info.xml. Or, right-click and download this file:
http://www.gammon.com.au/mushclient/plugins/Aardwolf/Consider_info.xml
Then save that file in your MUSHclient plugins directory, and use File -> Plugins to install it.
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE muclient>
<!-- Saved on Wednesday, August 06, 2008, 1:13 PM -->
<!-- MuClient version 4.35 -->
<!-- Plugin "Consider_info" generated by Plugin Wizard -->
<muclient>
<plugin
name="Consider_info"
author="Nick Gammon"
id="2a5caa1cd7dbcff665e2a23d"
language="Lua"
purpose="Colours "consider" lines"
date_written="2008-08-06 13:07:35"
requires="4.30"
version="1.0"
>
<description trim="y">
<![CDATA[
When you type "consider" (or "consider all") the lines are coloured to make it easier to tell high level from low level mobs.
]]>
</description>
</plugin>
<!-- Triggers -->
<triggers>
<trigger
enabled="y"
group="consider"
match="* looks a little worried about the idea."
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* says 'BEGONE FROM MY SIGHT unworthy!'"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* should be a fair fight!"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* snickers nervously."
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* would be easy, but is it even worth the work out?"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* would crush you like a bug!"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="* would dance on your grave!"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="Best run away from * while you can!"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="Challenging * would be either very brave or very stupid."
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="No Problem! * is weak compared to you."
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="You would be completely annihilated by *!"
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="You would stomp * into the ground."
omit_from_output="y"
script="adapt_consider"
sequence="100"
>
</trigger>
<trigger
enabled="y"
group="consider"
match="^(.*?) chuckles at the thought of you fighting (him|her|it)\.$"
omit_from_output="y"
regexp="y"
script="adapt_consider"
sequence="100"
>
</trigger>
</triggers>
<!-- Script -->
<script>
<![CDATA[
consider_messages = {
["You would stomp (.+) into the ground%."] =
{ range = "-19 and below", colour = "gray", },
["(.+) would be easy, but is it even worth the work out%?"] =
{ range = "-10 to -19", colour = "darkgreen", },
["No Problem%! (.+) is weak compared to you%."] =
{ range = "-6 to -9", colour = "forestgreen", },
["(.+) looks a little worried about the idea%."] =
{ range = "-2 to -6", colour = "chartreuse", },
["(.+) should be a fair fight%!"] =
{ range = "-2 to +2", colour = "springgreen", },
["(.+) snickers nervously%."] =
{ range = "+2 to +3", colour = "darkgoldenrod", },
["(.+) chuckles at the thought of you fighting .+%."] =
{ range = "+3 to +8", colour = "gold", },
["Best run away from (.+) while you can%!"] =
{ range = "+8 to +16", colour = "tomato", },
["Challenging (.+) would be either very brave or very stupid%."] =
{ range = "+16 to +21", colour = "crimson", },
["(.+) would crush you like a bug%!"] =
{ range = "+21 to +32", colour = "lightpink", },
["(.+) would dance on your grave%!"] =
{ range = "+32 to +41", colour = "darkmagenta", },
["(.+) says 'BEGONE FROM MY SIGHT unworthy%!'"] =
{ range = "+41 to +50", colour = "darkviolet", },
["You would be completely annihilated by (.+)%!"] =
{ range = "+50 and above", colour = "magenta", },
} -- end of consider_messages
function adapt_consider (name, line, wildcards)
mob = nil
for k, v in pairs (consider_messages) do
mob = string.match (line, k)
if mob then
ColourNote (v.colour, "", line .. " (" .. v.range .. ")" )
break
end -- if
end -- for
if not mob then
ColourNote ("white", "blue", "Could not find message: " .. line)
end -- not found in table
end -- adapt_consider
]]>
</script>
</muclient>
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|