Difference between revisions of "CMud Group Breakdown"

From AvatarWiki
Jump to navigation Jump to search
m (Formatting)
m (Fixed a couple of small errors in script. Should work fine now.)
Line 3: Line 3:
 
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<?xml version="1.0" encoding="ISO-8859-1" ?>
 
<cmud>
 
<cmud>
<module name="GroupBreakdown" global="true">
 
  <uid>{0D9A0A9C-056C-414B-AF5E-A1E86F81C0D7}</uid>
 
  <packages>English Keypad|English Directions|AVATARMud</packages>
 
  <alias name="groupclear">
 
    <value>#var NmsHitter "" _nodef GroupVars
 
#var CntHitter 0 _nodef GroupVars
 
#var NmsHealer "" _nodef GroupVars
 
#var CntHealer 0 _nodef GroupVars
 
#var NmsBrute "" _nodef GroupVars
 
#var CntBrute 0 _nodef GroupVars
 
#var NmsFirePwr "" _nodef GroupVars
 
#var CntFirePwr 0 _nodef GroupVars
 
#var CntTotal 0 _nodef GroupVars
 
#say "Group Counter Cleared"
 
</value>
 
  </alias>
 
  <alias name="GroupReport">
 
    <value>%concat (@grouprepto," The group that ",@groupleader, " is leading has |br|"@cnttotal, " |n|total members: ")
 
#if (@CntHitter = 1) {%concat(@grouprepto," |br|",@CntHitter, " hitter: ",%delete(@NmsHitter,1,2))}
 
#if (@CntBrute = 1) {%concat(@grouprepto," |bb|",@CntBrute, " brute: ",%delete(@NmsBrute,1,2))}
 
#if (@CntFirepwr = 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flinger: ",%delete(@NmsFirepwr,1,2))}
 
#if (@CntHealer = 1) {%concat(@grouprepto," |by|",@CntHealer, " healer: ",%delete(@NmsHealer,1,2))}
 
#if (@CntHitter &gt; 1) {%concat(@grouprepto," |br|",@CntHitter, " hitters: ",%delete(@NmsHitter,1,2))}
 
#if (@CntBrute &gt; 1) {%concat(@grouprepto," |bb|",@CntBrute, " brutes: ",%delete(@NmsBrute,1,2))}
 
#if (@CntFirepwr &gt; 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flingers: ",%delete(@NmsFirepwr,1,2))}
 
#if (@CntHealer &gt; 1) {%concat(@grouprepto," |by|",@CntHealer, " healers: ",%delete(@NmsHealer,1,2))}
 
#class GroupReport 0</value>
 
  </alias>
 
  <var name="grouprepto" usedef="true">
 
    <value>gt</value>
 
    <default>GroupRepTo</default>
 
  </var>
 
 
   <class name="GroupReport">
 
   <class name="GroupReport">
 
     <class name="GroupVars">
 
     <class name="GroupVars">
Line 52: Line 20:
 
         <default>None</default>
 
         <default>None</default>
 
       </var>
 
       </var>
       <var name="CntTotal">1</var>
+
       <var name="CntTotal">0</var>
       <var name="groupleader">Kenjin</var>
+
       <var name="groupleader">Kenji</var>
 
       <var name="CntFirePwr">0</var>
 
       <var name="CntFirePwr">0</var>
 
       <var name="NmsBrute" type="Literal"/>
 
       <var name="NmsBrute" type="Literal"/>
Line 72: Line 40:
 
     </trigger>
 
     </trigger>
 
     <trigger priority="450">
 
     <trigger priority="450">
       <pattern>(%d)~|(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] </pattern>
+
       <pattern>(%d)~|(%s)(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] *</pattern>
       <value>last %3</value>
+
       <value>last %4</value>
 
     </trigger>
 
     </trigger>
 
     <alias name="GroupRepto">
 
     <alias name="GroupRepto">
Line 80: Line 48:
 
#if %ismember(@grouprepto,"gt|say|buddy") {} {#say "You need to specify gt, say or buddy"}
 
#if %ismember(@grouprepto,"gt|say|buddy") {} {#say "You need to specify gt, say or buddy"}
 
#if %ismember(@grouprepto,"gt|say|buddy") {} {#exe grouprepto}
 
#if %ismember(@grouprepto,"gt|say|buddy") {} {#exe grouprepto}
#if %ismember(@grouprepto,"gt|say|buddy") {} {#var grouprepto ""}
+
#if %ismember(@grouprepto,"gt|say|buddy") {} {#var grouprepto ""}</value>
</value>
 
 
     </alias>
 
     </alias>
 
     <trigger priority="630">
 
     <trigger priority="630">
 
       <pattern>(%w)'s group:</pattern>
 
       <pattern>(%w)'s group:</pattern>
 
       <value>#var groupleader %1 _nodef GroupVars</value>
 
       <value>#var groupleader %1 _nodef GroupVars</value>
 +
    </trigger>
 +
    <var name="grouprepto" usedef="true">
 +
      <value>GroupRepTo</value>
 +
      <default>GroupRepTo</default>
 +
    </var>
 +
    <trigger priority="5820">
 +
      <pattern>(%d)~|(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] *</pattern>
 +
      <value>last %3</value>
 
     </trigger>
 
     </trigger>
 
   </class>
 
   </class>
 +
 +
  <alias name="groupclear">
 +
    <value>#var NmsHitter "" _nodef GroupVars
 +
#var CntHitter 0 _nodef GroupVars
 +
#var NmsHealer "" _nodef GroupVars
 +
#var CntHealer 0 _nodef GroupVars
 +
#var NmsBrute "" _nodef GroupVars
 +
#var CntBrute 0 _nodef GroupVars
 +
#var NmsFirePwr "" _nodef GroupVars
 +
#var CntFirePwr 0 _nodef GroupVars
 +
#var CntTotal 0 _nodef GroupVars
 +
#say "Group Counter Cleared"</value>
 +
  </alias>
 
   <alias name="grouplist">
 
   <alias name="grouplist">
 
     <value>#class GroupReport 1
 
     <value>#class GroupReport 1
Line 94: Line 82:
 
group</value>
 
group</value>
 
   </alias>
 
   </alias>
</module>
+
  <alias name="GroupReport">
 +
    <value>%concat (@grouprepto," The group that ",@groupleader, " is leading has |br|"@cnttotal, " |n|total members: ")
 +
#if (@CntHitter = 1) {%concat(@grouprepto," |br|",@CntHitter, " hitter: ",%delete(@NmsHitter,1,2))}
 +
#if (@CntBrute = 1) {%concat(@grouprepto," |bb|",@CntBrute, " brute: ",%delete(@NmsBrute,1,2))}
 +
#if (@CntFirepwr = 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flinger: ",%delete(@NmsFirepwr,1,2))}
 +
#if (@CntHealer = 1) {%concat(@grouprepto," |by|",@CntHealer, " healer: ",%delete(@NmsHealer,1,2))}
 +
#if (@CntHitter &gt; 1) {%concat(@grouprepto," |br|",@CntHitter, " hitters: ",%delete(@NmsHitter,1,2))}
 +
#if (@CntBrute &gt; 1) {%concat(@grouprepto," |bb|",@CntBrute, " brutes: ",%delete(@NmsBrute,1,2))}
 +
#if (@CntFirepwr &gt; 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flingers: ",%delete(@NmsFirepwr,1,2))}
 +
#if (@CntHealer &gt; 1) {%concat(@grouprepto," |by|",@CntHealer, " healers: ",%delete(@NmsHealer,1,2))}
 +
#class GroupReport 0</value>
 +
  </alias>
 +
 
 +
 
 
</cmud>
 
</cmud>
 +
 +
 +
 
</pre>
 
</pre>
  

Revision as of 23:16, 24 May 2010

Save the following code as an .xml file, and import it into Cmud:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<cmud>
  <class name="GroupReport">
    <class name="GroupVars">
      <var name="CntHealer">
        <value>0</value>
        <default>0</default>
      </var>
      <var name="CntBrute">
        <value>0</value>
        <default>0</default>
      </var>
      <var name="CntHitter">
        <value>0</value>
        <default>0</default>
      </var>
      <var name="NmsHitter" type="Literal">
        <default>None</default>
      </var>
      <var name="CntTotal">0</var>
      <var name="groupleader">Kenji</var>
      <var name="CntFirePwr">0</var>
      <var name="NmsBrute" type="Literal"/>
      <var name="NmsFirePwr" type="Literal"/>
      <var name="NmsHealer" type="Literal"/>
    </class>
    <trigger priority="440" case="true">
      <pattern>(%w) the (*) is a (%d)[st|nd|rd|th] level {Hero |Lord |""}(*), was born</pattern>
      <value>#if %ismember(%4, "Rogue|Assassin|Archer|Fusilier|Bladedancer|Black Circle Initiate") {#var NmsHitter %concat(@NmsHitter,", ",%1)}
#if %ismember(%4, "Rogue|Assassin|Archer|Fusilier|Bladedancer|Black Circle Initiate") {#var CntHitter (@CntHitter + 1)}
#if %ismember(%4, "Berserker|Warrior|Bodyguard|Paladin|Ranger|Monk|Shadowfist") {#var NmsBrute %concat(@NmsBrute,", ",%1)}
#if %ismember(%4, "Berserker|Warrior|Bodyguard|Paladin|Ranger|Monk|Shadowfist") {#var CntBrute (@CntBrute + 1)}
#if %ismember(%4, "Mage|Sorcerer|Wizard|Psionicist|Mindbender") {#var NmsFirePwr %concat(@NmsFirePwr,", ",%1)}
#if %ismember(%4, "Mage|Sorcerer|Wizard|Psionicist|Mindbender") {#var CntFirePwr (@CntFirePwr + 1)}
#if %ismember(%4, "Cleric|Priest|Druid") {#var NmsHealer %concat(@NmsHealer,", ",%1)}
#if %ismember(%4, "Cleric|Priest|Druid") {#var CntHealer (@CntHealer + 1)}
#var CntTotal (@CntTotal + 1)</value>
    </trigger>
    <trigger priority="450">
      <pattern>(%d)~|(%s)(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] *</pattern>
      <value>last %4</value>
    </trigger>
    <alias name="GroupRepto">
      <value>#prompt grouprepto "What channel do you want to report to? (gt, say or buddy)"
#if %ismember(@grouprepto, "chat|nchat|hero|lord|pray|auction|grtz|joke|ask|music|yell|shout|joke|esl|eslchat|quest|answer|ch|cha|nc|nch|ncha|her|lo|lor") {#say Invalid Channel. Sending to public channels is not permitted.}
#if %ismember(@grouprepto,"gt|say|buddy") {} {#say "You need to specify gt, say or buddy"}
#if %ismember(@grouprepto,"gt|say|buddy") {} {#exe grouprepto}
#if %ismember(@grouprepto,"gt|say|buddy") {} {#var grouprepto ""}</value>
    </alias>
    <trigger priority="630">
      <pattern>(%w)'s group:</pattern>
      <value>#var groupleader %1 _nodef GroupVars</value>
    </trigger>
    <var name="grouprepto" usedef="true">
      <value>GroupRepTo</value>
      <default>GroupRepTo</default>
    </var>
    <trigger priority="5820">
      <pattern>(%d)~|(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] *</pattern>
      <value>last %3</value>
    </trigger>
  </class>

  <alias name="groupclear">
    <value>#var NmsHitter "" _nodef GroupVars
#var CntHitter 0 _nodef GroupVars
#var NmsHealer "" _nodef GroupVars
#var CntHealer 0 _nodef GroupVars
#var NmsBrute "" _nodef GroupVars
#var CntBrute 0 _nodef GroupVars
#var NmsFirePwr "" _nodef GroupVars
#var CntFirePwr 0 _nodef GroupVars
#var CntTotal 0 _nodef GroupVars
#say "Group Counter Cleared"</value>
  </alias>
  <alias name="grouplist">
    <value>#class GroupReport 1
#exec GroupClear
#exec GroupRepto
group</value>
  </alias>
  <alias name="GroupReport">
    <value>%concat (@grouprepto," The group that ",@groupleader, " is leading has |br|"@cnttotal, " |n|total members: ")
#if (@CntHitter = 1) {%concat(@grouprepto," |br|",@CntHitter, " hitter: ",%delete(@NmsHitter,1,2))}
#if (@CntBrute = 1) {%concat(@grouprepto," |bb|",@CntBrute, " brute: ",%delete(@NmsBrute,1,2))}
#if (@CntFirepwr = 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flinger: ",%delete(@NmsFirepwr,1,2))}
#if (@CntHealer = 1) {%concat(@grouprepto," |by|",@CntHealer, " healer: ",%delete(@NmsHealer,1,2))}
#if (@CntHitter > 1) {%concat(@grouprepto," |br|",@CntHitter, " hitters: ",%delete(@NmsHitter,1,2))}
#if (@CntBrute > 1) {%concat(@grouprepto," |bb|",@CntBrute, " brutes: ",%delete(@NmsBrute,1,2))}
#if (@CntFirepwr > 1) {%concat(@grouprepto," |bg|",@CntFirepwr, " mana-flingers: ",%delete(@NmsFirepwr,1,2))}
#if (@CntHealer > 1) {%concat(@grouprepto," |by|",@CntHealer, " healers: ",%delete(@NmsHealer,1,2))}
#class GroupReport 0</value>
  </alias>


</cmud>



Usage:
Running the grouplist alias will add all members of your current group to lists. Also prompts you to input which channel you wish to output to.
The groupreport alias will output to your selected channel (say, gt or buddy).

The groupclear alias will clear the entire list.