[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Plugins
. . -> [Subject]  Aardwolf "consider" plugin

Aardwolf "consider" plugin

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Pages: 1 2  

Posted by Nick Gammon   Australia  (22,991 posts)  [Biography] bio   Forum Administrator
Date Wed 06 Aug 2008 03:18 AM (UTC)
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 &quot;consider&quot; 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
[Go to top] top

Posted by Nick Gammon   Australia  (22,991 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Wed 06 Aug 2008 03:21 AM (UTC)

Amended on Wed 06 Aug 2008 03:22 AM (UTC) by Nick Gammon

Message

Example output:

The numbers in brackets indicate the relative level ranges, compared to yours. You can customize the colours by editing the plugin and simply putting a different colour in the table next to each message.


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Fiendish   USA  (2,515 posts)  [Biography] bio   Global Moderator
Date Reply #2 on Tue 14 Oct 2008 12:30 PM (UTC)

Amended on Tue 14 Oct 2008 01:04 PM (UTC) by Fiendish

Message
Out of curiosity, is there a reason why you did it this way instead of simply making a message for each trigger? Looping to find the right message after you already know which message should appear based on the trigger pattern seems somewhat inefficient.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,991 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Tue 14 Oct 2008 08:37 PM (UTC)

Amended on Sun 27 Mar 2016 08:49 PM (UTC) by Nick Gammon

Message
I must admit I can't think of a good reason, except for some sort of strange laziness that overtook me, that made me do more work than I needed to. :-O

The version below should be more efficient ...


<?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 &quot;consider&quot; lines"
   date_written="2008-10-15 07:35"
   requires="4.30"
   version="2.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="*You would stomp * into the ground."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="a"
  >
  </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"
   name="b"
  >
  </trigger>
  
  <trigger
   enabled="y"
   group="consider"
   match="*No Problem! * is weak compared to you."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="c"
  >
  </trigger>
  
  <trigger
   enabled="y"
   group="consider"
   match="* looks a little worried about the idea."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="d"
  >
  </trigger>

  <trigger
   enabled="y"
   group="consider"
   match="* should be a fair fight!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="e"
  >
  </trigger>

  <trigger
   enabled="y"
   group="consider"
   match="* snickers nervously."
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="f"
  >
  </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"
   name="g"
  >
  </trigger>
    
  <trigger
   enabled="y"
   group="consider"
   match="*Best run away from * while you can!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="h"
  >
  </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"
   name="i"
  >
  </trigger>
  
  <trigger
   enabled="y"
   group="consider"
   match="* would crush you like a bug!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="j"
  >
  </trigger>
  
  <trigger
   enabled="y"
   group="consider"
   match="* would dance on your grave!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="k"
  >
  </trigger>
  
  <trigger
   enabled="y"
   group="consider"
   match="* says 'BEGONE FROM MY SIGHT unworthy!'"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="l"
  >
  </trigger>
 
  <trigger
   enabled="y"
   group="consider"
   match="*You would be completely annihilated by *!"
   omit_from_output="y"
   script="adapt_consider"
   sequence="100"
   name="m"
  >
  </trigger>
  
</triggers>

<!--  Script  -->


<script>
<![CDATA[

consider_messages = {
    a = { range = "-19 and below",  colour = "gray", },
    b = { range = "-10 to -19",     colour = "darkgreen", },
    c = { range = "-6 to -9",       colour = "forestgreen", },
    d = { range = "-2 to -6",       colour = "chartreuse", },
    e = { range = "-2 to +2",       colour = "springgreen", },
    f = { range = "+2 to +3",       colour = "darkgoldenrod", },
    g = { range = "+3 to +8",       colour = "gold", },
    h = { range = "+8 to +16",      colour = "tomato", },
    i = { range = "+16 to +21",     colour = "crimson", },
    j = { range = "+21 to +32",     colour = "lightpink", },
    k = { range = "+32 to +41",     colour = "darkmagenta", },
    l = { range = "+41 to +50",     colour = "darkviolet", },
    m = { range = "+50 and above",  colour = "magenta", },
      } -- end of consider_messages
      
function adapt_consider (name, line, wildcards)
  mob = consider_messages [name]
  if mob then
    ColourNote (mob.colour, "", line .. " (" .. mob.range .. ")" )
  else
    ColourNote ("white", "blue", "Could not find message for trigger: " .. line)
  end -- if
end -- adapt_consider

]]>
</script>

</muclient>

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Jsportive-Thalanvor   Netherlands  (71 posts)  [Biography] bio
Date Reply #4 on Sat 10 Mar 2012 06:58 PM (UTC)
Message
i know this might be outdated. but still it's good to use it.
in my opinion.

but i got the next error when i imported it:
(i imported the more efficient one :P )


[WARNING] Clipboard
Line    9: Tag not used: <plugin> (muclient)
[WARNING] Clipboard
Line  181: Tag not used: <script> (muclient)
[Go to top] top

Posted by Fiendish   USA  (2,515 posts)  [Biography] bio   Global Moderator
Date Reply #5 on Sat 10 Mar 2012 10:45 PM (UTC)
Message
Quote:
but i got the next error when i imported it:
Can you define "imported"? I don't think of that word when I think of loading plugins, so I think perhaps you did it wrong.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Jsportive-Thalanvor   Netherlands  (71 posts)  [Biography] bio
Date Reply #6 on Sat 10 Mar 2012 11:40 PM (UTC)
Message
imported..

in this forum it's explained about import from clipboard.

that is what i used.

copy between the lines,
in Client click File, Import, Clipboard.

or should i have used a xml?
[Go to top] top

Posted by Fiendish   USA  (2,515 posts)  [Biography] bio   Global Moderator
Date Reply #7 on Sun 11 Mar 2012 01:51 AM (UTC)
Message
Plugins are always loaded as .xml text files.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Jsportive-Thalanvor   Netherlands  (71 posts)  [Biography] bio
Date Reply #8 on Sun 11 Mar 2012 04:19 AM (UTC)
Message
yup, got it to work. and love the plugin
[Go to top] top

Posted by Jsportive-Thalanvor   Netherlands  (71 posts)  [Biography] bio
Date Reply #9 on Wed 21 Mar 2012 05:17 PM (UTC)
Message
since i use 'true seeing' it's all strange.

there are the aura's noted before the mobs name.
and with shortflags, they are something like this:


(R) You would stomp A nibbling rabbit into the ground.
(H)(R) You would stomp A plump cook into the ground.
(R) You would stomp A nibbling rabbit into the ground.
(R) You would stomp A nibbling rabbit into the ground.


i haven't been able to check if i can implement something of the last 2 helps i had. but i'm going to try that.
just wanted to let you know i'm going to change this.
[Go to top] top

Posted by Fiendish   USA  (2,515 posts)  [Biography] bio   Global Moderator
Date Reply #10 on Sun 27 Mar 2016 03:56 PM (UTC)
Message
re-opening thread. A player found bugs in posted code.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Khannon   (32 posts)  [Biography] bio
Date Reply #11 on Sun 27 Mar 2016 05:01 PM (UTC)

Amended on Sun 27 Mar 2016 05:04 PM (UTC) by Fiendish

Message
All matches are missing * for auras.
> match="*Best run away from * while you can!"

</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"
[Go to top] top

Posted by Fiendish   USA  (2,515 posts)  [Biography] bio   Global Moderator
Date Reply #12 on Sun 27 Mar 2016 05:07 PM (UTC)

Amended on Sun 27 Mar 2016 05:08 PM (UTC) by Fiendish

Message
(detection of prefixed auras is optional so both with and without need to be handled)

In this case, consider on a mob could bring up, e.g.
Quote:

(H)(R) You would stomp Verblain and Melox into the ground.

or it could bring up just
Quote:

You would stomp Verblain and Melox into the ground.


Basically, the patterns need to either not be front-anchored or account for every possible set of visible mob auras in either short or long forms. Khannon is suggesting to not front-anchor them for simplicity.

Quote:
(Animated) (A): Inanimate things given life and thought through magical means,
under their master's control (thus the (Charmed) aura).

(Angry): This flag shows on aggressive monsters when sensing anger.
(There is no short version of this flag.)

(Charmed) (C): Monsters with this aura are under the command of someone
else.

(Diseased) (D): A person or mob with this aura is diseased.

(Golden Aura) (G): Players and mobs with this aura are of good alignment.
Evil aligned players will get more xp for attacking mobs with this aura.

(Hidden) (H): The mob is hiding but has been detected.

(Invis) (I): The mob is invisible, and you have detection spells to see it.

(Marked) (X): A person or mob with this aura is under the effect of a
spell which makes one much more vulnerable to attacks. Be careful when
adventuring with this aura!

(Red Aura) (R): Players and mobs with this aura are of evil alignment.
Good aligned players will get more xp for attacking mobs with this aura.

(Stealth) (S): Those under the effect of the Oracle spell Eye of Warning
will see this flag next to stalking/stealthed players.

(Translucent) (T): A person or mob with this aura can pass through many
doors without bothering to open them or look for a key.

(Undead) (U): Necromancers sensing undead will see this flag on applicable
monsters.

(White Aura) (W): A person or mob with this aura is under the effect of
a powerful spell which reduces the damage taken from enemy attacks.

https://github.com/fiendish/aardwolfclientpackage
[Go to top] top

Posted by Nick Gammon   Australia  (22,991 posts)  [Biography] bio   Forum Administrator
Date Reply #13 on Sun 27 Mar 2016 08:51 PM (UTC)
Message
Added prefix wildcards.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Khannon   (32 posts)  [Biography] bio
Date Reply #14 on Tue 29 Mar 2016 08:45 PM (UTC)

Amended on Tue 29 Mar 2016 09:27 PM (UTC) by Khannon

Message
Removed message as error was in my end leaving space in.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


55,490 views.

This is page 1, subject is 2 pages long: 1 2  [Next page]

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]