Autocolour on Org Enemies

by Caedryn

Back to Mechanic's Corner.

Caedryn2006-11-10 11:39:33
CODE
#ALIAS orgen {#t+ Orgtrigs}
#ALIAS permaenemy {#trigger {%1} {#cw red} enemyclass}

#CLASS {Orgtrigs}
#TRIGGER {^Total:} {#t- Orgtrigs}
#TRIGGER {(%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w)} {#trigger {%1} {#cw red} enemyclass;#trigger {%2} {#cw red} enemyclass;#trigger {%3} {#cw red} enemyclass;#trigger {%4} {#cw red} enemyclass;#trigger {%5} {#cw red} enemyclass;#trigger {%6} {#cw red} enemyclass;#trigger {%7} {#cw red} enemyclass;#trigger {%8} {#cw red} enemyclass;#trigger {%9} {#cw red} enemyclass;#trigger {%10} {#cw red} enemyclass;#trigger {%11} {#cw red} enemyclass;#trigger {%12} {#cw red} enemyclass;#trigger {%13} {#cw red} enemyclass;#trigger {%14} {#cw red} enemyclass;#trigger {%15} {#cw red} enemyclass;#trigger {%16} {#cw red} enemyclass;#trigger {%17} {#cw red} enemyclass;#trigger {%18} {#cw red} enemyclass;#trigger {%19} {#cw red} enemyclass;#trigger {%20} {#cw red} enemyclass;#trigger {%21} {#cw red} enemyclass;#trigger {%22} {#cw red} enemyclass;#trigger {%23} {#cw red} enemyclass;#trigger {%24} {#cw red} enemyclass;#trigger {%25} {#cw red} enemyclass}

#TRIGGER {(%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w)} {#trigger {%1} {#cw red} enemyclass;#trigger {%2} {#cw red} enemyclass;#trigger {%3} {#cw red} enemyclass;#trigger {%4} {#cw red} enemyclass;#trigger {%5} {#cw red} enemyclass;#trigger {%6} {#cw red} enemyclass;#trigger {%7} {#cw red} enemyclass;#trigger {%8} {#cw red} enemyclass;#trigger {%9} {#cw red} enemyclass;#trigger {%10} {#cw red} enemyclass;#trigger {%11} {#cw red} enemyclass;#trigger {%12} {#cw red} enemyclass;#trigger {%13} {#cw red} enemyclass;#trigger {%14} {#cw red} enemyclass;#trigger {%15} {#cw red} enemyclass;#trigger {%16} {#cw red} enemyclass;#trigger {%17} {#cw red} enemyclass;#trigger {%18} {#cw red} enemyclass;#trigger {%19} {#cw red} enemyclass;#trigger {%20} {#cw red} enemyclass;#trigger {%21} {#cw red} enemyclass;#trigger {%22} {#cw red} enemyclass;#trigger {%23} {#cw red} enemyclass;#trigger {%24} {#cw red} enemyclass;#trigger {%25} {#cw red} enemyclass}

#TRIGGER {(%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w)} {#trigger {%1} {#cw red} enemyclass;#trigger {%2} {#cw red} enemyclass;#trigger {%3} {#cw red} enemyclass;#trigger {%4} {#cw red} enemyclass;#trigger {%5} {#cw red} enemyclass;#trigger {%6} {#cw red}  enemyclass;#trigger {%7} {#cw red} enemyclass;#trigger {%8} {#cw red} enemyclass;#trigger {%9} {#cw red} enemyclass;#trigger {%10} {#cw red} enemyclass;#trigger {%11} {#cw red} enemyclass;#trigger {%12} {#cw red} enemyclass;#trigger {%13} {#cw red} enemyclass;#trigger {%14} {#cw red} enemyclass;#trigger {%15} {#cw red} enemyclass;#trigger {%16} {#cw red} enemyclass;#trigger {%17} {#cw red} enemyclass;#trigger {%18} {#cw red} enemyclass;#trigger {%19} {#cw red} enemyclass;#trigger {%20} {#cw red} enemyclass;#trigger {%21} {#cw red}
enemyclass;#trigger {%22} {#cw red} enemyclass;#trigger {%23} {#cw red} enemyclass;#trigger {%24} {#cw red} enemyclass;#trigger {%25} {#cw red} enemyclass}

#TRIGGER {(%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w), (%w),} {#trigger {%1} {#cw red} enemyclass;#trigger {%2} {#cw red} enemyclass;#trigger {%3} {#cw red} enemyclass;#trigger {%4} {#cw red} enemyclass;#trigger {%5} {#cw red} enemyclass;#trigger {%6} {#cw red} enemyclass;#trigger {%7} {#cw red} enemyclass;#trigger {%8} {#cw red} enemyclass;#trigger {%9} {#cw red} enemyclass;#trigger {%10} {#cw red} enemyclass;#trigger {%11} {#cw red} enemyclass;#trigger {%12} {#cw red} enemyclass;#trigger {%13} {#cw red} enemyclass;#trigger {%14} {#cw red} enemyclass;#trigger {%15} {#cw red} enemyclass;#trigger {%16} {#cw red}
enemyclass;#trigger {%17} {#cw red} enemyclass;#trigger {%18} {#cw red} enemyclass;#trigger {%19} {#cw red} enemyclass;#trigger {%20} {#cw red} enemyclass;#trigger {%21} {#cw red} enemyclass;#trigger {%22} {#cw red} enemyclass;#trigger {%23} {#cw red} enemyclass;#trigger {%24} {#cw red} enemyclass;#trigger {%25} {#cw red} enemyclass;#trigger {%26} {#cw red}  enemyclass;#trigger {%27} {#cw red} enemyclass;#trigger {%28} {#cw red} enemyclass}

#CLASS 0


Where orgen activates the trigger generator, PERMAENEMY *name* manually adds the name to the list of red coloured names generated by the script (for some reason, it misses a few). This will bold the name of the individual whereever it appears.

Note - I have pagewrap at 190 characters, so roughly 20-24 names appear per line. This may be different for whoever tests this.

First question - any easy way to say to zMUD 'Take %1-%26, make a trigger colouring each separate variable red' without doing what I've done?
Unknown2006-11-10 11:57:01
Put all your enemies in a string list, and use a regex trigger that fires multiple times per line.

CODE
#VAR c_enemies {Jack|Jill}
#REGEX {\\b(?:@c_enemies)\\b} {#cw red}


Here's how I capture enemies of a city/commune:

CODE
#ALIAS communeenemies {#if (%null(%1)) {#T+ cec trigger} {#T- cec trigger};~communeenemies %-1}
#ALIAS cityenemies {#if (%null(%1)) {#T+ cec trigger} {#T- cec trigger};~cityenemies %-1}

#REGEX "cec" {^Enemies of .+? (?:Serenwilde|Magnagora|New Celest|Glomdoring)\\:$} {c_enemies = ""} "" {line=2|disable}
#COND {^(.+)$} {#if (%regex("%1", "\\d")) {#state cec 0;c_enemies = %subregex(@c_enemies, "+", "|")} {c_enemies = %concat(@c_enemies, "%1");#state cec 1}} {regex}