Difference between revisions of "CMud Group Breakdown"

From AvatarWiki
Jump to navigation Jump to search
m (Minor fix of code. Would have been bad.)
m (Formatting)
Line 99: Line 99:
  
 
'''Usage:'''<br>  
 
'''Usage:'''<br>  
grouplist will add all members of your current group to lists. Also prompts you to input which channel you wish to output to.<br>
+
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.<br>
groupreport will output to your selected channel (say, gt or buddy).<br>
+
The '''groupreport''' alias will output to your selected channel (say, gt or buddy).<br>
groupclear will clear the entire list.<p>
+
The '''groupclear''' alias will clear the entire list.<p>
 
[[Category: Cmud Scripting]]
 
[[Category: Cmud Scripting]]

Revision as of 19:58, 25 April 2010

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

<?xml version="1.0" encoding="ISO-8859-1" ?>
<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 > 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>
  <var name="grouprepto" usedef="true">
    <value>gt</value>
    <default>GroupRepTo</default>
  </var>
  <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">1</var>
      <var name="groupleader">Kenjin</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)~|(%d) [Hero|Lord] (%w) (*)  [Stand|Rest|Sleep|Fighting] </pattern>
      <value>last %3</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>
  </class>
  <alias name="grouplist">
    <value>#class GroupReport 1
#exec GroupClear
#exec GroupRepto
group</value>
  </alias>
</module>
</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.