Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="iso-8859-1"?>
- <!DOCTYPE muclient>
- <!-- Thanks to Garrion, Nick Gammon, Ian Kirker and Trevize for the parts that make this plugin -->
- <muclient>
- <plugin
- name="Sidebar"
- author="Kyr"
- id="bff25308e015986fb1a56e9d"
- language="Lua"
- purpose="Map, xp counter, group status, and status bars"
- date_written="2011-04-18"
- save_state="y"
- requires="4.43"
- version="0.14"
- >
- </plugin>
- <triggers>
- -- Matches on combat monitor (NOT score brief now)
- -- old: "^(?:> |)Hp: (\d+) ?\((\d+)\) +(?:Gp: (\d+) ?\((\d+)\)) +(?:Xp: (?!662781)(\d+))(?: Burden: (\d+)\%|)$"
- <trigger
- enabled="y"
- ignore_case="y"
- keep_evaluating="y"
- match="^(?:> |)Hp: (\d+) ?\((\d+)\) (?:Gp: (\d+) ?\((\d+)\)) +(?:Xp: (?!662781)(\d+))$"
- regexp="y"
- send_to="12"
- sequence="3"
- variable="test"
- >
- <send> OnHealthTrigger(%1,%2,%3,%4,%5)</send>
- </trigger>
- -- Trigger to stop the map from matching on informs
- -- DO NOT keep evaluting...
- <trigger
- enabled="y"
- ignore_case="y"
- match="^(?:> |)\[(.*?)(\:|specialized|birthday|Discworld|achievement|first time|killed by|gains a level|Cpu|Machine|Reclaimed|Cleaning|joined the|now worshipping|now a member of)(.*?)\]$"
- name="Informs"
- regexp="y"
- sequence="2"
- >
- </trigger>
- -- Map triggers
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)\[(.*)\]$"
- regexp="y"
- script="map_redirect"
- omit_from_output="y"
- name="map_start"
- sequence="100"
- >
- </trigger>
- -- Do not keep evaluting
- <trigger
- enabled="n"
- match="*"
- script="map_redirect"
- name="multi_line_map"
- omit_from_output="y"
- sequence="10"
- >
- </trigger>
- -- Possibly change to keep evaluting?
- <trigger
- enabled="n"
- match="^(((\'|\")[A-Z])|[A-Z])([a-z]|\s)"
- regexp="y"
- script="map_redirect"
- omit_from_output="n"
- name="map_end"
- sequence="5"
- >
- </trigger>
- -- Combat triggers
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*)(kicks you|boots you|slaps you|launches a powerful attack.*you(?!.*absorbs all)|bruises you|taps you|wriggles through .*you|suffocating you|slithers painfully .*you|decimating you|pulls you|takes a sliver off you|strikes you (lightly |hard |)in the|hits you (hard |)in the|stabs you|stabs .*right through you|stabs .*tusks deeply .*you|smashes .*you|manages to slice you|slices (?!at).*you|skewers you|shreds you|scratches you|runs you|pierces you|pricks you|perforates you|snicks you|nicks you|neatly fillets you|mashes you|makes a kebab of you|jabs .*you|impales you|hacks (into |)you|cuts you|crushes (its.*|)you|attempts to chop you|chops .*you|toasts you|crisps you|singes you|scorches you|fries you|roasts you|melts you|chars you|burns you|incinerates you|cremates you|vapourises you|bludgeons you|bashes you|pokes you in the|prods you in the|prods your .* with its|tickles you in the|knocks your .*with|beats you|batters you|ventilates you|spikes you|makes a mess of you|sends you reeling|butts you|rams you|gores you|claws you|chews on you|munches on you|gashes you|rips flesh off you|tears deeply into you|rips you|rends huge chunks of flesh from you|pecks you|gouges a hole in you|nips you in the|nibbles at you|bites you in the|sinks its teeth .*into you|bites .*into you)(r |\W).*$"
- script="hitcount"
- regexp="y"
- sequence="98"
- name="combathit"
- custom_colour="17"
- other_text_colour="goldenrod"
- >
- </trigger>
- -- ME ATTACK COLOURING
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? ((poke|tap) .* in the|(barely stab|attempt to chop|snick|barely hit|toast|just manage to slice) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme1"
- custom_colour="17"
- other_text_colour="#DDFFDD"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? (tickle .* in the|slice .* across|jab .* into|scorch|(stab(?!.*deeply)(?!.*right through)|scratch|hit(?!.* hard)(?!.*with a(n uppercut| cross| vicious hook))|prick) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme2"
- custom_colour="17"
- other_text_colour="#BBFFBB"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? ((?!viciously )kick (?!.*into)(?!.*hard).* in the|jab(?!.*into) .* in the|crisp|(messily stab|nick|shred|chop(?!.*into pieces)|spike|bruise) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme3"
- custom_colour="17"
- other_text_colour="#99FF99"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? (viciously boot .* in the|claw|hit.*with an uppercut|singe|(stab .* deeply|cut(?! .*into (?!small).*pieces)(?! .*in half)) .* with|hit .* hard in the .* with|impale .* on|chop (?!.*deeply).* into (?!pieces)|slice (?!.*deeply).* into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme4"
- custom_colour="17"
- other_text_colour="#77FF77"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? (hit.*with a cross|(perforate|slice .* deeply|(fry|roast)|ventilate|skewer|hack .* into|take a sliver off|slice(?! at)|smash) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme5"
- custom_colour="17"
- other_text_colour="#55FF55"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? (viciously kick|hit .*with a vicious hook|(melt(?! into)|char|burn)|(pierce|hack(?!.*into)|crush|run .* through) .* with|chop .* deeply into|slice .*deeply into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme6"
- custom_colour="17"
- other_text_colour="#33FF33"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You( launch a powerful attack\. You)? (kick .* into a bloody mess|beat .*to a pulp|(cremate|incinerate|vapourise)|chop .* into pieces with|(mash|neatly fillet|make a kebab of|make a mess of|chop up) .* with|stab .* right through)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourme7"
- custom_colour="17"
- other_text_colour="#11FF11"
- >
- </trigger>
- -- HITS ON ME COLOURING
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(swings .* at you|smokes you|kicks out at you|punches at you|(slices at|slashes at|strikes at|thrusts at) you with)(?!.*all of the blow)(?!.*somehow avoid the atttack)(?!.*but you .*dodge)(?!.*but you .*parry)(?!but you .*block)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad0"
- custom_colour="17"
- other_text_colour="#FFFFFF"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*((pokes|taps) you in the|toasts you|(barely stabs|attempts to chop|snicks|barely hits|just manages to slice) your?.* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad1"
- custom_colour="17"
- other_text_colour="#FFEDCB"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(tickles you in the|slices you across|jabs .* into your|(gently )?scorches you|(stabs(?!.*deeply)(?!.*right through)|scratches|hits(?!.* hard)(?!.*with a(n uppercut| cross| vicious hook))|pricks) your?.* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad2"
- custom_colour="17"
- other_text_colour="#FFE3B0"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*((?!viciously )kicks (?!.*into)(?!.*hard)you in the|slaps you|crisps you|jabs(?! her finger)(?!.*into) you in the|(messily stabs|nicks|shreds|chops(?!.*into pieces)|spikes|bruises) your?.* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad3"
- custom_colour="17"
- other_text_colour="#FFDA96"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(viciously boots you in the|claws your|hits you .* with an uppercut|singes you|(stabs you deeply|cuts your) .* with|hits you hard in the .* with|impales your on|chops (?!.*deeply).* into(?!pieces) your|slices (?!.*deeply).* into your)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad4"
- custom_colour="17"
- other_text_colour="#FFD07B"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(hits you .* with a cross|(fries|roasts) you|(perforates|slices .* deeply|ventilates|skewers|hacks .* into|takes a sliver off|slices(?! at)|smashes) your?.* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad5"
- custom_colour="17"
- other_text_colour="#FFC761)"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(viciously kicks you|hits you .*with a vicious hook|((painfully )?burns|chars|melts) you|(pierces|hacks(?!.*into)|crushes|runs) your?.* with|chops .* deeply into your|slices .*deeply into your)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad6"
- custom_colour="17"
- other_text_colour="#FFBD46"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?.*(kicks your .* into a bloody mess|beats your .*to a pulp|chops your .* into pieces with|(cremates|vapourises|incinerates) you|(mashes|neatly fillets|makes a kebab of|makes a mess of|chops up) your?.* with|stabs .* right through your)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="99"
- name="hitcolourmebad7"
- custom_colour="17"
- other_text_colour="#FFAA11"
- >
- </trigger>
- -- OTHER ATTACK COLOURING
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) ((pokes|taps) .* in the|(barely stabs|attempts to chop|snicks|toasts|barely hits|just manages to slice) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother1"
- custom_colour="17"
- other_text_colour="#DDFFDD"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) (tickles .* in the|(gently )?scorches|slices .* across|jabs .* into|(stabs(?!.*deeply)(?!.*right through)|scratches|hits(?!.* hard)(?!.*with a(n uppercut| cross| vicious hook))|pricks) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother2"
- custom_colour="17"
- other_text_colour="#BBFFBB"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) ((?!viciously )kicks (?!.*into)(?!.*hard).* in the|crisps|jabs(?! her finger)(?!.*into) .* in the|(messily stabs|nicks|shreds|chops(?!.*into pieces)|spikes|bruises) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother3"
- custom_colour="17"
- other_text_colour="#99FF99"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) (viciously boots .* in the|claws|hits.*with an uppercut|singes|(stabs .* deeply|cuts(?! .*into (?!small).*pieces)(?! .*in half)) .* with|hits .* hard in the .* with|impales .* on|chops (?!.*deeply).* into (?!pieces)|slices (?!.*deeply).* into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother4"
- custom_colour="17"
- other_text_colour="#77FF77"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) (hits.*with a cross|(perforates|slices .* deeply|(roasts|fries)|ventilates|skewers|hacks .* into|takes a sliver off|slices(?! at)|smashes) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother5"
- custom_colour="17"
- other_text_colour="#55FF55"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) (viciously kicks|hits .*with a vicious hook|((painfully )?burns|chars|melts(?! into))|(pierces|hacks(?!.*into)|crushes|runs .* through) .* with|chops .* deeply into|slices .*deeply into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother6"
- custom_colour="17"
- other_text_colour="#33FF33"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])(.* launches a powerful attack\. .*|[^\.]*) (kicks .* into a bloody mess|beats .*to a pulp|(cremates|vapourises|incinerates)|chops .* into pieces with|(mashes|neatly fillets|makes a kebab of|makes a mess of|chops up) .* with|stabs .* right through)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="80"
- name="hitcolourother7"
- custom_colour="17"
- other_text_colour="#11FF11"
- >
- </trigger>
- -- BAD ATTACK COLOURING
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*((pokes|taps) .* in the|toasts|(barely stabs|attempts to chop|snicks|barely hits|just manages to slice) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad1"
- custom_colour="17"
- other_text_colour="#FFDDDD"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*(tickles .* in the|slices .* across|jabs .* into|(gently )?scorches|(stabs(?!.*deeply)(?!.*right through)|scratches|hits(?!.* hard)(?!.*with a(n uppercut| cross| vicious hook))|pricks) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad2"
- custom_colour="17"
- other_text_colour="#FFBBBB"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?!\w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*((?!viciously )kicks (?!.*into)(?!.*hard).* in the|crisps|jabs(?! her finger)(?!.*into) .* in the|(messily stabs|nicks|shreds|chops(?!.*into pieces)|spikes|bruises) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad3"
- custom_colour="17"
- other_text_colour="#FF9999"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*(viciously boots .* in the|claws|hits.*with an uppercut|singes|(stabs .* deeply|cuts) .* with|hits .* hard in the .* with|impales .* on|chops (?!.*deeply).* into(?!pieces)|slices (?!.*deeply).* into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad4"
- custom_colour="17"
- other_text_colour="#FF7777"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*(hits.*with a cross|(fries|roasts)|(perforates|slices .* deeply|ventilates|skewers|hacks .* into|takes a sliver off|slices(?! at)|smashes) .* with)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad5"
- custom_colour="17"
- other_text_colour="#FF5555"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*(viciously kicks|hits .*with a vicious hook|((painfully )?burns|chars|melts(?! into))|(pierces|hacks(?!.*into)|crushes|runs .* through) .* with|chops .* deeply into|slices .*deeply into)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad6"
- custom_colour="17"
- other_text_colour="#FF3333"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?![\[\( ])([^\.\,]*, |.*launches a powerful attack\. )?((O|o)ne of the|(T|t)he(?! fire)(?! \w* ?Ramtop wolfhound)|Kess|Hin-Lop-Heds|Kang Wu|Hlakket|Delbert|Gumboni|Harvard|Carrot|Angua|Detritus|Boy Willie|Truckle|Old Vincent|Mad Hamish|Hrun|Bravd|Paulie|Stevie|Frankie|Marlon|Geraldo|Charles|Joe|John|Louis|Enrico|Samuel|Sergeant|Captain|Prodo|Mr Pin|Mr Tulip|Mr.|Constable|Lance-Constable|Francis|Fujiyama|Freda|Diego|Rixacardo|Septa|Ilik|Sokkard|Ned|Jack|Laggy|71)(-| ).*(kicks .* into a bloody mess|beats .*to a pulp|(cremates|vapourises|incinerates)|chops .* into pieces with|(mashes|neatly fillets|makes a kebab of|makes a mess of|chops up) .* with|stabs .* right through)(?!.*all of the blow)([^\.]*\.|.* no\. [0-9]* throwing kni.*)$"
- keep_evaluating="y"
- regexp="y"
- sequence="81"
- name="hitcolourbad7"
- custom_colour="17"
- other_text_colour="#FF1111"
- >
- </trigger>
- <trigger
- enabled="y"
- ignore_case="y"
- keep_evaluating="y"
- match="^(?:> |)(?![\[\(]).*(but you .*block|but you .*dodge|but you .*block|but you .*parry|but your .*absorbs all.*blow|you somehow avoid the attack|avoids the attack|blocks the blow|dodges out of the way|parries the blow|but (his|her) .*absorbs all.*blow).*$"
- name="combatspam"
- custom_colour="17"
- other_text_colour="#303030"
- regexp="y"
- sequence="90"
- >
- </trigger>
- <trigger
- enabled="n"
- ignore_case="y"
- keep_evaluating="y"
- match="^(?:> |)You attempt to launch a powerful attack.*$"
- name="specialcolour"
- custom_colour="17"
- other_text_colour="#B1425C"
- regexp="y"
- sequence="91"
- >
- </trigger>
- -- Command / people spam
- <trigger
- enabled="n"
- ignore_case="n"
- match="^(?!(?:> |)[\(\[])(?!.*(asks?|tells?|exclaims?|says?(?!ing)|whispers?|yells?|shouts?).*:).*(starts to study |stops studying |(You get|\w+\)? gets) .* from |(You put|\w+\)? puts) .* in(to)? |(You wear|\w+\)? wears) |You are not wearing |plants? .* on |draws? .* from .* into |offers? to give| gives? .* to .* fruitbat|palms? .* from |slips? .* to |You notice .* emerging from hiding|Queued command: |holds? .* in (his|her|your) | waits\.|does something complicated \(and wrong, and painful\)|snaps (his|her) wrist elegantly, unfolding .* with a sound of sliding silk|quietly folds the .* fan with a slight rasping sound of steel and silk| chips a piece off .* with|suddenly steps out of the foreground next to you| looks closely at|(You remove|\w+\)? removes) |sheathes? .* in | recites a prayer|says a quick prayer| says a slow prayer\.| points at ((him|her)self|.*(pebble|fluff|beads))| mutters under (his|her) breath, shaking| tidies up the place, clearing away| studies| squints? critically at|(You close|\w+\)? closes) |(You open|\w+\)? opens) | (close|open) .*, managing to stay unnoticed|You notice .* struggling to (open|close) .* covertly|You will now attempt to move stealthily|You continue sneaking|You stop sneaking| vanishes in a puff of smoke, to be magically replaced by|You prepare to throw your .* at|You throw your .* at|dodges out of .* path|(quickly|swiftly) swoops in and blocks| bounces off .* skin\.|flies out of the shadows and strikes the .* cleanly in the throat|Fortunately for all concerned, that was a rubber weapon|flies directly towards .*At the last moment, s?he twists out of harm's way|You search for a suitable spot and hide|You feel more able to remain visible, try again|You suddenly realise .* has been standing here all along|You come out of your hiding place| comes out of hiding|Hp: .*\) Gp: .*|starts to fiddle with the lock on|stops fiddling with the lock on|Changed alias .* from| drops? | looks (less )?vigilant\.| stares at the ground as if in deep thought| plods around uncertainly, looking in every direction|smiles uncertainly and glances sideways, scuffing at the ground in indecision|You notice .* nearby|IDLEWAIT|IDLENOTHING| looks around(?!.* Believe)|The octogram flickers and disappears| consults? |You re-evaluate your position on the map|You cannot find yourself on| equips? |An octogram begins to glow on the floor|The octogram pulses for a moment\.|discreetly looks you up and down, carefully checking out your weapons and armour|You notice .* looking at you very intently| peers? carefully at | peers? appraisingly at|You stare intently at .* detecting that .* aura|You conclude that you are|You step out of the foreground|You stand very, very still and slowly fade into the foreground|moves .* in a complex pattern|stops moving .* about and concentrates| starts? to search around| searches around the place a bit| stops searching|You scrounge around\.| adds the last stitch to| carefully unpicks the threads of embroidery| (un)?(wraps|folds) .* (furoshiki cloth|wrapped present)| threads .* with| starts to embroider| points .*aumo.* at | throws .* at|doesn't appear to be tempted by|draws a deep breath| wheezes| drinks? .* from |You surreptitiously emerge from your hiding place|stares into (his|her)|scries something with (his|her)| rubs the crystal ball|You don't have the energy to| puts down |starts to read .* aloud| starts to work on | stops working on | fires .* at the handsome sheep shearer|You put down .* from your|utters a lengthy prayer over the corpse|speaks a prayer to .* without a trace| serenades? .* (with .* on |on .* with )| is already tuned| tunes? (his|her|your)| after it becomes obvious that it needs to be tuned|(B|b)lowing .* plays? an? |(P|p)lucking .* creates? an? |plucks? .* strings| blows? into | as s?he plays it| performs? (a|an) .* on | plays? ((his|her)|.* on) | strums? .* on | slowly and quietly draws? .* from| fills? .* from | pours? .* into | empties | drinks .* with a look of mixed pleasure and regret| flexes (his|her) fingers over| waves (his|her) hands vigorously over .* before delving deep in|\.\.\.absolutely nothing!|stares with dismay at (his|her) fingers|\.\.\.a.* handkerchief| proceeds to mop (his|her) brow with the hankie|\.\.\.the flags of all nations|runs around for a while trailing the flags behind (him|her)| ties the .* in a .* style| unties the | writes on .* with a | hefts? .* to see how much it weighs| fails? to hold |(You read|\w+\)? reads) |Your eyes prickle for a moment|You feel a mild twinge behind your eyes|You feel a headache coming on|You feel dizzy for a moment, but it passes|You wrestle .* into submission and squeeze it into the crystal| stares intently at |You wrestle with .*trying to squeeze it into the crystal, but your lack of skill|(You conceal|\w+\)? conceals) | is no longer concealed|You find a suitable place to hide and lay an ambush| prostrates (him|her)self and shouts praise to| puts? the evil eye on| looks? determined to try harder|You forget about the watchful gaze of old crones| starts to engrave .* on .* with | sets down (his|her) engraving tool| starts working once more on the| finishes engraving .* on |(It seems|You find it) .* (easier|harder|difficult) to perform .*|You feel a mild twinge in one knee|You feel old and weary|You feel a momentary itch at the back of your neck|For a moment you feel like skipping, but it passes|You look closely at |(You guess that |The ).* is .* at stopping (blunt|sharp|pierce) attacks|The .* protects your |You think that .* is an? .*, but you're not sure| creates an? .* sound on (his|her) |You chip a piece off .* with |You tidy up the place, clearing away).*$"
- keep_evaluating="y"
- name="idlespam"
- omit_from_output="n"
- custom_colour="17"
- other_text_colour="#204020"
- regexp="y"
- sequence="90"
- >
- </trigger>
- -- Item / jewellery / pet spam
- <trigger
- enabled="n"
- ignore_case="n"
- match="^(?!(?:> |)[\(\[])(?!.*(asks?|tells?|exclaims?|says?|whispers?|yells?|shouts?).*:).*(twists the clockwork band around (his|her) finger| changes colour\!| fades to |The clockwork band flashes in all the colours of the rainbow|(Your .*|spider) grins silently|quietly goes about spinning a web\.|meticulously cleans its silk glands|sniffs haughtily and stares down its nose at you|You could('ve| have) sworn that| glances around with a smug expression|and taunts it mercilessly before flying off in search|scuttles back and forth a bit| wiggles about\.|cleans its poison glands|cleans its legs, one by one by one by one| gnashes its mandibles audibly| grins, displaying oversized mandibles| looks slightly dizzy\.|A fly catches sight of .* and (faints|flees)| scratches (his|her) belly|fruitbat squeaks happily|flaps (his|her) wings|fruitbat nudges |fruitbat gives |fruitbat flaps in\.|A dismal shrieking emerges from|A screaming noise comes from|A terrible screeching emanates from|A loud wailing issues from|A glittering sprinkle of light scatters about the (area|room) from| (necklace|ring|earrings) (glitters|glimmers|flickers)|Light flashes from the delicate facets of .* (earrings|necklace)|Scattered light dances from|The flames on .* seem to dance|'.* ring (glimmers|shimmers|pulses warmly|glows warmly)\.|(moon dragon'?s?|Ramtop wolfhounds?|astonished chickens?|deadly fluffy hawks?) (?!.*standing here)|The small blue light (sparkles|zips|pesters|spins around|peeps|fidgets|blows a bubble|twinkles|distracts|crumples to dust)|An old lady engages a warrior in conversation over a cup of tea|Some coffee drips down the wall|Some tea drips from the ceiling|A warrior eyes the menu before leaving in disgust|A warrior attempts to quaff a cup of coffee|Tzere tosses his hair about|Tzere flexes his muscles|The air is tinged with the smell of coffee, with a hint of stale beer|The .* cat (looks up|attacks|flops|shuns|snaps|pounces|ignores?|stalks|smiles|drapes|lolls|sits?|hisses?|bounces?|lies down|slips quietly|nuzzles?|purrs?|struts?|sneers?|looks? not scared at all|meows?|pats at|tugs on|wanders|dances|saunters|suddenly looks at|stretches|yawns|stares?|worries about|cowers? in a corner|rubs|rolls|seems to vanish)| scorpion (frowns|squirms|shuffles|prods you|wiggles|waggles|paces|stomps|watches|peers|stares|waves|ponders)|A garlicky smell wafts out as you exhale|Your breath seems fresher|The strong smell of garlic|The air around .* seems fresher somehow|stares wide-eyed at something that isn't there|The smell of sprouts and cabbages from .* wafts over you and you find yourself thinking of school dinners|butterfly (flies into the air and|flitters about mischievously|flaps its wings|ponders|peers|waggles|wiggles)|butterfly flutters (about|into the air) for a moment|butterfly gives you gentle butterfly kisses| stares at everything, hoping to spot a flower|((Y|y)our|'s) My Little Binky|A bee buzzes about .* intently|A sweet scent (wafts|creeps about) from |glistens with dew, resembling crystal tears|The satiny petals of .* just beg to be stroked lovingly|A bee crawls out from .* looking quite happy| rustles softly as a bee tries to enter it|beetle (ponders thoughtfully|wanders around)|You notice several raindrops falling from the .* cloud|There is a quiet sound of distant thunder, and a small bolt of lightning strikes the ground under .*cloud|caterpillar (rears|cocks|does a little dance|waggles|tromps|wriggles|humps)|The .* cloud swirls and swirls and swirls some more|You think you noticed two small blue eyes inside the cloud, but you are not sure|The swirling cloud reminds you of someone called Misty|alligator (winks|sneezes|waves (his|her) .* tail around)|locust (stares|waggles|twitches|wiggles|twitters|ponders|munches|chitters|eyes|flies|peers|chirps|nibbles)|guano crumble to dust).*$"
- keep_evaluating="y"
- name="idlespam2"
- omit_from_output="n"
- custom_colour="17"
- other_text_colour="#202040"
- regexp="y"
- sequence="89"
- >
- </trigger>
- -- Magic / ritual spam
- <trigger
- enabled="n"
- ignore_case="n"
- match="^(?!(?:> |)[\(\[])(?!.*(asks?|tells?|exclaims?|says?|whispers?|yells?|shouts?).*:).*(closes (his|her) eyes and (smiles dreamily|looks long and hard)| utters a prayer\.| calls upon |burning desires, in the form of two tiny red imps|You tune out the noises (surrounding|around) you and focus|You prepare to cast |You fix your gaze on a particularly solid looking bit of air|The air distortion yelps in pain and trembles|As the distortion disappears, the air around you undistorts|You stare at the space in front of you until your vision blurs|You feel protected from prying eyes|You feel less protected from prying eyes|The air distortion buggers off, but|The imps fall silent under the weight|The two imps shrug, climb down|momentarily takes on a happier disposition|opens (his|her) eyes and stares hungrily at the space between (his|her) arms|rubs (his|her).* tummy and licks (his|her) lips|holds .* up and swirls it around slowly| shoos .* away|A tiny .* moth flutters into the area and flits towards|whistles an eerie tune into the wind which seems to carry on for miles|The .* vanishes in a gout of .* flame|You twitch your tail enchantingly|The motion of your tail calms and soothes enraptured onlookers|tail twitches and wavers enchantingly|You feel a sense of inner peace and harmony| reaches down and seems to scoop up something you can't see| snarls something your ears refuse to take in| flicks what looks like a large ball of black snot at| flaps (his|her) hand around |A blob of black slime writhes for a moment on the surface of| stares vaguely into space| peers vaguely around| looks up and then down|murmurs quietly to the|You listen intently, but fail to overhear|You hastily release the spell|begins to wobble slightly from side to side|stands dead still for a bit, looking blank|spins around slowly and curls up on the floor|looks slightly confused as to how s?he ended up carrying a small stick|waves (his|her) hands over| gazes into |groans in effort\.|sniffs the air (carefully|gently)|looks pensive\.|stares into .* apparently trying to fix (his|her) hair|huffs and puffs\.|feather crumbles into dust\.|drools a little( bit)?\.|squints menacingly\.|The wobbles become more violent| wrestles with a gooey black mess| projects an image of .* above (his|her) head|The rubbery creation flies into| tosses something into the centre of the octogram|The octogram flares in a bright .* for a few seconds| plucks a feather from | seems to spend some time talking to (him|her)self while kneeling| gazes off into the distance\.| holds (his|her) hand up and waves it (about|around)|A small blue light darts into the area|The bubble around .* flickers slightly|quickly reaches out and pulls back |The air around .* shudders and flashes grey| clenches .* in (his|her) fist\.| slowly closes (his|her) fist| with a point in space somewhere |The hail pelting .* fades away| mouths something silently| spends a short time in silence| stares off into the distance, seeing something other than (his|her) surroundings| sings a short hymn| holds (his|her) .* up in front of (his|her) face| spends a moment in thought with his head bowed|The air around .* fills with a sudden shower of hail|The mist around .* blows away|The air around .* turns to a thick fog| peers intently at | massages it gently with her fingertips| nods gravely at it, as if answering unspoken questions| takes a very deep breath| shouts loudly at herself|The air pressure suddenly sinks| tilts her head to one side|A pair of tiny red imps complete with horns and pitchforks| throws back her head and cackles with glee| eyes glaze over and start to water| jabs her finger in the air|The air in front of .* shimmers and distorts|The air stops shimmering and becomes unnaturally clear| says a prayer over (him|her)self| speaks a sibilant prayer| mutters a few quick syllables|A wave of water appears out of thin air and splashes| gets down on (his|her) knees and looks pious| stands up, lifting (his|her) hands in the air|The water coating | cheeps at .* like a cute fluffy chick| falls flat on (his|her) face and spends some time talking to the ground|You shoo the .* moth away|Magical, mystical forms appear in your mind|Grasping the glowing glass nugget, you hold it above you|You whistle into the wind a calm and peaceful tune|You mark out the vertices of an octogram|You (begin to trace|finish tracing) the octogram|You close your eyes and contemplate the idea of food|You think about a nice big dinner|You open your eyes and spread your arms|You end up with .* in your arms|With a dry sucking noise, a lump of .* fluff|You cast your spirit out over the land|You send out the promise of a bowl of jam|You concentrate firmly on .* jam|You cannot summon any fireflies if you are inside|You lose interest in| thoughts seem to be elsewhere| enters a deep trance| wakes up| concentrates for a moment| begins to peer with great concentration at a | stops staring at a |thoughtfully chews (his|her) cheek| holds (his|her) hand out in front of (him|her)self and stares intently| hand shudders and goes a slight green colour|A cabbage suddenly appear sfrom nowhere|It looks adoringly at|The cabbage follows | eats the cabbage|briefly bows (his|her) head and mutters something| appears to enter a trance|clasps .* tightly in .* hand before raising (his|her) hands|looks apprehensive for a moment, and then slashes | takes .* in (his|her) bloodied hand| continues to bleed profusely| manages to stop the flow of blood from (his|her) body| chants in a soft soothing voice| speaks what sounds like a prayer softly| glows with a soft light, which slowly transfers onto| scratches (his|her) ear anxiously| looks as if s?he needs to go to the toilet| practises the latest break-dance manoeuvre|It seems as if .* is about to pass out|There is a sucking noise and a small, blue object falls onto| chants a psalm\.|fluff flashes brightly and gives rise to a dust bunny|The dust bunny crumbles into dust| tells the dust bunny to leave|mutters something softly\.|chants in a loud voice| glances quickly at |You stare at your |You recite the words of (warming|cooling)|A thick, warm mist billows up around you|The mist surrounding you blows away in a gust of wind|You utter a prayer|You call upon .* to fill .* with holy radiance|You glow brighter for a moment|You speak a short prayer|You call upon .* to protect |You kneel and spread your arms in benediction|You pray for the Apostles' Vision|Loudly now, you chant the names of |You humbly request the power to read|Your vision blurs as thousands of letters, glyphs and symbols dance|You recite the psalm of acquisition|You speak the prayer of divination|You silently pray to .* to send you divine insight|You humbly beseech .* to enlighten you|Your sense of balance feels momentarily disturbed|You understand that .* pool of available belief|In your mind, you watch the symbol for .* float past|Thoughts of communication fill your soul|Abstract lingual constructs float through your mind|The letters fade away, leaving you feeling somewhat disoriented|You feel healing energy surge through you|You dim slightly|You concentrate very hard on the nature of fluff|You ask .* to grant you fluff|Your prayers are answered, and you find yourself blessed with the gift of|You cut the .* fluff into .* with your |You chant quietly, clutching the .* in your hands|You sense that the .* is no longer waiting for your attention|You point at a |with interest, waiting for you to bestow a ritual|You place your hands together and close your eyes|You utter a quick prayer to|You feel the warmth of .* flow over you, reducing your wounds|The .* has not been prepared for a ward).*$"
- keep_evaluating="y"
- name="idlespam3"
- omit_from_output="n"
- custom_colour="17"
- other_text_colour="#402020"
- regexp="y"
- sequence="89"
- >
- </trigger>
- -- Spoken spam
- <trigger
- enabled="n"
- ignore_case="n"
- match="^(?!(?:> |)[\(\[]).*( says?: Buggeroff, you lot| exclaims?: And tell all your friends|Tzere says.* Best coffee in whole of hall|(Tzere|Someone) asks.* Duh, you like tea|(Tzere|Someone) exclaims.* Ugh!|You say: Right, push off, you rhummy little blighters|(Tzere|Someone) says.* My buns are tasty|To the south, Dogbottler yells: My bottled dog has no nose!|((T|One of t)he|Two) handsome sheep shearers? asks?|You say: Go bother someone else, you pesky little buggers| applesh?(, and sh?kinny besh?idesh?)?\. (Lawksh?\. )?Prr?ay take and eat one, dearr?ie|You call (yourself|yerr?sh?elf) a talish?man, (you sh?illy|eh\?)|You lot call that watchin'\?).*$"
- keep_evaluating="y"
- name="idlespam4"
- omit_from_output="n"
- custom_colour="17"
- other_text_colour="#204040"
- regexp="y"
- sequence="90"
- >
- </trigger>
- -- Custom spam reduction bits
- <trigger
- enabled="n"
- ignore_case="n"
- match="^(?:> |)(.*Asaram bings happily\.|\[.*You call yerself a talisman, eh\? .*\]|\[.*You call that watching\? .*\]|\[Pommes: You call that (bashing|stabbing|parrying|striking|slicing).*\]|\[Nefret: You call that (parrying|slicing|stabbing|dodging).*\]|.*Baralai hirashi exclaims .* turned out nice aint .*damn!|Niexa exclaims .*: The quick brown werewolf jumped over the lazy womble.*)$"
- keep_evaluating="y"
- name="idlespam5"
- omit_from_output="n"
- custom_colour="17"
- other_text_colour="#402040"
- regexp="y"
- sequence="1"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="*but you*block*"
- regexp="n"
- omit_from_output="n"
- script="blockcount"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?P<player>.*?) dealt the death blow to .*\.$"
- script="player_kill"
- name="otherkill"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?P<player>You) killed .*\.$"
- script="player_kill"
- name="mekill"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="*but you*dodge*"
- regexp="n"
- omit_from_output="n"
- script="dodgecount"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="*but you*parry*"
- regexp="n"
- omit_from_output="n"
- script="parrycount"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="*but your*absorbs all*blow*"
- regexp="n"
- omit_from_output="n"
- script="armourcount"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- ignore_case="n"
- match="^(?:> |)(You rake|You tickle .*in the|You claw|You kick|You boot|You punch|You viciously|You poke .* in the|You barely hit|You barely stab|You ventilate|You make a mess of|You chop|You cut(?! .*into (?!small).*pieces)(?! .*in half)|You hack|You impale|You jab|You make a kebab|You messily|You nick|You perforate|You pierce|You run .* through|You scratch|You skewer|You prick|You (just manage to |)slice|You snick|You take a sliver|You neatly fillet|You stab|You shred|You hit|You bruise|You smash|You crush|You mash|You tap|You bash|You beat|You knock|You strike|You batter|You bludgeon|You spike|You toast|You gently scorch|You singe|You scorch|You sear|You crisp|You fry|You char|You roast|You burn|You painfully burn|You cremate|You incinerate|You vaporise) .*$"
- script="successfulhit"
- regexp="y"
- sequence="100"
- >
- </trigger>
- -- do not continue evaluating - override the successfulhit trigger
- <trigger
- enabled="y"
- ignore_case="y"
- match="you (.*)(avoids the attack|blocks the blow|dodges out of the way|parries the blow|but (his|her) .*absorbs all.*blow)(.*)"
- script="missedhit"
- regexp="y"
- sequence="99"
- >
- </trigger>
- <trigger
- enabled="y"
- ignore_case="y"
- keep_evaluating="y"
- match="(You attempt to launch a powerful attack\.(.*)|sneak around.*prepare (the|to) backstab.*)"
- script="missedspecial"
- regexp="y"
- sequence="99"
- >
- </trigger>
- <trigger
- enabled="y"
- ignore_case="y"
- keep_evaluating="y"
- match="(You launch a powerful attack\.(.*)|You .*sneak around.* without being spotted and manage.*|You hold your cover .*sneak around.* and manage.*)"
- script="successfulspecial"
- regexp="y"
- sequence="99"
- >
- </trigger>
- ------------------------------------------------------------------------------------
- -- Group Status Triggers -----------------------------------------------------------
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?: |)(?!(\[|>))(?P<player>.+?) is (?P<hp>near death|critically wounded|seriously wounded|heavily wounded|badly wounded|wounded|slightly wounded|injured|slightly injured|slightly hurt|scratched|almost unhurt|unhurt) and (?P<gp>near unconscious|severely fatigued|highly fatigued|very fatigued|fatigued|slightly fatigued|confused|slightly confused|concentrated|clear of mind|refreshed)\."
- script="plus_one"
- name="stat_other"
- regexp="y"
- lowercase_wildcard="y"
- sequence="95"
- omit_from_output="n"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?: |)(?!(\[|>))(?P<player>.+?) is (?P<hp>perfectly healthy, for a ghost)(?P<gp>)\."
- script="plus_one"
- name="stat_other_dead"
- regexp="y"
- lowercase_wildcard="y"
- sequence="95"
- omit_from_output="n"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?! )(\[.*\] You report: |\[.*\] )(?P<player>.+?)( .*|) is (?P<hp>|near death|critically wounded|seriously wounded|heavily wounded|badly wounded|wounded|slightly wounded|injured|slightly injured|slightly hurt|scratched|almost unhurt|unhurt) and (?P<gp>near unconscious|severely fatigued|highly fatigued|very fatigued|fatigued|slightly fatigued|confused|slightly confused|concentrated|clear of mind|refreshed)\."
- script="plus_one"
- name="group_report"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- omit_from_output="n"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?! )(\[.*\] You report: |\[.*\] )(?P<player>.+?)( .*|) is (?P<hp>perfectly healthy, for a ghost)(?P<gp>)\."
- script="plus_one"
- name="group_report_dead"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- omit_from_output="n"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)\[(?P<groupname>.*)\] (?P<player>.+?) has joined the group\.$"
- script="plus_one"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="90"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)\[(?P<groupname>.*)\] You have joined the group\.$"
- script="group_join"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="90"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?P<player>.+?)\; Hp\: (?P<hp>.*)/(?P<maxhp>.*) Gp\: (?P<gp>.*)/(?P<maxgp>.*)."
- script="plus_one_set_player"
- name="stat_me"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="95"
- omit_from_output="n"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)\[(?P<groupname>.*)\] (?P<player>.+?) has left the group\.$"
- script="minus_one"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="90"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)\[(?P<groupname>.*)\] you have left the group\.$"
- script="group_leave"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="90"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)You must be a member of a group to use this command\.$"
- name="group_nogroup"
- script="group_fail"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="100"
- >
- </trigger>
- ------------------------------------------------------------------------------------
- -- Group Shields Triggers ----------------------------------------------------------
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)Arcane protection for (?P<player>.*?)\:\-$"
- regexp="y"
- script="prot_redirect"
- name="prot_start"
- omit_from_output="n"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^ \* (Her|His) skin (?P<strength>has been hardened to a rock-like form|has been hardened with numerous layers of a mineral-like substance|has been hardened with a chalk-like substance|is covered with several layers of a chalk-like substance|has been covered with a thin layer of chalk)\.$"
- script="shield_up"
- name="prot_ccc"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="20"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^ \* (She|He) is surrounded by a (?P<colour>|dull red|bright red|wobbling orange|flickering yellow|).?magical impact shield\.$"
- script="shield_up"
- name="prot_tpa"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="20"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^ \* (She|He) is surrounded by a (?P<size>.*?) of (.*)\.$"
- script="shield_up"
- name="prot_kii"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="20"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^ \* (She|He) is(.*)protected by the power of (.*)$"
- script="shield_up"
- name="prot_major"
- regexp="y"
- ignore_case="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="20"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^ \* (?:A )(?P<effitem>.*) is floating around (him|her)\:$"
- script="shield_up"
- name="prot_eff"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="20"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^([^ ].*\:|It is .* condition\.| It .*\.|It has the hazy octarine sparkle of a magical talisman\.|\n| \* .*|)$"
- script="prot_redirect"
- name="prot_other"
- ignore_case="y"
- regexp="y"
- keep_evaluating="y"
- omit_from_output="n"
- sequence="25"
- >
- </trigger>
- <trigger
- enabled="y"
- keep_evaluating="y"
- match="^(?:> |)(?P<player>.*?) has no arcane protection\.$"
- regexp="y"
- script="prot_redirect"
- name="prot_noprot"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="n"
- keep_evaluating="y"
- match="^(?!( \* .*$|Arcane protection for .*$|.*has no arcane protection\.$|[^ ].*\:$|It is .* condition\.$| It .*\.$|It has the hazy octarine sparkle of a magical talisman\.$|$))"
- regexp="y"
- ignore_case="y"
- script="prot_redirect"
- name="prot_end"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="25"
- >
- </trigger>
- -- no need to keep evaluating on this
- <trigger
- enabled="y"
- match="^(?:> |)<end of shields list>$"
- regexp="y"
- ignore_case="y"
- script="prot_redirect"
- name="prot_end_force"
- lowercase_wildcard="y"
- omit_from_output="y"
- sequence="10"
- >
- </trigger>
- ------------------------------------------------------------------------------------
- -- Individual Shields Triggers -----------------------------------------------------
- <trigger
- enabled="y"
- match="^(?:> |) \* You are(.*)protected by the power of (.*)$"
- script="shield_up"
- name="up_meX_major"
- regexp="y"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |) \* You are surrounded by a (?P<colour>|dull red|bright red|wobbling orange|flickering yellow|).?magical impact shield\.$"
- regexp="y"
- script="shield_up"
- name="up_meX_tpa"
- lowercase_wildcard="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |) \* You are surrounded by a (?P<size>.*?) of (.*)\.$"
- regexp="y"
- script="shield_up"
- name="up_meX_kii"
- lowercase_wildcard="y"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |) \* (?:A )(?P<effitem>.*) is floating around you:$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_meX_eff"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |) \* Your skin (?P<strength>has been hardened to a rock-like form|has been hardened with numerous layers of a mineral-like substance|has been hardened with a chalk-like substance|has been covered with several layers of a chalk-like substance|has been covered with a thin layer of chalk)\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_meX_ccc"
- sequence="100"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)You have no arcane protection\.$"
- regexp="y"
- script="no_shields"
- name="ns_me"
- lowercase_wildcard="y"
- omit_from_output="n"
- sequence="100"
- >
- </trigger>
- ------------------------------------------------------------------------------------
- -- Shields Notifications Triggers --------------------------------------------------
- <trigger
- enabled="y"
- match="You are protected by the power of *."
- script="shield_up"
- name="up_me__major"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- <trigger
- enabled="y"
- ignore_case="y"
- match="^your (divine protection|protective aura) has been (strengthened|extended)\.$"
- script="shield_up"
- name="up_me2_major"
- regexp="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="Your divine protection is weakening."
- script="shield_weaken"
- name="wk_me__major"
- sequence="100"
- custom_colour="17"
- other_text_colour="orangered"
- >
- </trigger>
- <trigger
- enabled="y"
- match="Your divine protection expires."
- script="shield_down"
- name="dn_me__major"
- sequence="100"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)You detect (?P<player>.*?)('s| .*|) skin getting harder.$"
- script="shield_up"
- name="up_ot__ccc"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="lawngreen"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(?P<player>.*?)( .*|) scratches (himself|herself), and large pieces of skin flake off.$"
- script="shield_down"
- name="dn_ot__ccc"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)With a noise that sounds like (.*)\, the air around (?P<player>.*?)( .*|) flashes (.*) for a moment\.$"
- script="shield_up"
- name="up_ot__tpa"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="lawngreen"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)There is a sudden white flash around (?P<player>.*?)(\.| .*)$"
- script="shield_down"
- name="dn_ot__tpa"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(.*) begins to float around (?P<player>.*?)(\.| .*)$"
- script="shield_up"
- name="up_ot__eff"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="lawngreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)As the bugs around you fall, you realise you are now only surrounded by a (?P<size>.*) of .*.$"
- script="shield_up"
- name="up_me2_kii"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="orangered"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)In blocking the attack (.*) floating around (?P<player>.*?)( .*|) is knocked out of orbit.$"
- script="shield_down"
- name="dn_ot__eff"
- ignore_case="y"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(You feel your skin become rock hard|Your skin (feels even harder now|is now as hard as it can get))\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me__ccc"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)Your skin feels itchy\; large pieces flake off as you scratch it.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_down"
- name="dn_me__ccc"
- sequence="100"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)With a noise that sounds like (.*)\, everything around you flashes red for a moment\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me__tpa"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- -- do NOT keep evaluating to occlude up_ot__kii
- <trigger
- enabled="y"
- match="^(?:> |)(.*, |)(the |The |)(?P<size>handful|cloud|small swarm|large swarm|vast swarm|plague) of .* (begins to circle.*you.*|forms a chaotic web of .* around you.*|.*cluster.*you.*|begins to buzz.*you.*|.*orbit.*you.*|.*surround.*you.*)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me__kii"
- sequence="99"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(.*, |)(the |The |)(?P<size>handful|cloud|small swarm|large swarm|vast swarm|plague) of .* (begins to circle |forms a chaotic web of .* around |.*cluster.* |begins to buzz.* |.*orbit.* |.*surround.* )(?P<player>.*?)( .*|).*$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot__kii"
- sequence="100"
- custom_colour="17"
- other_text_colour="lawngreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)The .* surrounding you scatter in different directions and fly off\.$"
- script="shield_down"
- name="dn_me__kii"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- -- do NOT keep evaluating to occlude dn_ot2_kii
- <trigger
- enabled="y"
- match="^(?:> |)The last of the.*you crash to the ground\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_down"
- name="dn_me2_kii"
- sequence="99"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)Some of the .* around (?P<player>.*?)( .*|) detach themselves .*\.$"
- script="shield_down"
- name="dn_ot__kii"
- regexp="y"
- lowercase_wildcard="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)The last of the .*(?P<player>.*?)( .*|) crash to the ground\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_down"
- name="dn_ot2_kii"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)There is a sudden white flash\. Your magical shield has broken\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_down"
- name="dn_me__tpa"
- sequence="100"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- -- occlude up_ot__eff
- <trigger
- enabled="y"
- match="(?:The |)(?P<effitem>.*) begins to float around you\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me__eff"
- sequence="99"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- -- occlude dn_ot__eff
- <trigger
- enabled="y"
- match="^(?:> |)In blocking the attack (?:the |)(?P<effitem>.*) floating around you is knocked out of orbit.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_down"
- name="dn_me__eff"
- sequence="99"
- custom_colour="17"
- other_text_colour="gold"
- other_back_colour="darkred"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?:A |)(?P<effitem>.*) clatters to the ground.$"
- regexp="y"
- lowercase_wildcard="y"
- name="dn_ot2_eff"
- script="eff_stopped_any"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(?=.*(?P<colour>dull red))(The (.*) glow around |A dull red glow appears around )(?P<player>.*?)( .*|)( becomes dull red.|)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot3_tpa"
- keep_evaluating="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="crimson"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(?=.*(?P<colour>bright red))(The (.*) glow around |A bright red glow appears around )(?P<player>.*?)( .*|)( becomes bright red.|)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot4_tpa"
- sequence="100"
- keep_evaluating="y"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(?=.*(?P<colour>wobbling orange))(The (.*) glow around |A wobbling orange glow appears around )(?P<player>.*?)( .*|)( becomes wobbling orange.|)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot5_tpa"
- sequence="100"
- keep_evaluating="y"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)(?=.*(?P<colour>flickering yellow))(The (.*) glow around |A flickering yellow glow appears around )(?P<player>.*?)( .*|)( becomes flickering yellow.|)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot6_tpa"
- keep_evaluating="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellow"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(?:> |)The (.*) glow around (?P<player>.*?)( .*|) disappears\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_ot2_tpa"
- keep_evaluating="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="lawngreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)Your shield stops glowing a dull red and lapses back into invisibility\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me2_tpa"
- sequence="100"
- keep_evaluating="y"
- custom_colour="17"
- other_text_colour="yellowgreen"
- other_back_colour="darkgreen"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?=.*(?P<colour>dull red))(As your shield absorbs the impact, it becomes visible as a dull red glow\.|Your shield changes from a (.*) to a dull red\.)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me3_tpa"
- keep_evaluating="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="crimson"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?=.*(?P<colour>bright red))(As your shield absorbs the impact, its glow changes from a (.*) to a bright red.|Your shield changes from a (.*) to a bright red.|As your shield absorbs the impact, it becomes visible as a bright red glow.)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me4_tpa"
- keep_evaluating="y"
- sequence="100"
- custom_colour="17"
- other_text_colour="red"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?=.*(?P<colour>wobbling orange))(As your shield absorbs the impact, its glow changes from a (.*) to a wobbling orange.|Your shield changes from a (.*) to a wobbling orange.|As your shield absorbs the impact, it becomes visible as a wobbling orange glow.)$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_up"
- name="up_me5_tpa"
- sequence="100"
- keep_evaluating="y"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- <trigger
- enabled="y"
- match="^(?:> |)(?=.*(?P<colour>flickering yellow))(As your shield absorbs the impact, its glow changes from a (.*) to a flickering yellow.|Your shield changes from a (.*) to a flickering yellow.|As your shield absorbs the impact, it becomes visible as a flickering yellow glow.)$"
- regexp="y"
- lowercase_wildcard="y"
- keep_evaluating="y"
- script="shield_up"
- name="up_me6_tpa"
- sequence="100"
- custom_colour="17"
- other_text_colour="yellow"
- >
- </trigger>
- ------------------------------------------------------------------------------------
- -- Shields Weakening Triggers -------------------------------------------------------
- <trigger
- enabled="y"
- match="(.*) but your magical shielding absorbs (most|some) of the blow\.$"
- regexp="y"
- lowercase_wildcard="y"
- script="shield_weaken"
- name="wk_me__tpa"
- keep_evaluating="y"
- sequence="99"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- <trigger
- enabled="y"
- match="(.*) you but your (?P<size>.*) of (lacewings|stick insects|mayflies|mantids|butterflies|ladybirds|moths|grasshoppers|cicadas|gnats|dragonflies|damselflies|sandflies|locusts|crickets|mosquitos|flying ants|termites|horseflies|wasps|bees|hornets|cicadas|elephant beetles|assassin bugs) absorbs (some|most) of the blow\.$"
- regexp="y"
- keep_evaluating="y"
- lowercase_wildcard="y"
- script="shield_weaken"
- name="wk_me__kii"
- sequence="99"
- custom_colour="17"
- other_text_colour="orangered"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(.*) (kicks|boots|slaps|launches a powerful attack.*|slices the.*|bruises|hits|barely stabs|wriggles through.*|suffocating| slithers painfully.*you|decimating|pulls|takes a sliver off|strikes|stabs|smashes|slices|skewers|shreds|scratches|runs|pierces|pricks|perforates|snicks|nicks|neatly fillets|messily stabs|mashes|makes a kebab.*|jabs|impales|hacks|cuts|crushes|chops.*|bludgeons|pokes|tickles) (?P<player>.*?)( .*|) but (his|her) magical shielding absorbs (some|most) of the blow\.$"
- regexp="y"
- keep_evaluating="y"
- lowercase_wildcard="y"
- script="shield_weaken"
- name="wk_ot__tpa"
- sequence="99"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(.*) (kicks|boots|slaps|launches a powerful attack.*|slices the.*|bruises|hits|barely stabs|wriggles through.*|suffocating| slithers painfully.*you|decimating|pulls|takes a sliver off|strikes|stabs|smashes|slices|skewers|shreds|scratches|runs|pierces|pricks|perforates|snicks|nicks|neatly fillets|messily stabs|mashes|makes a kebab.*|jabs|impales|hacks|cuts|crushes|chops.*|bludgeons|pokes|tickles) (?P<player>.*?)( .*|) but (his|her) divine protection absorbs (some|most) of the blow\.$"
- regexp="y"
- keep_evaluating="y"
- lowercase_wildcard="y"
- script="shield_weaken"
- name="wk_ot__major"
- sequence="99"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- <trigger
- enabled="n"
- match="^(.*) (kicks|boots|slaps|launches a powerful attack.*|slices the.*|bruises|hits|barely stabs|wriggles through.*|suffocating| slithers painfully.*you|decimating|pulls|takes a sliver off|strikes|stabs|smashes|slices|skewers|shreds|scratches|runs|pierces|pricks|perforates|snicks|nicks|neatly fillets|messily stabs|mashes|makes a kebab.*|jabs|impales|hacks|cuts|crushes|chops.*|bludgeons|pokes|tickles) (?P<player>.*?)( .*|) but (his|her) (?P<size>.*) of (lacewings|stick insects|mayflies|mantids|butterflies|ladybirds|moths|grasshoppers|cicadas|gnats|dragonflies|damselflies|sandflies|locusts|crickets|mosquitos|flying ants|termites|horseflies|wasps|bees|hornets|cicadas|elephant beetles|assassin bugs) absorbs (some|most) of the blow\.$"
- regexp="y"
- keep_evaluating="y"
- lowercase_wildcard="y"
- script="shield_weaken"
- name="wk_ot__kii"
- sequence="99"
- custom_colour="17"
- other_text_colour="orange"
- >
- </trigger>
- </triggers>
- <!-- Aliases -->
- <aliases>
- <alias
- script="GroupReport"
- match="reportxp"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="GroupReportCombat"
- match="reportstats"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="MeReport"
- match="showxp"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="MeReportCombat"
- match="showstats"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="TimerToZero"
- match="resetxp"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="StatsToZero"
- match="resetstats"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="PosLeft"
- match="sidebarleft"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="PosRight"
- match="sidebarright"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- script="SidebarConfig"
- match="sidebar_config"
- enabled="y"
- sequence="100"
- >
- </alias>
- <alias
- enabled="y"
- ignore_case="y"
- match="help sidebar"
- name="helpsidebar"
- send_to="12"
- sequence="100"
- >
- <send>print_help()</send>
- </alias>
- <alias
- match="listgroup"
- enabled="y"
- sequence="100"
- script="list_group"
- >
- </alias>
- <alias
- match="reportkills"
- enabled="y"
- sequence="100"
- script="reportkills"
- >
- </alias>
- <alias
- match="showkills"
- enabled="y"
- sequence="100"
- script="showkills"
- >
- </alias>
- <alias
- match="groupupdate"
- enabled="y"
- sequence="100"
- script="UpdateGroup"
- >
- </alias>
- <alias
- match="hideidlespam"
- enabled="y"
- sequence="100"
- script="toggleidlespam"
- >
- </alias>
- <alias
- match="groupreset"
- enabled="y"
- sequence="100"
- script="ResetGroup"
- >
- </alias>
- <alias
- match="showhitcolours"
- enabled="y"
- sequence="100"
- script="togglehitcolour"
- >
- </alias>
- <alias
- match="triggercolours"
- enabled="y"
- sequence="100"
- script="toggletriggercolours"
- >
- </alias>
- <alias
- match="^settriggercolour\((?P<what>up|dn|wk|go|ht)(?P<who>me|ot)(\s*,\s*|\s*)((?P<code>\d*)|(?P<fore>\w*)(\s*,\s*(?P<back>.*)|)|)\)"
- regexp="y"
- ignore_case="y"
- name="settriggercolouralias"
- enabled="y"
- sequence="100"
- script="settriggercolours"
- >
- </alias>
- <alias
- match="showtriggercolours"
- enabled="y"
- sequence="100"
- script="displaycolours"
- >
- </alias>
- <alias
- match="hidelookmap"
- enabled="y"
- sequence="100"
- script="toggletriggerhiding"
- >
- </alias>
- <alias
- match="fixedbarcolours"
- enabled="y"
- sequence="100"
- script="togglepercentcolours"
- >
- </alias>
- <alias
- match="^xpdetailplot(\((?P<avg>\d+)\)|)$"
- regexp="y"
- enabled="y"
- sequence="100"
- script="togglexpdetail"
- >
- </alias>
- <alias
- match="^gpding(\((?P<file>.*?)(,(?P<vol>.*)\)|\))|)$"
- regexp="y"
- enabled="y"
- sequence="100"
- script="setgpding"
- >
- </alias>
- <alias
- match="^doublewin(\((?P<tab>[1-4])\)|)$"
- regexp="y"
- enabled="y"
- sequence="100"
- script="toggledoublewin"
- >
- </alias>
- <alias
- match="showdebugoptions"
- enabled="y"
- sequence="100"
- script="debugoptions"
- >
- </alias>
- <alias
- match="showmxpdebug"
- enabled="y"
- sequence="100"
- script="toggleshowmxp"
- >
- </alias>
- <alias
- match="groupjointoggle"
- enabled="y"
- sequence="100"
- script="togglegroupjoin"
- >
- </alias>
- <alias
- match="^gpregenrate\((?P<rate>[1-4]*)\)"
- enabled="y"
- regexp="y"
- ignore_case="y"
- name="regenratealias"
- sequence="100"
- script="setgpregen"
- >
- </alias>
- <alias
- match="hidecombatspam"
- enabled="y"
- sequence="100"
- script="togglecombatspam"
- >
- </alias>
- </aliases>
- <timers>
- <timer
- script="grab_time"
- enabled="y"
- minute="1"
- >
- </timer>
- <timer
- script="show_time"
- enabled="y"
- second="1.00"
- >
- </timer>
- <timer
- script="approx_tick"
- enabled="y"
- second="2.00"
- >
- </timer>
- </timers>
- <script>
- <![CDATA[
- bar_width = 180
- map_height = 220
- require "serialize" -- needed to serialize table to string
- -- which tab to show on start up
- TAB_SHOW = 1
- -- colours used
- COLOURS = COLOURS or {}
- COLOURS.BACKGROUND = COLOURS.BACKGROUND or ColourNameToRGB ("black")
- COLOURS.HEADER = COLOURS.HEADER or ColourNameToRGB ("silver")
- COLOURS.OUTLINE = COLOURS.OUTLINE or ColourNameToRGB ("dimgray")
- COLOURS.TEXT = COLOURS.TEXT or ColourNameToRGB ("silver")
- COLOURS.MAP_BACKGROUND = COLOURS.MAP_BACKGROUND or ColourNameToRGB ("black")
- COLOURS.HP = COLOURS.HP or ColourNameToRGB ("forestgreen")
- COLOURS.GP = COLOURS.GP or ColourNameToRGB ("blue")
- COLOURS.BURDEN = COLOURS.BURDEN or ColourNameToRGB ("firebrick")
- COLOURS.HPHIGH = COLOURS.HPHIGH or tonumber("009000",16)
- COLOURS.GPHIGH = COLOURS.GPHIGH or tonumber("ee0000",16)
- COLOURS.BURDENHIGH = COLOURS.BURDENHIGH or tonumber("009000",16)
- COLOURS.HPMED = COLOURS.HPMED or tonumber("00dddd",16)
- COLOURS.GPMED = COLOURS.GPMED or tonumber("990044",16)
- COLOURS.BURDENMED = COLOURS.BURDENMED or tonumber("00dddd",16)
- COLOURS.HPLOW = COLOURS.HPLOW or ColourNameToRGB ("red")
- COLOURS.GPLOW = COLOURS.GPLOW or tonumber("660066",16)
- COLOURS.BURDENLOW = COLOURS.BURDENLOW or ColourNameToRGB ("red")
- COLOURS.OHITS = COLOURS.OHITS or ColourNameToRGB ("forestgreen")
- COLOURS.OSPECIALS = COLOURS.OSPECIALS or ColourNameToRGB ("forestgreen")
- COLOURS.DPARRY = COLOURS.DPARRY or ColourNameToRGB ("firebrick")
- COLOURS.DDODGE = COLOURS.DDODGE or ColourNameToRGB ("firebrick")
- COLOURS.DBLOCK = COLOURS.DBLOCK or ColourNameToRGB ("firebrick")
- COLOURS.DSHIELD = COLOURS.DSHIELD or ColourNameToRGB ("firebrick")
- COLOURS.DHITS = COLOURS.DHITS or ColourNameToRGB ("firebrick")
- DEFTRIGCOL = {}
- DEFTRIGCOL.UPME = "17"
- DEFTRIGCOL.DNME = "17"
- DEFTRIGCOL.WKME = "17"
- DEFTRIGCOL.GOME = "0" -- don't use
- DEFTRIGCOL.UPOT = "0"
- DEFTRIGCOL.DNOT = "0"
- DEFTRIGCOL.GOOT = "0" -- don't use
- DEFTRIGCOL.HTME = "17"
- DEFTRIGCOL.UPMETEXT = "yellowgreen"
- DEFTRIGCOL.UPMEBACK = "darkgreen"
- DEFTRIGCOL.DNMETEXT = "goldenrod"
- DEFTRIGCOL.DNMEBACK = "darkred"
- DEFTRIGCOL.WKMETEXT = "orangered"
- DEFTRIGCOL.WKMEBACK = "black"
- DEFTRIGCOL.GOMETEXT = "orange"
- DEFTRIGCOL.GOMEBACK = "black"
- DEFTRIGCOL.UPOTTEXT = "lawngreen"
- DEFTRIGCOL.UPOTBACK = "black"
- DEFTRIGCOL.DNOTTEXT = "red"
- DEFTRIGCOL.DNOTBACK = "black"
- DEFTRIGCOL.GOOTTEXT = "orange"
- DEFTRIGCOL.GOOTBACK = "black"
- DEFTRIGCOL.HTMETEXT = "goldenrod"
- DEFTRIGCOL.HTMEBACK = "black"
- -- store defaults first time
- TRIGCOL = TRIGCOL or {}
- for k,v in pairs(DEFTRIGCOL) do TRIGCOL[k] = TRIGCOL[k] or v end
- SETTINGS = SETTINGS or {}
- SETTINGS.PERCENT_COLOURS = SETTINGS.PERCENT_COLOURS or true
- SETTINGS.TRIGGER_COLOURS = SETTINGS.TRIGGER_COLOURS or true
- SETTINGS.TRIGGER_SHOW = SETTINGS.TRIGGER_SHOW or false
- SETTINGS.XPDETAIL_SHOW = SETTINGS.XPDETAIL_SHOW or true
- SETTINGS.DOUBLEWIN = SETTINGS.DOUBLEWIN or false
- SETTINGS.SHOWMXP = SETTINGS.SHOWMXP or false
- SETTINGS.DWWIN = SETTINGS.DWWIN or 4
- SETTINGS.COMBAT = SETTINGS.COMBAT or 0
- SETTINGS.IDLE = SETTINGS.IDLE or 0
- SETTINGS.HITCOLOUR = SETTINGS.HITCOLOUR or 0
- SETTINGS.XPDETAIL_AVG = SETTINGS.XPDETAIL_AVG or 10
- SETTINGS.GPDING = SETTINGS.GPDING or false
- SETTINGS.GPFILE = SETTINGS.GPFILE
- SETTINGS.GPVOL = SETTINGS.GPVOL or 0
- SETTINGS.GROUPJOIN = SETTINGS.GROUPJOIN or true
- GROUP_TRIGGERS = false
- -------------------------------------------------------------------------------------------
- -- Stat capture code
- -------------------------------------------------------------------------------------------
- SetVariable ("me", "0")
- SetVariable ("myeff", "0")
- groupnumber = 0
- leavenumber = 0
- shufflenumber = 0
- prot_name = "0"
- ArrayCreate ("group")
- ArrayCreate ("numbers")
- ArrayCreate ("hpt")
- ArrayImport ("hpt", { ['perfectly healthy, for a ghost'] = 0,['near death'] = 1,['critically wounded'] = 2,
- ['seriously wounded'] = 3,['heavily wounded'] = 4,['badly wounded'] = 5,['wounded'] = 6,
- ['slightly wounded'] = 7,['injured'] = 8,['slightly injured'] = 9,['slightly hurt'] = 10,
- ['scratched'] = 11,['almost unhurt'] = 12,['unhurt'] = 13 })
- ArrayCreate ("gpt")
- ArrayImport("gpt", { ['unconscious'] = 0, ['near unconscious'] = 1, ['severely fatigued'] = 2,
- ['highly fatigued'] = 3, ['very fatigued'] = 4, ['fatigued'] = 5, ['slightly fatigued'] = 6,
- ['confused'] = 7, ['slightly confused'] = 8, ['concentrated'] = 9, ['clear of mind'] = 10,
- ['refreshed'] = 11 })
- ArrayCreate ("kiis")
- ArrayImport("kiis", { ['handful'] = "orange", ['cloud'] = "orange", ['small swarm'] = "yellow",
- ['large swarm'] = "yellow", ['vast swarm'] = "yellow", ['plague'] = "white" })
- ArrayCreate ("cccs")
- ArrayImport("cccs", { ['has been hardened to a rock-like form'] = "white",
- ['has been hardened with numerous layers of a mineral-like substance'] = "yellow",
- ['has been hardened with a chalk-like substance'] = "yellow",
- ['is covered with several layers of a chalk-like substance'] = "orange",
- ['has been covered with several layers of a chalk-like substance'] = "orange",
- ['has been covered with a thin layer of chalk'] = "red" })
- ArrayCreate ("tpas")
- ArrayImport("tpas", { ['dull red'] = "crimson",
- ['bright red'] = "red",
- ['wobbling orange'] = "orange",
- ['flickering yellow'] = "yellow" })
- ------------------------------------------------------------------------------------------------------------
- -- This creates the funky metatable that lets us use MUSHClient variables (which persist) as Lua variables--
- -- (which don't). Awesome, no? It uses a metatable, where the __index value refers to a function that --
- -- defines what happens when a value is retrieved, and the __newindex value to a function that defines --
- -- what happens when a value is created. --
- -- --
- -- Due to the case-insensitive and string-valued nature of MUSHClient variables, though, some on-the-fly --
- -- type correction is required, and the table's elements are all also case-insensitive. --
- ------------------------------------------------------------------------------------------------------------
- mushvar = {} -- variables table
- setmetatable (mushvar,
- {
- -- called to access an entry
- __index =
- function (t, name)
- if GetPluginID() ~= "" then
- tmp = GetVariable(string.lower(name))
- else
- Note("Warning: Trying using pluginvariable.")
- tmp = GetPluginVariable(pluginid, string.lower(name))
- end
- tempvalue = tonumber( tmp )
- if tempvalue == nil then
- tempvalue = tmp
- end
- return tempvalue
- end;
- -- called to change or delete an entry
- __newindex =
- function (t, name, val)
- if GetPluginID() == "" then
- error ("Changing mushvar outside plugin.")
- end
- name=string.lower(name)
- local result
- if val == nil then -- nil deletes it
- result = DeleteVariable (name)
- else
- result = SetVariable (name, tostring (val))
- end
- -- warn if they are using bad variable names
- if result == error_code.eInvalidObjectLabel then
- error ("Bad variable name '" .. name .. "'")
- end
- end;
- })
- --[[
- These are all the variables that are saved over instances, and what they do.
- FirstCheck Checks for First Usage to set these.
- HP, GP, XP Hitpoints, guildpoints, experience points currently.
- OldHP Previous values for comparison.
- OldGP
- OldXP
- MaxHP These attribute's maxima.
- MaxGP
- ]]
- if world.GetVariable("FirstChecker") == nil then
- mushvar.FirstChecker = 1
- mushvar.HP=50
- mushvar.GP=50
- mushvar.XP=50
- mushvar.SP=50 -- social points
- mushvar.gpest=50
- mushvar.gptick=3
- mushvar.oldHP=49
- mushvar.oldGP=49
- mushvar.oldXP=49
- mushvar.oldSP=49
- mushvar.maxHP=51
- mushvar.maxGP=51
- mushvar.maxSP=51
- mushvar.burden=20
- mushvar.maxburden=100
- mushvar.oldburden=19
- -- miniwindow locations (left by default)
- mushvar.xppos=4 -- 4 =left 6=right
- mushvar.mappos=11 -- 11=left 7=right
- mushvar.barpos=10 -- 10=left 8=right
- mushvar.bar_position=1 -- 1 =left 2=right
- -- combat varibles
- mushvar.dodgedhits=0
- mushvar.parriedhits=0
- mushvar.blockedhits=0
- mushvar.armourhits=0
- mushvar.totalenemyhits=0
- mushvar.totaldefend=0
- mushvar.percentdefend=0
- mushvar.percentparried=0
- mushvar.percentdodged=0
- mushvar.percentblocked=0
- mushvar.percentshielded=0
- mushvar.percenthit=0
- mushvar.totalhit=0
- mushvar.percentlaunched=0
- mushvar.successhits=0
- mushvar.missedhits=0
- mushvar.attempted=0
- mushvar.combatrounds=0
- mushvar.hitrate=0
- mushvar.successspecials=0
- mushvar.failspecials=0
- mushvar.percentspecialhit=0
- mushvar.attemptedspecials=0
- end -- End of first-run variable definition.
- ------------------------------------------------------------------------------------------------------------
- --This is, arguably, the most important function in the plugin - it takes the values provided by the MUD --
- -- for HP, GP, XP and sets their values in the system, or, more specifically, in mushvar[attributename] --
- ------------------------------------------------------------------------------------------------------------
- boolStatSet={}
- boolStatSet.hp=0
- boolStatSet.gp=0
- boolStatSet.xp=0
- boolStatSet.burden=0
- ignoretable={['xp'] = 1, ['gp'] = 1, ['hp'] = 1, ['maxhp'] = 1, ['maxgp'] = 1, ['burden'] = 1,
- ['sp'] = 1, ['maxsp'] = 1, ['club'] = 1,['informtypes'] = 1, ['guilds'] = 1, ['channels'] = 1,
- ['informtype'] = 1, ['clubnames'] = 1, ['groupcmds'] = 1, ['talkerchannels'] = 1}
- tagignoretable={['send,'] = 1, ['br,'] = 1,['exit,'] = 1}
- function OnPluginMXPerror (level, number, line, message)
- local inputs = utils.split(level, ',')
- level = inputs[1]
- number = inputs[2]
- line = inputs[3]
- message = inputs[4]
- if level == "E" and number == "1023" then
- if string.match(message,"mapstart") ~= nil then
- MapStart()
- return 1
- elseif string.match(message,"mapend") ~= nil then
- MapEnd()
- return 1
- end
- end
- end -- function
- function MapStart()
- map_lines = {}
- EnableTrigger ("multi_line_map", true) -- capture subsequent lines
- EnableTrigger ("map_end", true) -- capture subsequent lines
- if map_title_fresh ~= true then
- map_title = "Map <glance mode>"
- end
- end
- function MapEnd()
- EnableTrigger ("multi_line_map", false) -- capture subsequent lines
- EnableTrigger ("map_end", false) -- capture subsequent lines
- Display_Map ()
- map_title_fresh = false
- end
- function OnPluginMXPsetEntity (sIn)
- local value = utils.split(sIn, '=')
- local attribute = value[1]
- value = tonumber( value[2] )
- if attribute == "xp" and value == 0 and world.GetConnectDuration() < 5 then
- -- ignore it.
- else
- mushvar["old"..attribute] = mushvar[attribute]
- mushvar[attribute] = value
- boolStatSet[attribute]=1
- end
- if SETTINGS.SHOWMXP and ignoretable[attribute] == nil then
- Note(sIn)
- end
- if attribute == "gp" then
- mushvar.gpest = mushvar.gp
- end
- if attribute == "hp" and not (boolStatSet.gp==1 and boolStatSet.xp==1) then
- -- always update the hp bar.. (slight waste if we're going to redo the others later.. but keeps it accurate)
- DrawGauges()
- end
- if attribute == "burden" then DrawGauges() end
- if boolStatSet.hp==1 and boolStatSet.gp==1 and boolStatSet.xp==1 then
- boolStatSet.hp=0
- boolStatSet.gp=0
- boolStatSet.xp=0
- CompleteSet()
- end -- if
- if boolStatSet.maxhp==1 and boolStatSet.maxgp==1 then
- boolStatSet.maxhp=0
- boolStatSet.maxgp=0
- if mushvar.maxhp~=mushvar.oldmaxhp or mushvar.maxgp~=mushvar.oldmaxgp then
- mushvar.oldhp=mushvar.hp
- mushvar.oldgp=mushvar.gp
- mushvar.oldxp=mushvar.xp
- CompleteSet() --Fake it, in order to push the new maxima.
- end -- if
- end -- if
- --CompleteSet()
- end -- OnPluginMXPsetEntity
- function CompleteSet()
- if GetPluginID() == "" then
- Note("Warning: Completeset not in plugin.")
- end
- --[[
- -- Sidebar on the left or right?
- if mushvar.bar_position == 1 then
- mushvar.xppos=4
- mushvar.mappos=11
- mushvar.barpos=10
- TextRectangle(bar_width+1, 0, 0, 0, 0,0x000000,0,0x000000,0) -- Push text left
- elseif mushvar.bar_position == 2 then
- mushvar.xppos=6
- mushvar.mappos=7
- mushvar.barpos=8
- TextRectangle(0, 0, GetInfo (281) - bar_width - 1, 0, 0,0x000000,0,0x000000,0)
- end -- if
- ]]
- DrawGauges ()
- XPMath()
- end -- CompleteSet
- -------------------------------------------------------------------------------------------
- -- This catches the values sent by the trigger that
- -- matches the monitor line, and performs the same
- -- actions as if they had been set as Entities as above.
- -- Maximum HP and GP, and xp, are not sent by the monitor.
- -------------------------------------------------------------------------------------------
- function OnHealthTrigger (iHP, iMaxHP, iGP, iMaxGP, iXP)
- mushvar.MaxHP = iMaxHP
- mushvar.MaxGP = iMaxGP
- mushvar.combatrounds = mushvar.combatrounds + 1
- OnPluginMXPsetEntity ("hp="..iHP)
- OnPluginMXPsetEntity ("xp="..iXP)
- OnPluginMXPsetEntity ("gp="..iGP)
- OnPluginMXPsetEntity ("maxhp="..iMaxHP)
- OnPluginMXPsetEntity ("maxgp="..iMaxGP)
- end -- OnHealthTrigger
- function PosLeft (sName, sLine, wildcards)
- --WindowShow (XPWin, false)
- --WindowShow (MapWin, false)
- --WindowShow (GaugeWin, false)
- mushvar.bar_position = 1
- EnsureSize()
- CompleteSet()
- if WindowInfo(MapWin, 5) then
- Display_Map()
- end
- end -- posleft
- function PosRight (sName, sLine, wildcards)
- --WindowShow (XPWin, false)
- --WindowShow (MapWin, false)
- --WindowShow (GaugeWin, false)
- mushvar.bar_position = 2
- EnsureSize()
- CompleteSet()
- if WindowInfo(MapWin, 5) then
- Display_Map()
- end
- end -- posright
- function EnsureSize (sName, sLine, wildcards)
- -- Sidebar on the left or right?
- if mushvar.bar_position == 1 then
- mushvar.xppos=4
- mushvar.mappos=11
- mushvar.barpos=10
- TextRectangle(bar_width+1, 0, 0, 0, 0,0x000000,0,0x000000,0) -- Push text left
- elseif mushvar.bar_position == 2 then
- mushvar.xppos=6
- mushvar.mappos=7
- mushvar.barpos=8
- TextRectangle(0, 0, GetInfo (281) - bar_width - 1, 0, 0,0x000000,0,0x000000,0)
- end -- if
- --[[if GetOption("auto_wrap_window_width") then
- -- manually calculate and set the text wrap value
- local newcol = math.floor((GetInfo(281)-bar_width - 1) / GetInfo(240))
- if newcol ~= GetOption("wrap_column") then
- Note("Wrapping at: " .. newcol)
- SetOption("wrap_column",math.floor((GetInfo(281)-bar_width - 1) / GetInfo(240)))
- end
- end]]
- end
- function debugoptions (sName, sLine, wildcards)
- for k, v in pairs (GetOptionList()) do
- Note (v, " = ", GetOption (v))
- end
- end
- DoAfterSpecial (1, "EnsureSize()", sendto.script) -- call when starting script
- -------------------------------------------------------------------------------------------
- -- XP counter code
- -------------------------------------------------------------------------------------------
- local time=0
- local basexp
- local xp
- local mins
- local lastxp
- local lasttime=0
- basexp = 0
- time_text = ""
- xp_text = "XP: "
- av_text = "0 mins. 0 xp/h"
- report_text = ""
- -- count number of times non-group members have done killing
- other_kills = 0
- -- window sizes
- GRAPH_WIDTH = 120
- INDENT = 42
- HEADER = 20
- HEIGHT = 150
- SPACE = 20
- FOOTER = 5
- BUTTON_HEIGHT = (HEIGHT-16)/4
- function StartUp (sName, sLine, wildcards) -- set the graph to starting values
- -- XP Point Tables to use on startup
- points = {}
- points = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0}
- dpoints = {}
- dpoints = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0}
- dvals = {}
- dvals = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0}
- dcount = 0
- end -- StartUp
- -----------------------------------------------
- -- Called by alias and hotspot to zero timer --
- -----------------------------------------------
- function TimerToZero (sName, sLine, wildcards)
- time = 0
- XPMath ()
- end -- TimerToZero
- function GroupReport (sName, sLine, wildcards)
- XPMath ()
- Execute("group say " .. report_text)
- end -- GroupReport
- function GroupReportCombat (sName, sLine, wildcards)
- CompleteSet ()
- report_combat_text = string.format("Hits:" .. mushvar.successhits .. "(" .. mushvar.percentlaunched .. "%%), Specials:" .. mushvar.successspecials .. "(" .. mushvar.percentspecialhit .. "%%), P/Round:" .. mushvar.hitrate .. " | Parry:" .. mushvar.parriedhits .. "(" .. mushvar.percentparried .. "%%), Dodge:" .. mushvar.dodgedhits .. "(" .. mushvar.percentdodged .. "%%), Block:" .. mushvar.blockedhits .. "(" .. mushvar.percentblocked .. "%%), Shields:" .. mushvar.armourhits .. "(" .. mushvar.percentshielded .. "%%), Damage:" .. mushvar.totalhit .. "(" .. mushvar.percenthit .. "%%)")
- Execute("group say " .. report_combat_text)
- end -- GroupReportCombat
- function MeReport (sName, sLine, wildcards)
- XPMath ()
- Note(report_text)
- end -- MeReport
- function MeReportCombat (sName, sLine, wildcards)
- CompleteSet ()
- report_combat_text = string.format("Hits:" .. mushvar.successhits .. "(" .. mushvar.percentlaunched .. "%%), Specials:" .. mushvar.successspecials .. "(" .. mushvar.percentspecialhit .. "%%), P/Round:" .. mushvar.hitrate .. " | Parry:" .. mushvar.parriedhits .. "(" .. mushvar.percentparried .. "%%), Dodge:" .. mushvar.dodgedhits .. "(" .. mushvar.percentdodged .. "%%), Block:" .. mushvar.blockedhits .. "(" .. mushvar.percentblocked .. "%%), Shields:" .. mushvar.armourhits .. "(" .. mushvar.percentshielded .. "%%), Damage:" .. mushvar.totalhit .. "(" .. mushvar.percenthit .. "%%)")
- Note(report_combat_text)
- end -- MeReportCombat
- function XPMath (sName, sLine, wildcards)
- if time==0 or (world.GetConnectDuration() < lasttime) or (mushvar.xp < lastxp) then
- time = world.GetConnectDuration()
- end -- if
- if (world.GetConnectDuration() - time) < 2 then
- --Note("resetting base: " .. tostring(basexp) .. " " .. mushvar.xp)
- basexp = mushvar.xp
- lastxp = mushvar.xp
- end -- if reset xp until 2 seconds gone..
- xpdiff=mushvar.xp-basexp
- timediff = math.max(15, world.GetConnectDuration() - time) -- always use a minimum of 15s difference
- mins=string.format("%4.2f", (timediff/60))
- xp_ph = string.format("%1.0f", (xpdiff/(timediff/3600)))
- lasttime = time;
- -- Text to print
- xp_text = string.format("XP: " .. mushvar.xp)
- av_text = string.format(mins .. " mins. " .. xp_ph .. " xp/h")
- time_text = string.format(xpdiff .. "xp gained in")
- report_text = string.format("Current XP: " .. mushvar.xp .. ". " .. xpdiff .. " xp gained in " .. mins .. " mins. Average xp/h: " .. (math.floor (xpdiff/(timediff/3600))) .. ".")
- DoPrompt ()
- end -- XPMath
- function grab_time (sName, sLine, wildcards)
- -- This moves the graph points along one tick when the timer fires
- table.remove (points, 1)
- -- Do not let the XP Point go above 100 or below 0
- if (xp_ph/10000) > 100 then
- table.insert (points, 100)
- elseif (xp_ph/10000) < 0 then
- table.insert (points, 0)
- else
- table.insert (points, (xp_ph/10000))
- end -- if
- table.remove (dvals, 1)
- table.insert (dvals, mushvar.xp - lastxp)
- if dcount < 60 then
- dcount = dcount + 1
- end
- table.remove (dpoints, 1)
- -- Do not let the Delta XP Point go above 100 or below 0
- local deltaxp_ph = 0
- for i = 1,math.min(SETTINGS.XPDETAIL_AVG,dcount) do
- deltaxp_ph = deltaxp_ph + dvals[61-i]
- end
- deltaxp_ph = deltaxp_ph * 60 / math.min(SETTINGS.XPDETAIL_AVG, dcount)
- lastxp = mushvar.xp
- if (deltaxp_ph/10000) > 100 then
- table.insert (dpoints, 100)
- elseif deltaxp_ph < 0 then
- table.insert (dpoints, 0)
- else
- table.insert (dpoints, (deltaxp_ph/10000))
- end -- if
- DoPrompt ()
- end
- -------------------------------------------------------------------------------------------
- -- Time and date code mostly taken from Ian Kirkers plugin (latest health bar) found at
- -- http://homepage.ntlworld.com/ian.avery2/ on the plugins page
- -------------------------------------------------------------------------------------------
- function show_time( )
- if TAB_SHOW == 3 then
- DoPrompt ()
- end
- end
- function gpding()
- -- script function called when gp estimate reaches max
- if SETTINGS.GPDING then
- --Note("maxgp")
- PlaySound(0,SETTINGS.GPFILE,false,SETTINGS.GPVOL)
- end
- end
- function approx_tick( )
- if mushvar.gpest ~= nil and mushvar.gp ~= mushvar.maxgp and mushvar.gpest ~= mushvar.maxgp then
- if GetPluginID() == "" then
- Note("Warning: Tick occurred outside of plugin.")
- return
- end
- mushvar.gpest = math.min(mushvar.gpest + mushvar.gptick, mushvar.maxgp)
- DrawGauges()
- if mushvar.gpest == mushvar.maxgp then
- gpding()
- end
- end
- end
- --Converts a UNIX Time into an array containing elements
- -- of the Discworld time.
- function unix_to_disc_time( Tick )
- if Tick==nil then Tick = os.time() end --Default to Now.
- --Arrays containing the names of months, days, cycles, and the number of days in each month.
- month_names={[0] = "Offle", "February", "March", "April", "May", "June", "Grune", "August", "Spune", "Sektober", "Ember", "December", "Ick", "Off", "Feb", "Mar", "Apr", "May", "Jun", "Gru", "Aug", "Spu", "Sek", "Emb", "Dec", "Ick"}
- day_names ={[0] = "Octeday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Oct", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}
- days_per_month={[0] = 31,30,31,31,31,30,31,31,31,30,31,31,31}
- cycles = {[0] = "Prime", "Secundus", "I", "II"}
- fmod = math.fmod --"Pointers" to maths library functions.
- floor = math.floor -- Just because I dislike typing math. every time.
- --Calculating simple elements:
- S = floor(fmod(Tick, 18)) --Seconds
- M = floor(fmod(Tick, 18*60)/18) --Minutes
- H = floor(fmod(Tick, 18*60*24)/(18*60)) --Hours (on the 24 hour clock)
- I = fmod(H, 12) if I == 0 then I = 12 end --Hours (on the 12 hour clock)
- j = floor(fmod(Tick, 18*60*24*400)/(18*60*24)) --Day of the year (0-399)
- w = floor(fmod(Tick+(18*60*24*5), 18*60*24*8)/(18*60*24))--The addition makes it start on Octeday instead of Friday.
- Y = floor(Tick/(18*60*24*400*2)) + 1966 --Year (four digit number)
- C = floor(fmod((Tick/(18*60*24*400)),2)) --Cycle (0 -> Prime, 1 -> Secundus)
- --Calculating which month the time is in.
- day_stack = j -- Basically, we pop days off the stack in months at a time
- m=0 -- until there are less than a month remaining.
- while (day_stack>=days_per_month[m]) do
- day_stack = day_stack - days_per_month[m]
- m = m + 1
- end
- d = day_stack + 1 ; --And then make a correction for the lack of a 0th day of year, before setting the
- -- day of the month element.
- --d = day_stack -- Or not, if you want to use zero based month days as well.
- --Related Strings.
- B = month_names[m] -- Name of the month.
- b = month_names[m + 13] -- TLA of the month.
- A = day_names[w] -- Name of the day.
- a = day_names[w+8] -- TLA of the day.
- P = cycles[C] -- Name of the cycle.
- p = cycles[C+2] -- Roman numberal of the cycle.
- if H > 11 then Z = "pm" else Z = "am" end -- AM/PM.
- --Special Day checks!
- special_day = nil
- if m==0 and d==1 then
- if C==0 then special_day = "Hogswatch"
- else special_day = "Crueltide"
- end
- end
- if m==6 and d==16 then
- special_day = "Small Gods day"
- end
- if m==7 and d==23 then
- special_day = "Soul Cake Tuesday"
- end
- if m==9 and d==1 then
- special_day = "Sektober Fools' Day"
- end
- if special_day then D=special_day else D=A end
- return S, M, H, Z, I, j, w, Y, C, m, d, B, b, A, a, P, p, special_day, D
- --S Seconds (no leading zeroes added)
- --M Minutes (no leading zeroes added)
- --H Hours (24) (no leading zeroes added)
- --Z am/pm
- --I Hours (12)
- --j Day of Year (0 - 399)
- --w Day of Week as Number
- --Y Year
- --C Cycle as number (0 - 1)
- --m Month of year as number
- --d Day of month
- --B Month of year as string
- --b Month of year as abbreviated string
- --A Day of week as string
- --a Day of week as abbreviated string
- --P Cycle as string
- --p Cycle as abbreviated string
- --special_day Does what it says
- --D if not a special day then the day of the week else the day name
- end -- End Time Query.
- function z( iIn ) --Add leading zeroes.
- if iIn < 10 then return "0" .. tostring(iIn) else return tostring(iIn) end
- end
- function Ord( iIn ) --returns the Ordinal number of iIn.
- tiIn = iIn
- if tiIn > 14 then tiIn = math.fmod(tiIn, 10) end
- if tiIn == 1 then return tostring(iIn).."st" end
- if tiIn == 2 then return tostring(iIn).."nd" end
- if tiIn == 3 then return tostring(iIn).."rd" end
- return tostring(iIn).."th"
- end
- function DoPrompt(sName, sLine, wildcards)
- width = WindowTextWidth (XPWin, "f", "Lazy dog yawns") -- width of text (270)
- height = WindowFontInfo (XPWin, "f", 1) -- height of the font (46)
- ascent = WindowFontInfo (XPWin, "f", 2) -- ascent (amount above the baseline) (36)
- descent = WindowFontInfo (XPWin, "f", 3) -- descent (amount below the baseline) (10)
- leading = WindowFontInfo (XPWin, "f", 4) -- leading (space above the highest letter) (9)
- width2 = WindowTextWidth (XPWin, "f2", "Lazy dog yawns") -- width of text (270)
- height2 = WindowFontInfo (XPWin, "f2", 1) -- height of the font (46)
- if SETTINGS.DOUBLEWIN then
- localheight = HEIGHT*2
- else
- localheight = HEIGHT
- end
- WindowCreate (XPWin, 0, 0, bar_width, localheight, mushvar.xppos, 0, ColourNameToRGB("black")) -- create window
- -- Button frames
- WindowCircleOp (XPWin, 3, 3, 5, INDENT, BUTTON_HEIGHT+5, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT+3+5, INDENT, BUTTON_HEIGHT*2+3+5, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT*2+3+3+5, INDENT, BUTTON_HEIGHT*3+3+3+5, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT*3+3+3+3+5, INDENT, BUTTON_HEIGHT*4+3+3+3+5, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- -- Graph frame
- WindowCircleOp (XPWin, 3, INDENT-15, 0, bar_width, localheight, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.BACKGROUND, 0, 15, 15)
- if TAB_SHOW == 1 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 1 then
- if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 1 then
- offset = HEIGHT
- else
- offset = 0
- end
- WindowGradient (XPWin, 5, 6, INDENT-13, BUTTON_HEIGHT+3,
- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
- -- how many worm points?
- tick = tonumber(GRAPH_WIDTH/60)
- -- Graph borders
- WindowLine (XPWin, INDENT, HEIGHT-(FOOTER+100)+offset, INDENT, HEIGHT-FOOTER+offset, COLOURS.TEXT, 0, 2)
- WindowLine (XPWin, INDENT, HEIGHT-FOOTER+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER+offset, COLOURS.TEXT, 0, 2)
- -- Graph scale lines
- WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-SPACE+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-SPACE+offset, COLOURS.TEXT, 2, 1)
- WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*2)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*2)+offset, COLOURS.TEXT, 2, 1)
- WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*3)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*3)+offset, COLOURS.TEXT, 2, 1)
- WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*4)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*4)+offset, COLOURS.TEXT, 2, 1)
- WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*5)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*5)+offset, COLOURS.TEXT, 2, 1)
- -- Draw delta worm
- if SETTINGS.XPDETAIL_SHOW then
- count = 0
- oldv = tonumber(HEIGHT-FOOTER-dpoints [1])
- for k, v in ipairs (dpoints) do
- count = count or 0
- oldv = oldv or tonumber(HEIGHT-FOOTER-0)
- newv = tonumber(HEIGHT-FOOTER-v)
- WindowLine (XPWin, INDENT+tick*count, oldv+offset, INDENT+tick*(count+1), newv+offset, ColourNameToRGB ("green"), 0, 2)
- count = count + 1
- oldv = newv
- end -- for
- end -- if
- count = 0
- oldv = tonumber(HEIGHT-FOOTER-points [1])
- -- Draw worm
- for k, v in ipairs (points) do
- count = count or 0
- oldv = oldv or tonumber(HEIGHT-FOOTER-0)
- newv = tonumber(HEIGHT-FOOTER-v)
- WindowLine (XPWin, INDENT+tick*count, oldv+offset, INDENT+tick*(count+1), newv+offset, ColourNameToRGB ("blue"), 0, 2)
- count = count + 1
- oldv = newv
- end -- for
- --rate_text_width = (WindowTextWidth (XPWin, "f2", rate_text))
- time_text_width = (WindowTextWidth (XPWin, "f2", time_text))
- WindowText (XPWin, "f2", xp_text, INDENT-8, 1+offset, 0, 0, COLOURS.TEXT, false)
- WindowText (XPWin, "f2", time_text, INDENT-8, height2+offset, 0, 0, COLOURS.TEXT, false)
- WindowText (XPWin, "f2", av_text, INDENT-8, height2*2+offset, 0, 0, COLOURS.TEXT, false)
- -- Graph key
- WindowText (XPWin, "f2", "2", INDENT-9, HEIGHT-FOOTER-(SPACE*1)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
- WindowText (XPWin, "f2", "4", INDENT-9, HEIGHT-FOOTER-(SPACE*2)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
- WindowText (XPWin, "f2", "6", INDENT-9, HEIGHT-FOOTER-(SPACE*3)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
- WindowText (XPWin, "f2", "8", INDENT-9, HEIGHT-FOOTER-(SPACE*4)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
- -- XP rate reset hotspot
- WindowAddHotspot(XPWin, "XPRatehs", -- hotspot name
- INDENT-13, 2+offset, bar_width-2, height2*3+offset, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Reset XP Rate", -- tooltip text
- 1, 0) -- hand cursor
- -- XP graph reset hotspot
- WindowAddHotspot(XPWin, "XPGraphhs", -- hotspot name
- INDENT-13, height2*3+5+offset, bar_width-2, HEIGHT-2+offset, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Reset Graph", -- tooltip text
- 1, 0) -- hand cursor
- end -- if tab 1
- if TAB_SHOW == 2 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 2 then
- if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 2 then
- offset = HEIGHT
- else
- offset = 0
- end
- WindowGradient (XPWin, 5, BUTTON_HEIGHT+3+6, INDENT-13, BUTTON_HEIGHT*2+3+3,
- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
- attack_text = string.format("Attacks per round: " .. mushvar.hitrate)
- WindowText (XPWin, "f2", attack_text, INDENT-11, 2+offset, 0, 0, COLOURS.TEXT, false)
- vertical = 2+height2+offset -- pixel to start at
- DoGauge (XPWin, "Hits ", mushvar.percentlaunched / 100, COLOURS.OHITS, mushvar.successhits .. " (" .. mushvar.percentlaunched .. "%)", "OHitshs")
- DoGauge (XPWin, "Special ", mushvar.percentspecialhit / 100, COLOURS.OSPECIALS, mushvar.successspecials .. " (" .. mushvar.percentspecialhit .. "%)", "OSpecialshs")
- DoGauge (XPWin, "Parry ", mushvar.percentparried / 100, COLOURS.DPARRY, mushvar.parriedhits .. " (" .. mushvar.percentparried .. "%)", "DParryhs")
- DoGauge (XPWin, "Dodge ", mushvar.percentdodged / 100, COLOURS.DDODGE, mushvar.dodgedhits .. " (" .. mushvar.percentdodged .. "%)", "DDodgehs")
- DoGauge (XPWin, "Block ", mushvar.percentblocked / 100, COLOURS.DBLOCK, mushvar.blockedhits .. " (" .. mushvar.percentblocked .. "%)", "DBlockedhs")
- DoGauge (XPWin, "Shield ", mushvar.percentshielded / 100, COLOURS.DSHIELD, mushvar.armourhits .. " (" .. mushvar.percentshielded .. "%)", "DShieldshs")
- DoGauge (XPWin, "Hits ", mushvar.percenthit / 100, COLOURS.DHITS, mushvar.totalhit .. " (" .. mushvar.percenthit .. "%)", "DHitshs")
- -- Combat stats reset hotspot
- WindowAddHotspot(XPWin, "Combaths", -- hotspot name
- INDENT-13, 2+offset, INDENT+20, HEIGHT-2+offset, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Reset Combat statistics", -- tooltip text
- 1, 0) -- hand cursor
- end -- if tab 2
- if TAB_SHOW == 3 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 3 then
- if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN==3 then
- offset = HEIGHT
- else
- offset = 0
- end
- WindowGradient (XPWin, 5, BUTTON_HEIGHT*2+3+3+6, INDENT-13, BUTTON_HEIGHT*3+3+3+3,
- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
- S, M, H, Z, I, j, w, Y, C, m, d, B, b, A, a, P, p, special_day, D = unix_to_disc_time()
- time_text_1 = string.format (I..":"..z(M)..Z)
- time_text_2 = string.format (D.." "..Ord(d).." "..B.." "..P..", UC "..Y..".")
- -- map title set up
- local id = "f2"
- local left_margin = INDENT-5
- local right_margin = 5
- local width = bar_width
- -- derive stuff from font
- local space_width = WindowTextWidth (XPWin, id, " ")
- local line_height = WindowFontInfo (XPWin, id, 1)
- WindowText (XPWin, "f", time_text_1, INDENT-5, HEIGHT-(line_height*3)-5+offset, 0, 0, COLOURS.TEXT, false)
- -- starting point
- local x = left_margin
- local y = HEIGHT-(line_height*2)-2+offset
- local counter = 0
- -- do each word
- message = time_text_2
- for word in string.gmatch (message, "%S+") do
- local word_width = WindowTextWidth (XPWin, id, word)
- -- time to start a new line?
- if (word_width + x) > (width - right_margin) and (x > left_margin) then
- y = y + line_height
- x = left_margin
- counter = counter + 1
- end -- if
- -- draw the text
- WindowText (XPWin, id, word, x, y, 0, map_height-10+offset, COLOURS.TEXT)
- -- advance past the word and a single space
- x = x + word_width + space_width
- end -- for loop
- end -- if tab 3
- if TAB_SHOW == 4 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 4 then
- --Group status tab
- if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 4 then
- offset = HEIGHT
- else
- offset = 0
- end
- WindowGradient (XPWin, 5, BUTTON_HEIGHT*3+3+3+3+6, INDENT-13, BUTTON_HEIGHT*4+3+3+3+3,
- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
- grp_text = string.format("Group members: " .. groupnumber)
- WindowText (XPWin, "f2", grp_text, INDENT-11, 2+offset, 0, 0, COLOURS.TEXT, false)
- local buttonbg = CalculateHalfColour(COLOURS.OUTLINE);
- WindowCircleOp (XPWin, 3, bar_width-40, 3+offset, bar_width-5, 16+offset, -- round rectangle
- COLOURS.OUTLINE, 0, 1, buttonbg, 0, 4, 4)
- --WindowRectOp (XPWin, 2, bar_width-15, 59, bar_width-2, 75, mapbg ) -- fill entire box
- --WindowRectOp (XPWin, 1, bar_width-15, 59, bar_width-1, 75, COLOURS.OUTLINE ) -- border
- WindowText (XPWin, "f2", "Reset", bar_width-35, 3+offset, bar_width-5, 16+offset, 0)
- WindowText (XPWin, "f2", "Reset", bar_width-36, 2+offset, bar_width-5, 16+offset, ColourNameToRGB("gray"))
- vertical = 4+height2+offset -- pixel to start at
- -- loop over each group member
- for k,v in pairs(ArrayList("group")) do
- DoShields(XPWin, ArrayGet("numbers", k), ArrayGet(k, "player"), k, vertical)
- end
- -- Group stats update hotspot
- WindowAddHotspot(XPWin, "Grouphs", -- hotspot name
- INDENT-13, 17+offset, INDENT+bar_width-5, HEIGHT-2+offset, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Refresh Group statistics", -- tooltip text
- 1, 0) -- hand cursor
- -- Group reset hotspot
- WindowAddHotspot(XPWin, "Groupreseths", -- hotspot name
- bar_width-40, 3+offset, bar_width-6, 16+offset, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Reset Group details", -- tooltip text
- 1, 0) -- hand cursor
- end -- if tab 4
- XPTAB_TEXT = string.format("XP")
- -- xp tab text
- WindowText (XPWin, "f", XPTAB_TEXT, 8, (BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
- -- xp tab hotspot
- WindowAddHotspot(XPWin, "XPTABhs", -- hotspot name
- 3, 5, INDENT-15, BUTTON_HEIGHT+5, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Show XP tab", -- tooltip text
- 1, 0) -- hand cursor
- Off_TAB_TEXT = string.format("Co")
- -- Combat stats Tab text
- WindowText (XPWin, "f", Off_TAB_TEXT, 8, BUTTON_HEIGHT+3+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
- -- Combat stats Tab hotspot
- WindowAddHotspot(XPWin, "Off_TABhs", -- hotspot name
- 3, BUTTON_HEIGHT+3+5, INDENT-15, BUTTON_HEIGHT*2+3+5, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Show Combat Statistics tab", -- tooltip text
- 1, 0) -- hand cursor
- Def_TAB_TEXT = string.format("Ti")
- -- Def Tab text
- WindowText (XPWin, "f", Def_TAB_TEXT, 7, BUTTON_HEIGHT*2+6+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
- -- Def Tab hotspot
- WindowAddHotspot(XPWin, "Def_TABhs", -- hotspot name
- 3, BUTTON_HEIGHT*2+3+3+5, INDENT-15, BUTTON_HEIGHT*3+3+3+5, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Show Misc tab", -- tooltip text
- 1, 0) -- hand cursor
- Grp_TAB_TEXT = string.format("Gr")
- -- Group stats Tab text
- WindowText (XPWin, "f", Grp_TAB_TEXT, 8, BUTTON_HEIGHT*3+9+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
- -- Group stats Tab hotspot
- WindowAddHotspot(XPWin, "Grp_TABhs", -- hotspot name
- 3, BUTTON_HEIGHT*3+3+3+3+5, INDENT-15, BUTTON_HEIGHT*4+3+3+3+5, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Show Group Status tab", -- tooltip text
- 1, 0) -- hand cursor
- WindowShow (XPWin, true) -- show it
- end -- DoPrompt
- function CalculateHalfColour(col)
- local cr = math.floor(tonumber(string.sub(ColourString(col),5,6),16) / 2);
- local cg = math.floor(tonumber(string.sub(ColourString(col),3,4),16) / 2);
- local cb = math.floor(tonumber(string.sub(ColourString(col),1,2),16) / 2);
- return cr + cg*256 + cb*65536;
- end
- function DoGauge (Window, sPrompt, Percent, Colour, BarText, HSname, Percentadd)
- local Fraction = tonumber (Percent)
- GAUGE_HEIGHT = 17
- if Fraction > 1 then Fraction = 1 end
- --if Fraction == 0 then return end
- local width = WindowTextWidth (Window, "f2", sPrompt)
- WindowText (Window, "f2", sPrompt, INDENT-11, vertical+1, 0, 0, COLOURS.TEXT)
- WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
- local gauge_width = (bar_width - INDENT - 25 - 5) * Fraction
- -- box size must be > 0 or WindowGradient fills the whole thing
- if math.floor (gauge_width) > 0 then
- -- top half
- WindowGradient (Window, INDENT+25, vertical, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2,
- 0x000000, Colour, 2)
- -- bottom half
- WindowGradient (Window, INDENT+25, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT,
- Colour, 0x000000, 2)
- if Percentadd ~= nil and Percentadd > 0 then
- --draw additional bar bit
- local add_width = (bar_width - INDENT - 25 - 5) * (tonumber(Percentadd) - tonumber(Percent))
- local halfcol = CalculateHalfColour(Colour)
- -- top half
- WindowGradient (Window, INDENT+25 + gauge_width, vertical, INDENT+25 + gauge_width + add_width, vertical + GAUGE_HEIGHT / 2,
- 0x000000, halfcol, 2)
- -- bottom half
- WindowGradient (Window, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width+add_width,
- vertical + GAUGE_HEIGHT, halfcol, 0x000000, 2)
- end
- end -- non-zero
- WindowText (Window, "f2", BarText,
- INDENT + 36, vertical+2, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", BarText,
- INDENT + 35, vertical+1, 0, 0, COLOURS.TEXT)
- -- draw a box around it
- check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT,
- ColourNameToRGB ("dimgray"))) -- frame entire box
- -- add hotspot
- WindowAddHotspot(Window, HSname, -- hotspot name
- INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Bar Colour", -- tooltip text
- 1, 0) -- hand cursor
- vertical = vertical + GAUGE_HEIGHT + 2
- end -- function
- function DoGauge2 (Window, sPrompt, Percent, Colour, BarText, HSname,Percentadd)
- local Fraction = tonumber (Percent)
- GAUGE_HEIGHT = 17
- if Fraction > 1 then Fraction = 1 end
- --if Fraction == 0 then return end
- local width = WindowTextWidth (Window, "f2", sPrompt)
- WindowText (Window, "f2", sPrompt,
- INDENT-11, vertical+1, 0, 0, COLOURS.TEXT)
- WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
- local gauge_width = (bar_width - INDENT - 25 - 5) * Fraction
- -- box size must be > 0 or WindowGradient fills the whole thing
- if math.floor (gauge_width) > 0 then
- -- top half
- WindowGradient (Window, INDENT+25, vertical, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2,
- 0x000000, Colour, 2)
- -- bottom half
- WindowGradient (Window, INDENT+25, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT,
- Colour, 0x000000, 2)
- if Percentadd ~= nil then
- --draw additional bar bit
- local add_width = (bar_width - INDENT - 25 - 5) * (tonumber(Percentadd) - tonumber(Percent))
- local halfcol = CalculateHalfColour(Colour)
- -- top half
- WindowGradient (Window, INDENT+25 + gauge_width, vertical, INDENT+25 + gauge_width + add_width, vertical + GAUGE_HEIGHT / 2,
- 0x000000, halfcol, 2)
- -- bottom half
- WindowGradient (Window, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width+add_width,
- vertical + GAUGE_HEIGHT, halfcol, 0x000000, 2)
- end
- end -- non-zero
- WindowText (Window, "f2", BarText,
- INDENT + 36, vertical+2, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", BarText,
- INDENT + 35, vertical+1, 0, 0, COLOURS.TEXT)
- -- draw a box around it
- check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT,
- ColourNameToRGB ("dimgray"))) -- frame entire box
- -- add hotspot
- WindowAddHotspot(Window, HSname .. "high", -- hotspot name
- bar_width-40, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change High Bar Colour", -- tooltip text
- 1, 0) -- hand cursor
- WindowAddHotspot(Window, HSname .. "med", -- hotspot name
- bar_width-80, vertical, bar_width - 40, vertical + GAUGE_HEIGHT, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Medium Bar Colour", -- tooltip text
- 1, 0) -- hand cursor
- WindowAddHotspot(Window, HSname .. "low", -- hotspot name
- INDENT+25, vertical, bar_width - 80, vertical + GAUGE_HEIGHT, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Low Bar Colour", -- tooltip text
- 1, 0) -- hand cursor
- vertical = vertical + GAUGE_HEIGHT + 2
- end -- function DoGauge2
- function DrawGradBar(Window, xstart,ystart,xmax,ymax,fract, Colour, Cmed, Clow)
- local xs = xmax * fract
- if xs >= 0 then
- if math.floor (xs) > 0 then
- if Cmed ~= nil then
- -- get colour from percentage if it's not specified
- Colour = ColourFromPercentage(fract * 100, Colour,Cmed,Clow)
- end
- -- top half
- WindowGradient (Window, xstart, ystart, xstart + xs, ystart + ymax/2,
- 0x000000, Colour, 2)
- -- bottom half
- WindowGradient (Window, xstart, ystart + ymax / 2, xstart + xs, ystart + ymax,
- Colour, 0x000000, 2)
- end -- non-zero
- else
- xs = xmax;
- -- draw gray bars
- -- top half
- WindowGradient (Window, xstart, ystart, xstart + xs, ystart + ymax/2,
- 0x000000, 0x333333, 2)
- -- bottom half
- WindowGradient (Window, xstart, ystart + ymax / 2, xstart + xs, ystart + ymax,
- 0x333333, 0x000000, 2)
- end
- end -- function DrawGradBar
- function DoShields (Window, vidx, sPrompt, ptable, vstart)
- -- local Fraction = tonumber (Percent)
- local Fraction = 0.5
- GAUGE_HEIGHT = 19
- local vertical = vstart + (vidx - 1) * (GAUGE_HEIGHT + 2)
- --if Fraction > 1 then Fraction = 1 end
- --if Fraction == 0 then return end
- local width = WindowTextWidth (Window, "f2", sPrompt)
- WindowText (Window, "f2", sPrompt,
- INDENT-11, vertical+2, 0, 0, COLOURS.TEXT)
- WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
- local hpfract = 0.5
- local gpfract = 0.5
- -- box size must be > 0 or WindowGradient fills the whole thing
- if SETTINGS.PERCENT_COLOURS then
- DrawGradBar(Window, INDENT+25, vertical, bar_width-INDENT-25-5, GAUGE_HEIGHT/2+1, ArrayGet(ptable,"hpf"),COLOURS.HPHIGH,COLOURS.HPMED,COLOURS.HPLOW)
- DrawGradBar(Window, INDENT+25, vertical+GAUGE_HEIGHT/2, bar_width-INDENT-25-5, GAUGE_HEIGHT/2, ArrayGet(ptable,"gpf"),COLOURS.GPHIGH,COLOURS.GPMED,COLOURS.GPLOW)
- else
- DrawGradBar(Window, INDENT+25, vertical, bar_width-INDENT-25-5, GAUGE_HEIGHT/2+1, ArrayGet(ptable,"hpf"), COLOURS.HP, nil, nil)
- DrawGradBar(Window, INDENT+25, vertical+GAUGE_HEIGHT/2, bar_width-INDENT-25-5, GAUGE_HEIGHT/2, ArrayGet(ptable,"gpf"), COLOURS.GP,nil,nil)
- end
- -- draw a box around it
- check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT/2 + 1,
- ColourNameToRGB ("dimgray"))) -- frame entire box
- check (WindowRectOp (Window, 1, INDENT+25, vertical + GAUGE_HEIGHT/2, bar_width - 5, vertical + GAUGE_HEIGHT,
- ColourNameToRGB ("dimgray"))) -- frame entire box
- -- add text for shields
- local ccc = 29
- local tpa = 53
- local eff = 76
- local kii = 98
- local ms = 113
- WindowText (Window, "f2", ArrayGet(ptable,"cccm"),
- INDENT + ccc+1, vertical+3, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", ArrayGet(ptable,"cccm"),
- INDENT + ccc, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"ccc")))
- WindowText (Window, "f2", ArrayGet(ptable,"tpam"),
- INDENT + tpa+1, vertical+3, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", ArrayGet(ptable,"tpam"),
- INDENT + tpa, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"tpa")))
- WindowText (Window, "f2", ArrayGet(ptable,"effm"),
- INDENT + eff+1, vertical+3, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", ArrayGet(ptable,"effm"),
- INDENT + eff, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"eff")))
- WindowText (Window, "f2", ArrayGet(ptable,"kiim"),
- INDENT + kii+1, vertical+3, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", ArrayGet(ptable,"kiim"),
- INDENT + kii, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"kii")))
- WindowText (Window, "f2", ArrayGet(ptable,"msm"),
- INDENT + ms+1, vertical+3, 0, 0, ColourNameToRGB "black")
- WindowText (Window, "f2", ArrayGet(ptable,"msm"),
- INDENT + ms, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"ms")))
- -- add hotspot
- -- WindowAddHotspot(Window, HSname, -- hotspot name
- -- INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
- -- "mouseover",
- -- "cancelmouseover",
- -- "mousedown",
- -- "cancelmousedown",
- -- "mouseup",
- -- "Change Bar Colour", -- tooltip text
- -- 1, 0) -- hand cursor
- end -- function DoShields
- -------------------------------------------------------------------------------------------
- -- Stats code
- -------------------------------------------------------------------------------------------
- function successfulhit (sName, sLine, wildcards)
- mushvar.successhits = mushvar.successhits + 1
- mushvar.attempted = mushvar.attempted + 1
- UpdateStatusAttack ()
- end -- successfulhit
- function missedhit (sName, sLine, wildcards)
- mushvar.attempted = mushvar.attempted + 1
- UpdateStatusAttack ()
- end -- missedhit
- function successfulspecial (sName, sLine, wildcards)
- mushvar.successspecials = mushvar.successspecials + 1
- mushvar.attemptedspecials = mushvar.attemptedspecials + 1
- UpdateStatusAttack ()
- end -- successfulspecial
- function missedspecial (sName, sLine, wildcards)
- mushvar.failspecials = mushvar.failspecials + 1
- mushvar.attemptedspecials = mushvar.attemptedspecials + 1
- UpdateStatusAttack ()
- end -- missedspecial
- function dodgecount (sName, sLine, wildcards)
- mushvar.dodgedhits = mushvar.dodgedhits + 1
- mushvar.totalenemyhits = mushvar.totalenemyhits + 1
- UpdateStatusDefend ()
- end -- dodgecount
- function parrycount (sName, sLine, wildcards)
- mushvar.parriedhits = mushvar.parriedhits + 1
- mushvar.totalenemyhits = mushvar.totalenemyhits + 1
- UpdateStatusDefend ()
- end -- parrycount
- function blockcount (sName, sLine, wildcards)
- mushvar.blockedhits = mushvar.blockedhits + 1
- mushvar.totalenemyhits = mushvar.totalenemyhits + 1
- UpdateStatusDefend ()
- end -- blockcount
- function armourcount (sName, sLine, wildcards)
- mushvar.armourhits = mushvar.armourhits + 1
- mushvar.totalenemyhits = mushvar.totalenemyhits + 1
- UpdateStatusDefend ()
- end -- armourcount
- function hitcount (sName, sLine, wildcards)
- mushvar.totalenemyhits = mushvar.totalenemyhits + 1
- UpdateStatusDefend ()
- end -- hitcount
- function UpdateStatusDefend (sName, sLine, wildcards)
- mushvar.totaldefend = mushvar.blockedhits + mushvar.dodgedhits + mushvar.parriedhits + mushvar.armourhits
- mushvar.totalhit = mushvar.totalenemyhits - mushvar.totaldefend
- mushvar.percentdefend = string.format ("%3.1f", (((mushvar.totaldefend * 100) / mushvar.totalenemyhits)))
- mushvar.percentparried = string.format ("%3.1f", (((mushvar.parriedhits * 100) / mushvar.totalenemyhits)))
- mushvar.percentdodged = string.format ("%3.1f", (((mushvar.dodgedhits * 100) / mushvar.totalenemyhits)))
- mushvar.percentblocked = string.format ("%3.1f", (((mushvar.blockedhits * 100) / mushvar.totalenemyhits)))
- --mushvar.percentparried = mushvar.percentparried + mushvar.percentblocked
- mushvar.percentshielded = string.format ("%3.1f", (((mushvar.armourhits * 100) / mushvar.totalenemyhits)))
- mushvar.percenthit = string.format ("%3.1f", (100 - mushvar.percentdefend))
- DoPrompt ()
- end -- updateStatusDefend
- function UpdateStatusAttack (sName, sLine, wildcards)
- if mushvar.attempted > 0 then
- mushvar.percentlaunched = string.format ("%3.1f", ((mushvar.successhits*100) / mushvar.attempted))
- else
- mushvar.percentlaunched = 0
- end --if
- if mushvar.attemptedspecials > 0 then
- mushvar.percentspecialhit = string.format ("%3.1f", ((mushvar.successspecials*100) / mushvar.attemptedspecials))
- else
- mushvar.percentspecialhit = 0
- end -- if
- mushvar.missedhits = mushvar.attempted - mushvar.successhits
- if mushvar.combatrounds > 0 then
- mushvar.hitrate = string.format ("%15.2f", (mushvar.attempted / mushvar.combatrounds))
- else
- mushvar.hitrate = mushvar.attempted
- end --if
- DoPrompt ()
- end -- updateStatusAttack
- --------------------------------------------------------------
- -- Alias command scripts ------------------------------------
- function GroupReportCombat (sName, sLine, wildcards)
- CompleteSet ()
- report_combat_text = string.format("Hits:" .. mushvar.successhits .. "(" .. mushvar.percentlaunched .. "%%), Specials:" .. mushvar.successspecials .. "(" .. mushvar.percentspecialhit .. "%%), P/Round:" .. mushvar.hitrate .. " | Parry:" .. mushvar.parriedhits .. "(" .. mushvar.percentparried .. "%%), Dodge:" .. mushvar.dodgedhits .. "(" .. mushvar.percentdodged .. "%%), Block:" .. mushvar.blockedhits .. "(" .. mushvar.percentblocked .. "%%), Shields:" .. mushvar.armourhits .. "(" .. mushvar.percentshielded .. "%%), Damage:" .. mushvar.totalhit .. "(" .. mushvar.percenthit .. "%%)")
- Execute("group say " .. report_combat_text)
- end -- GroupReportCombat
- function StatsToZero (sName, sLine, wildcards)
- mushvar.dodgedhits=0
- mushvar.parriedhits=0
- mushvar.blockedhits=0
- mushvar.armourhits=0
- mushvar.totalenemyhits=0
- mushvar.totaldefend=0
- mushvar.percentdefend=0
- mushvar.percentparried=0
- mushvar.percentdodged=0
- mushvar.percentblocked=0
- mushvar.percentshielded=0
- mushvar.percenthit=0
- mushvar.totalhit=0
- mushvar.percentlaunched=0
- mushvar.successhits=0
- mushvar.missedhits=0
- mushvar.attempted=0
- mushvar.combatrounds=0
- mushvar.hitrate=0
- mushvar.successspecials=0
- mushvar.failspecials=0
- mushvar.percentspecialhit=0
- mushvar.attemptedspecials=0
- CompleteSet ()
- end -- StatsToZero
- function ResetGroup (sName, sLine, wildcards)
- -- treat as though player's left the group, then re-get details
- group_leave()
- UpdateGroup(sName, sLine, wildcards)
- end -- ResetGroup
- function UpdateGroup (sName, sLine, wildcards)
- omitshieldtriggers("1")
- --SendNoEcho("group status brief\ngroup shields\nfrimble <end of shields list>")
- Queue("group status brief\ngroup shields\nfrimble <end of shields list>", false)
- end -- ResetGroup
- function displaycolours()
- Note("Current Trigger Colours:")
- Note("UPME: " .. TRIGCOL.UPME .. ": " .. TRIGCOL.UPMETEXT .. " on " .. TRIGCOL.UPMEBACK)
- Note("DNME: " .. TRIGCOL.DNME .. ": " .. TRIGCOL.DNMETEXT .. " on " .. TRIGCOL.DNMEBACK)
- Note("WKME: " .. TRIGCOL.WKME .. ": " .. TRIGCOL.WKMETEXT .. " on " .. TRIGCOL.WKMEBACK)
- Note("GOME: " .. TRIGCOL.GOME .. ": " .. TRIGCOL.GOMETEXT .. " on " .. TRIGCOL.GOMEBACK)
- Note("HTME: " .. TRIGCOL.HTME .. ": " .. TRIGCOL.HTMETEXT .. " on " .. TRIGCOL.HTMEBACK)
- Note(" ")
- Note("UPOT: " .. TRIGCOL.UPOT .. ": " .. TRIGCOL.UPOTTEXT .. " on " .. TRIGCOL.UPOTBACK)
- Note("DNOT: " .. TRIGCOL.DNOT .. ": " .. TRIGCOL.DNOTTEXT .. " on " .. TRIGCOL.DNOTBACK)
- Note("GOOT: " .. TRIGCOL.GOOT .. ": " .. TRIGCOL.GOOTTEXT .. " on " .. TRIGCOL.GOOTBACK)
- end -- displaycolours
- function toggledoublewin(name, line, wildcards)
- if wildcards.tab and wildcards.tab >= "1" and wildcards.tab <= "4" then
- SETTINGS.DWWIN = tonumber(wildcards.tab)
- SETTINGS.DOUBLEWIN = false --it will then get toggled by the remaining code
- end
- if not SETTINGS.DOUBLEWIN then
- SETTINGS.DOUBLEWIN = true
- Note("Now using double-length window (" .. SETTINGS.DWWIN ..").")
- XPMath()
- else
- SETTINGS.DOUBLEWIN = false
- Note("Now using single-length window.")
- XPMath()
- end
- end
- function toggleshowmxp(name, line, wildcards)
- if not SETTINGS.SHOWMXP then
- SETTINGS.SHOWMXP = true
- Note("Now displaying MXP debug messages.")
- else
- SETTINGS.SHOWMXP = false
- Note("Now hiding MXP debug messages.")
- end
- end
- function togglegroupjoin(name, line, wildcards)
- if not SETTINGS.GROUPJOIN then
- SETTINGS.GROUPJOIN = true
- Note("Automatic groupupdate on group join enabled.")
- else
- SETTINGS.GROUPJOIN = false
- Note("Automatic groupupdate on group join disabled.")
- end
- end
- function setgpding(name, line, wildcards)
- if wildcards.file ~= nil and wildcards.file and string.len(wildcards.file) > 0 then
- -- check file is valid by trying to play it..
- if wildcards.vol ~= nil and wildcards.vol and string.len(wildcards.vol) > 0 then
- SETTINGS.GPVOL = tonumber(wildcards.vol)
- if SETTINGS.GPVOL > 0 then
- SETTINGS.GPVOL = 0
- elseif SETTINGS.GPVOL < -100 then
- SETTINGS.GPVOL = -100
- end
- end
- if PlaySound(0,wildcards.file,false,SETTINGS.GPVOL) ~= 0 then
- Note("Cannot play " .. wildcards.file .. ". Disabling GP ding.")
- SETTINGS.GPDING = false
- else
- SETTINGS.GPFILE = wildcards.file
- SETTINGS.GPDING = true
- Note("Activating GP ding to play: " .. SETTINGS.GPFILE)
- end
- else
- -- just toggle state
- if not SETTINGS.GPDING then
- Note("Activating GP ding to play: " .. SETTINGS.GPFILE)
- SETTINGS.GPDING = true
- else
- Note("Deactiving GP ding.")
- SETTINGS.GPDING = false
- end
- end
- end
- function togglehitcolour(name, line, wildcards)
- if SETTINGS.HITCOLOUR == 1 then
- SETTINGS.HITCOLOUR = 0
- SetTriggerOption("hitcolourme1","enabled","0")
- SetTriggerOption("hitcolourme2","enabled","0")
- SetTriggerOption("hitcolourme3","enabled","0")
- SetTriggerOption("hitcolourme4","enabled","0")
- SetTriggerOption("hitcolourme5","enabled","0")
- SetTriggerOption("hitcolourme6","enabled","0")
- SetTriggerOption("hitcolourme7","enabled","0")
- SetTriggerOption("hitcolourmebad0","enabled","0")
- SetTriggerOption("hitcolourmebad1","enabled","0")
- SetTriggerOption("hitcolourmebad2","enabled","0")
- SetTriggerOption("hitcolourmebad3","enabled","0")
- SetTriggerOption("hitcolourmebad4","enabled","0")
- SetTriggerOption("hitcolourmebad5","enabled","0")
- SetTriggerOption("hitcolourmebad6","enabled","0")
- SetTriggerOption("hitcolourmebad7","enabled","0")
- SetTriggerOption("hitcolourother1","enabled","0")
- SetTriggerOption("hitcolourother2","enabled","0")
- SetTriggerOption("hitcolourother3","enabled","0")
- SetTriggerOption("hitcolourother4","enabled","0")
- SetTriggerOption("hitcolourother5","enabled","0")
- SetTriggerOption("hitcolourother6","enabled","0")
- SetTriggerOption("hitcolourother7","enabled","0")
- SetTriggerOption("hitcolourbad1","enabled","0")
- SetTriggerOption("hitcolourbad2","enabled","0")
- SetTriggerOption("hitcolourbad3","enabled","0")
- SetTriggerOption("hitcolourbad4","enabled","0")
- SetTriggerOption("hitcolourbad5","enabled","0")
- SetTriggerOption("hitcolourbad6","enabled","0")
- SetTriggerOption("hitcolourbad7","enabled","0")
- Note("Hit colours now disabled.")
- else
- SETTINGS.HITCOLOUR = 1
- SetTriggerOption("hitcolourme1","enabled","1")
- SetTriggerOption("hitcolourme2","enabled","1")
- SetTriggerOption("hitcolourme3","enabled","1")
- SetTriggerOption("hitcolourme4","enabled","1")
- SetTriggerOption("hitcolourme5","enabled","1")
- SetTriggerOption("hitcolourme6","enabled","1")
- SetTriggerOption("hitcolourme7","enabled","1")
- SetTriggerOption("hitcolourmebad0","enabled","1")
- SetTriggerOption("hitcolourmebad1","enabled","1")
- SetTriggerOption("hitcolourmebad2","enabled","1")
- SetTriggerOption("hitcolourmebad3","enabled","1")
- SetTriggerOption("hitcolourmebad4","enabled","1")
- SetTriggerOption("hitcolourmebad5","enabled","1")
- SetTriggerOption("hitcolourmebad6","enabled","1")
- SetTriggerOption("hitcolourmebad7","enabled","1")
- SetTriggerOption("hitcolourother1","enabled","1")
- SetTriggerOption("hitcolourother2","enabled","1")
- SetTriggerOption("hitcolourother3","enabled","1")
- SetTriggerOption("hitcolourother4","enabled","1")
- SetTriggerOption("hitcolourother5","enabled","1")
- SetTriggerOption("hitcolourother6","enabled","1")
- SetTriggerOption("hitcolourother7","enabled","1")
- SetTriggerOption("hitcolourbad1","enabled","1")
- SetTriggerOption("hitcolourbad2","enabled","1")
- SetTriggerOption("hitcolourbad3","enabled","1")
- SetTriggerOption("hitcolourbad4","enabled","1")
- SetTriggerOption("hitcolourbad5","enabled","1")
- SetTriggerOption("hitcolourbad6","enabled","1")
- SetTriggerOption("hitcolourbad7","enabled","1")
- Note("Hit colours now enabled.")
- end
- end
- function togglecombatspam(name, line, wildcards)
- if SETTINGS.COMBAT == 0 then
- SETTINGS.COMBAT = 1
- SetTriggerOption("combatspam","custom_colour","17")
- SetTriggerOption("combatspam","omit_from_output","0")
- Note("Now greying out combat spam.")
- elseif SETTINGS.COMBAT == 1 then
- SETTINGS.COMBAT = 2
- SetTriggerOption("combatspam","custom_colour","0")
- SetTriggerOption("combatspam","omit_from_output","1")
- Note("Now hiding combat spam.")
- else
- SETTINGS.COMBAT = 0
- SetTriggerOption("combatspam","custom_colour","0")
- SetTriggerOption("combatspam","omit_from_output","0")
- Note("Now applying no effects to combat spam.")
- end
- end
- function toggleidlespam(name, line, wildcards)
- if SETTINGS.IDLE == 0 then
- SETTINGS.IDLE = 1
- SetTriggerOption("idlespam","custom_colour","17")
- SetTriggerOption("idlespam","omit_from_output","0")
- SetTriggerOption("idlespam","enabled","1")
- SetTriggerOption("idlespam2","custom_colour","17")
- SetTriggerOption("idlespam2","omit_from_output","0")
- SetTriggerOption("idlespam2","enabled","1")
- SetTriggerOption("idlespam3","custom_colour","17")
- SetTriggerOption("idlespam3","omit_from_output","0")
- SetTriggerOption("idlespam3","enabled","1")
- SetTriggerOption("idlespam4","custom_colour","17")
- SetTriggerOption("idlespam4","omit_from_output","0")
- SetTriggerOption("idlespam4","enabled","1")
- SetTriggerOption("idlespam5","custom_colour","17")
- SetTriggerOption("idlespam5","omit_from_output","0")
- SetTriggerOption("idlespam5","enabled","1")
- Note("Now greying out idle spam.")
- elseif SETTINGS.IDLE == 1 then
- SETTINGS.IDLE = 2
- SetTriggerOption("idlespam","custom_colour","0")
- SetTriggerOption("idlespam","omit_from_output","1")
- SetTriggerOption("idlespam","enabled","1")
- SetTriggerOption("idlespam2","custom_colour","0")
- SetTriggerOption("idlespam2","omit_from_output","1")
- SetTriggerOption("idlespam2","enabled","1")
- SetTriggerOption("idlespam3","custom_colour","0")
- SetTriggerOption("idlespam3","omit_from_output","1")
- SetTriggerOption("idlespam3","enabled","1")
- SetTriggerOption("idlespam4","custom_colour","0")
- SetTriggerOption("idlespam4","omit_from_output","1")
- SetTriggerOption("idlespam4","enabled","1")
- SetTriggerOption("idlespam5","custom_colour","0")
- SetTriggerOption("idlespam5","omit_from_output","1")
- SetTriggerOption("idlespam5","enabled","1")
- Note("Now hiding idle spam.")
- else
- SETTINGS.IDLE = 0
- SetTriggerOption("idlespam","custom_colour","0")
- SetTriggerOption("idlespam","omit_from_output","0")
- SetTriggerOption("idlespam","enabled","0")
- SetTriggerOption("idlespam2","custom_colour","0")
- SetTriggerOption("idlespam2","omit_from_output","0")
- SetTriggerOption("idlespam2","enabled","0")
- SetTriggerOption("idlespam3","custom_colour","0")
- SetTriggerOption("idlespam3","omit_from_output","0")
- SetTriggerOption("idlespam3","enabled","0")
- SetTriggerOption("idlespam4","custom_colour","0")
- SetTriggerOption("idlespam4","omit_from_output","0")
- SetTriggerOption("idlespam4","enabled","0")
- SetTriggerOption("idlespam5","custom_colour","0")
- SetTriggerOption("idlespam5","omit_from_output","0")
- SetTriggerOption("idlespam5","enabled","0")
- Note("Now applying no effects to idle spam.")
- end
- end
- function setgpregen(name, line, wildcards)
- if wildcards.rate ~= nil and string.len(wildcards.rate) > 0 then
- Note("Setting gp regeneration rate to: " .. wildcards.rate)
- mushvar.gptick = tonumber(wildcards.rate)
- end
- end
- function settriggercolours(name, line, wildcards)
- if name == "settriggercolouralias" then
- -- enact change
- local type = string.upper(wildcards.what) .. string.upper(wildcards.who)
- if TRIGCOL [type] == nil or TRIGCOL[type] == "" then
- Note("Unrecognised trigger type string (" .. type ..")!")
- return
- end
- if (wildcards.fore == "" or wildcards.fore == false) and (wildcards.code == "" or wildcards.code == false) then
- Note("Setting " .. type .. " to defaults.")
- TRIGCOL [type] = DEFTRIGCOL [type]
- TRIGCOL [type.."TEXT"] = DEFTRIGCOL [type.."TEXT"]
- TRIGCOL [type.."BACK"] = DEFTRIGCOL [type.."BACK"]
- else
- if wildcards.code ~= "" then
- if tonumber(wildcards.code) < 0 or tonumber(wildcards.code) > 17 then
- Note("Unrecognised colour code (" .. wildcards.code .. ")!")
- return
- end
- TRIGCOL[type] = tostring(wildcards.code)
- Note("Setting " .. type .. " to be custom colour " .. TRIGCOL[type] .. ".")
- else
- TRIGCOL[type] = "17" -- force custom colour to enact change
- TRIGCOL[type.."TEXT"] = tostring(wildcards.fore)
- if wildcards.back then
- TRIGCOL[type.."BACK"] = tostring(wildcards.back)
- Note("Setting " .. type .. " colours to be " .. TRIGCOL[type.."TEXT"] .. " on " .. TRIGCOL[type.."BACK"] .. ".")
- else
- Note("Setting " .. type .. " colours to be " .. TRIGCOL[type.."TEXT"] .. " on black.")
- TRIGCOL[type.."BACK"] = "black"
- end
- end
- end
- end
- --displaycolours()
- if SETTINGS.TRIGGER_COLOURS then
- SetTriggerOption("up_me__kii","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me__eff","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me__tpa","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me2_tpa","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me__ccc","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me__major","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("up_me2_major","custom_colour",TRIGCOL.UPME)
- SetTriggerOption("dn_me__kii","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("dn_me2_kii","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("dn_me__eff","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("dn_me__tpa","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("dn_me__ccc","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("dn_me__major","custom_colour",TRIGCOL.DNME)
- SetTriggerOption("up_ot__kii","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("up_ot__eff","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("up_ot__tpa","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("up_ot2_tpa","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("up_ot__ccc","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("up_ot__major","custom_colour",TRIGCOL.UPOT)
- SetTriggerOption("dn_ot__kii","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot2_kii","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot__eff","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot2_eff","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot__tpa","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot__ccc","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("dn_ot__major","custom_colour",TRIGCOL.DNOT)
- SetTriggerOption("up_ot3_tpa","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("up_ot4_tpa","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("up_ot5_tpa","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("up_ot6_tpa","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("up_me3_tpa","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("up_me4_tpa","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("up_me5_tpa","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("up_me6_tpa","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("up_me2_kii","custom_colour",TRIGCOL.WKME)
- SetTriggerOption("wk_me__major","custom_colour",TRIGCOL.WKME)
- SetTriggerOption("wk_me__kii","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("wk_me__tpa","custom_colour",TRIGCOL.GOME)
- SetTriggerOption("wk_ot__major","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("wk_ot__kii","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("wk_ot__tpa","custom_colour",TRIGCOL.GOOT)
- SetTriggerOption("combathit","custom_colour",TRIGCOL.HTME)
- -- set actual colours
- SetTriggerOption("up_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me__eff","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me__eff","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me2_tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me2_tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("up_me2_major","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
- SetTriggerOption("up_me2_major","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
- SetTriggerOption("dn_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("dn_me2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("dn_me__eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me__eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("dn_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("dn_me__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("dn_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
- SetTriggerOption("dn_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
- SetTriggerOption("up_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("up_ot__eff","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot__eff","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("up_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("up_ot2_tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot2_tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("up_ot__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("up_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
- SetTriggerOption("up_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
- SetTriggerOption("dn_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot__eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot__eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot2_eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot2_eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("dn_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
- SetTriggerOption("dn_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
- SetTriggerOption("up_ot3_tpa","other_text_colour",ColourNameToRGB("crimson"))
- SetTriggerOption("up_ot4_tpa","other_text_colour",ColourNameToRGB("red"))
- SetTriggerOption("up_ot5_tpa","other_text_colour",ColourNameToRGB("orange"))
- SetTriggerOption("up_ot6_tpa","other_text_colour",ColourNameToRGB("yellow"))
- SetTriggerOption("up_me3_tpa","other_text_colour",ColourNameToRGB("crimson"))
- SetTriggerOption("up_me4_tpa","other_text_colour",ColourNameToRGB("red"))
- SetTriggerOption("up_me5_tpa","other_text_colour",ColourNameToRGB("orange"))
- SetTriggerOption("up_me6_tpa","other_text_colour",ColourNameToRGB("yellow"))
- SetTriggerOption("up_me2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.WKMETEXT))
- SetTriggerOption("up_me2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.WKMEBACK))
- SetTriggerOption("wk_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.WKMETEXT))
- SetTriggerOption("wk_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.WKMEBACK))
- SetTriggerOption("wk_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
- SetTriggerOption("wk_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
- SetTriggerOption("wk_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
- SetTriggerOption("wk_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
- SetTriggerOption("wk_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.GOOTTEXT))
- SetTriggerOption("wk_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.GOOTBACK))
- SetTriggerOption("wk_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.GOOTTEXT))
- SetTriggerOption("wk_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.GOOTBACK))
- SetTriggerOption("wk_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
- SetTriggerOption("wk_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
- SetTriggerOption("combathit","other_text_colour",ColourNameToRGB(TRIGCOL.HTMETEXT))
- SetTriggerOption("combathit","other_back_colour",ColourNameToRGB(TRIGCOL.HTMEBACK))
- else
- SetTriggerOption("up_me__kii","custom_colour","0")
- SetTriggerOption("up_me__eff","custom_colour","0")
- SetTriggerOption("up_me__tpa","custom_colour","0")
- SetTriggerOption("up_me2_tpa","custom_colour","0")
- SetTriggerOption("up_me__ccc","custom_colour","0")
- SetTriggerOption("up_me__major","custom_colour","0")
- SetTriggerOption("up_me2_major","custom_colour","0")
- SetTriggerOption("dn_me__kii","custom_colour","0")
- SetTriggerOption("dn_me2_kii","custom_colour","0")
- SetTriggerOption("dn_me__eff","custom_colour","0")
- SetTriggerOption("dn_me__tpa","custom_colour","0")
- SetTriggerOption("dn_me__ccc","custom_colour","0")
- SetTriggerOption("dn_me__major","custom_colour","0")
- SetTriggerOption("up_ot__kii","custom_colour","0")
- SetTriggerOption("up_ot__eff","custom_colour","0")
- SetTriggerOption("up_ot__tpa","custom_colour","0")
- SetTriggerOption("up_ot2_tpa","custom_colour","0")
- SetTriggerOption("up_ot__ccc","custom_colour","0")
- SetTriggerOption("up_ot__major","custom_colour","0")
- SetTriggerOption("dn_ot__kii","custom_colour","0")
- SetTriggerOption("dn_ot2_kii","custom_colour","0")
- SetTriggerOption("dn_ot__eff","custom_colour","0")
- SetTriggerOption("dn_ot2_eff","custom_colour","0")
- SetTriggerOption("dn_ot__tpa","custom_colour","0")
- SetTriggerOption("dn_ot__ccc","custom_colour","0")
- SetTriggerOption("dn_ot__major","custom_colour","0")
- SetTriggerOption("up_ot3_tpa","custom_colour","0")
- SetTriggerOption("up_ot4_tpa","custom_colour","0")
- SetTriggerOption("up_ot5_tpa","custom_colour","0")
- SetTriggerOption("up_ot6_tpa","custom_colour","0")
- SetTriggerOption("up_me3_tpa","custom_colour","0")
- SetTriggerOption("up_me4_tpa","custom_colour","0")
- SetTriggerOption("up_me5_tpa","custom_colour","0")
- SetTriggerOption("up_me6_tpa","custom_colour","0")
- SetTriggerOption("up_me2_kii","custom_colour","0")
- SetTriggerOption("wk_me__major","custom_colour","0")
- SetTriggerOption("wk_me__kii","custom_colour","0")
- SetTriggerOption("wk_me__tpa","custom_colour","0")
- SetTriggerOption("wk_ot__major","custom_colour","0")
- SetTriggerOption("wk_ot__kii","custom_colour","0")
- SetTriggerOption("wk_ot__tpa","custom_colour","0")
- SetTriggerOption("combathit","custom_colour","0")
- end
- if SETTINGS.TRIGGER_SHOW then
- SetTriggerOption("map_start","omit_from_output","0")
- SetTriggerOption("multi_line_map","omit_from_output","0")
- else
- SetTriggerOption("map_start","omit_from_output","1")
- SetTriggerOption("multi_line_map","omit_from_output","1")
- end
- if SETTINGS.COMBAT == 1 then
- SetTriggerOption("combatspam","custom_colour","17")
- SetTriggerOption("combatspam","omit_from_output","0")
- elseif SETTINGS.COMBAT == 2 then
- SetTriggerOption("combatspam","custom_colour","0")
- SetTriggerOption("combatspam","omit_from_output","1")
- else
- SetTriggerOption("combatspam","custom_colour","0")
- SetTriggerOption("combatspam","omit_from_output","0")
- end
- if SETTINGS.IDLE == 1 then
- SETTINGS.IDLE = 1
- SetTriggerOption("idlespam","custom_colour","17")
- SetTriggerOption("idlespam","omit_from_output","0")
- SetTriggerOption("idlespam","enabled","1")
- SetTriggerOption("idlespam2","custom_colour","17")
- SetTriggerOption("idlespam2","omit_from_output","0")
- SetTriggerOption("idlespam2","enabled","1")
- SetTriggerOption("idlespam3","custom_colour","17")
- SetTriggerOption("idlespam3","omit_from_output","0")
- SetTriggerOption("idlespam3","enabled","1")
- SetTriggerOption("idlespam4","custom_colour","17")
- SetTriggerOption("idlespam4","omit_from_output","0")
- SetTriggerOption("idlespam4","enabled","1")
- SetTriggerOption("idlespam5","custom_colour","17")
- SetTriggerOption("idlespam5","omit_from_output","0")
- SetTriggerOption("idlespam5","enabled","1")
- elseif SETTINGS.IDLE == 2 then
- SetTriggerOption("idlespam","custom_colour","0")
- SetTriggerOption("idlespam","omit_from_output","1")
- SetTriggerOption("idlespam","enabled","1")
- SetTriggerOption("idlespam2","custom_colour","0")
- SetTriggerOption("idlespam2","omit_from_output","1")
- SetTriggerOption("idlespam2","enabled","1")
- SetTriggerOption("idlespam3","custom_colour","0")
- SetTriggerOption("idlespam3","omit_from_output","1")
- SetTriggerOption("idlespam3","enabled","1")
- SetTriggerOption("idlespam4","custom_colour","0")
- SetTriggerOption("idlespam4","omit_from_output","1")
- SetTriggerOption("idlespam4","enabled","1")
- SetTriggerOption("idlespam5","custom_colour","0")
- SetTriggerOption("idlespam5","omit_from_output","1")
- SetTriggerOption("idlespam5","enabled","1")
- else
- SetTriggerOption("idlespam","custom_colour","0")
- SetTriggerOption("idlespam","omit_from_output","0")
- SetTriggerOption("idlespam","enabled","0")
- SetTriggerOption("idlespam2","custom_colour","0")
- SetTriggerOption("idlespam2","omit_from_output","0")
- SetTriggerOption("idlespam2","enabled","0")
- SetTriggerOption("idlespam3","custom_colour","0")
- SetTriggerOption("idlespam3","omit_from_output","0")
- SetTriggerOption("idlespam3","enabled","0")
- SetTriggerOption("idlespam4","custom_colour","0")
- SetTriggerOption("idlespam4","omit_from_output","0")
- SetTriggerOption("idlespam4","enabled","0")
- SetTriggerOption("idlespam5","custom_colour","0")
- SetTriggerOption("idlespam5","omit_from_output","0")
- SetTriggerOption("idlespam5","enabled","0")
- end
- if SETTINGS.HITCOLOUR == 0 then
- SetTriggerOption("hitcolourme1","enabled","0")
- SetTriggerOption("hitcolourme2","enabled","0")
- SetTriggerOption("hitcolourme3","enabled","0")
- SetTriggerOption("hitcolourme4","enabled","0")
- SetTriggerOption("hitcolourme5","enabled","0")
- SetTriggerOption("hitcolourme6","enabled","0")
- SetTriggerOption("hitcolourme7","enabled","0")
- SetTriggerOption("hitcolourother1","enabled","0")
- SetTriggerOption("hitcolourother2","enabled","0")
- SetTriggerOption("hitcolourother3","enabled","0")
- SetTriggerOption("hitcolourother4","enabled","0")
- SetTriggerOption("hitcolourother5","enabled","0")
- SetTriggerOption("hitcolourother6","enabled","0")
- SetTriggerOption("hitcolourother7","enabled","0")
- SetTriggerOption("hitcolourbad1","enabled","0")
- SetTriggerOption("hitcolourbad2","enabled","0")
- SetTriggerOption("hitcolourbad3","enabled","0")
- SetTriggerOption("hitcolourbad4","enabled","0")
- SetTriggerOption("hitcolourbad5","enabled","0")
- SetTriggerOption("hitcolourbad6","enabled","0")
- SetTriggerOption("hitcolourbad7","enabled","0")
- else
- SetTriggerOption("hitcolourme1","enabled","1")
- SetTriggerOption("hitcolourme2","enabled","1")
- SetTriggerOption("hitcolourme3","enabled","1")
- SetTriggerOption("hitcolourme4","enabled","1")
- SetTriggerOption("hitcolourme5","enabled","1")
- SetTriggerOption("hitcolourme6","enabled","1")
- SetTriggerOption("hitcolourme7","enabled","1")
- SetTriggerOption("hitcolourother1","enabled","1")
- SetTriggerOption("hitcolourother2","enabled","1")
- SetTriggerOption("hitcolourother3","enabled","1")
- SetTriggerOption("hitcolourother4","enabled","1")
- SetTriggerOption("hitcolourother5","enabled","1")
- SetTriggerOption("hitcolourother6","enabled","1")
- SetTriggerOption("hitcolourother7","enabled","1")
- SetTriggerOption("hitcolourbad1","enabled","1")
- SetTriggerOption("hitcolourbad2","enabled","1")
- SetTriggerOption("hitcolourbad3","enabled","1")
- SetTriggerOption("hitcolourbad4","enabled","1")
- SetTriggerOption("hitcolourbad5","enabled","1")
- SetTriggerOption("hitcolourbad6","enabled","1")
- SetTriggerOption("hitcolourbad7","enabled","1")
- end
- if not GROUP_TRIGGERS then
- setgrouptriggerenable("0")
- end
- end -- settriggercolours
- function toggletriggercolours ()
- if not SETTINGS.TRIGGER_COLOURS then
- SETTINGS.TRIGGER_COLOURS = true
- Note("Now using trigger colours.")
- settriggercolours()
- else
- SETTINGS.TRIGGER_COLOURS = false
- Note("Trigger colours now disabled.")
- settriggercolours()
- end
- end -- toggletriggercolours
- function toggletriggerhiding ()
- if SETTINGS.TRIGGER_SHOW then
- SetTriggerOption("map_start","omit_from_output","1")
- SetTriggerOption("multi_line_map","omit_from_output","1")
- SETTINGS.TRIGGER_SHOW = false
- Note("Now hiding the look map.")
- else
- SetTriggerOption("map_start","omit_from_output","0")
- SetTriggerOption("multi_line_map","omit_from_output","0")
- SETTINGS.TRIGGER_SHOW = true
- Note("Now showing the look map.")
- end
- end -- toggletriggerhiding
- function togglepercentcolours ()
- if SETTINGS.PERCENT_COLOURS then
- SETTINGS.PERCENT_COLOURS = false
- Note("Now using fixed bar colours.")
- else
- SETTINGS.PERCENT_COLOURS = true
- Note("Now using percentage bar colours.")
- end
- end -- togglepercentcolours
- function togglexpdetail(name, line, wildcards)
- if wildcards.avg ~= nil and wildcards.avg and string.len(wildcards.avg) > 0 then
- SETTINGS.XPDETAIL_AVG = math.floor(tonumber(wildcards.avg))
- if SETTINGS.XPDETAIL_AVG < 1 then
- SETTINGS.XPDETAIL_AVG = 1
- end
- if SETTINGS.XPDETAIL_AVG > 60 then
- SETTINGS.XPDETAIL_AVG = 60
- end
- SETTINGS.XPDETAIL_SHOW = true
- Note("Now showing xp details with averaging of " .. SETTINGS.XPDETAIL_AVG .. " mins.")
- -- recalculate current plot..
- local dprecalc, dpnum
- for i = 61-dcount,60 do
- dprecalc = 0
- dpnum = 0
- for j = math.max(61-dcount, i - SETTINGS.XPDETAIL_AVG + 1),i do
- dprecalc = dprecalc + dvals[j]
- dpnum = dpnum + 1
- end
- dprecalc = dprecalc * 60 / dpnum / 10000
- if dprecalc > 100 then
- dpoints[i] = 100
- elseif dprecalc < 0 then
- dpoints[i] = 0
- else
- dpoints[i] = dprecalc
- end -- if
- end
- else
- if SETTINGS.XPDETAIL_SHOW then
- SETTINGS.XPDETAIL_SHOW = false
- Note("Now hiding xp details.")
- else
- SETTINGS.XPDETAIL_SHOW = true
- Note("Now showing xp details.")
- end
- end
- DoPrompt()
- end -- togglexpdetail
- ------------------------------------------------
- -- Shield Bits --
- ------------------------------------------------
- function plus_one (name, line, wildcards)
- if wildcards.hp then
- hpv = (ArrayGet("hpt",wildcards.hp)-0.5) / 12;
- hpv = math.max(math.min(hpv,1),0)
- else
- hpv = -1;
- end
- if wildcards.gp and wildcards.gp ~= "" then
- gpv = (ArrayGet("gpt",wildcards.gp)-0.5) / 10;
- gpv = math.max(math.min(gpv,1),0)
- else
- gpv = -1;
- end
- if ArrayKeyExists ("group", string.lower(wildcards.player)) then
- local ptable = string.lower(wildcards.player)
- ArraySet (ptable, "hpf", hpv)
- ArraySet (ptable, "gpf", gpv)
- else groupnumber = groupnumber + 1
- local ptable = string.lower(wildcards.player)
- ArrayCreate (ptable)
- ArraySet (ptable, "player", wildcards.player)
- ArraySet (ptable, "ccc", "black")
- ArraySet (ptable, "cccm", "")
- ArraySet (ptable, "tpa", "black")
- ArraySet (ptable, "tpam", "")
- ArraySet (ptable, "ms", "black")
- ArraySet (ptable, "msm", "")
- ArraySet (ptable, "eff", "black")
- ArraySet (ptable, "effm", "")
- ArraySet (ptable, "kii", "black")
- ArraySet (ptable, "kiim", "")
- ArraySet (ptable, "hpf", hpv)
- ArraySet (ptable, "gpf", gpv)
- ArraySet (ptable, "kills", 0)
- ArraySet ("group", ptable, "win" .. groupnumber)
- ArraySet ("numbers", ptable, groupnumber)
- ArraySet ("numbers", groupnumber, ptable)
- end -- if
- setgrouptriggers()
- DoPrompt() -- update display
- end -- plus_one
- function plus_one_set_player (name, line, wildcards)
- hpv = wildcards.hp / wildcards.maxhp;
- gpv = wildcards.gp / wildcards.maxgp;
- if ArrayKeyExists ("group", string.lower(wildcards.player)) then
- local ptable = string.lower(wildcards.player)
- ArraySet (ptable, "hpf", hpv)
- ArraySet (ptable, "gpf", gpv)
- else groupnumber = groupnumber + 1
- SetVariable ("me", wildcards.player)
- local ptable = string.lower(wildcards.player)
- ArrayCreate (ptable)
- ArraySet (ptable, "player", wildcards.player)
- ArraySet (ptable, "ccc", "black")
- ArraySet (ptable, "cccm", "")
- ArraySet (ptable, "tpa", "black")
- ArraySet (ptable, "tpam", "")
- ArraySet (ptable, "ms", "black")
- ArraySet (ptable, "msm", "")
- ArraySet (ptable, "eff", "black")
- ArraySet (ptable, "effm", "")
- ArraySet (ptable, "kii", "black")
- ArraySet (ptable, "kiim", "")
- ArraySet (ptable, "hpf", hpv)
- ArraySet (ptable, "gpf", gpv)
- ArraySet (ptable, "kills", 0)
- ArraySet ("group", ptable, "win" .. groupnumber)
- ArraySet ("numbers", ptable, groupnumber)
- ArraySet ("numbers", groupnumber, ptable)
- end -- if
- setgrouptriggers()
- DoPrompt() -- update display
- end -- plus_one_set_player
- function minus_one (name, line, wildcards)
- if ArrayKeyExists ("group", string.lower(wildcards.player)) then
- local ptable = string.lower(wildcards.player)
- ArrayDelete(ptable)
- leavenumber = ArrayGet ("numbers", ptable)
- shufflenumber = ArrayGet ("numbers", ptable)
- ArrayDeleteKey("group", ptable)
- ArrayDeleteKey("numbers", ptable)
- reshuffle ()
- else
- end -- if
- DoPrompt() -- update display
- end -- minus_one
- function reshuffle (name, line, wildcards)
- if leavenumber - groupnumber == 0 then
- ArrayDeleteKey ("numbers", leavenumber)
- groupnumber = groupnumber - 1
- else ArraySet("group", ArrayGet("numbers", leavenumber + 1), "win" .. leavenumber)
- ArraySet("numbers", ArrayGet("numbers", leavenumber + 1), leavenumber)
- ArraySet("numbers", leavenumber, ArrayGet("numbers", leavenumber + 1))
- leavenumber = leavenumber + 1
- reshuffle ()
- end -- if
- end -- reshuffle
- function group_fail (name, line, wildcards)
- omitshieldtriggers("0")
- end -- group_fail
- function group_leave (name, line, wildcards)
- -- get rid of all player arrays
- for k,v in pairs(ArrayList("group")) do
- ArrayDelete(k)
- end
- ArrayClear("group")
- ArrayClear("numbers")
- leavenumber = 0
- groupnumber = 0
- shufflenumber = 0
- other_kills = 0
- SetVariable("me", "0")
- SetVariable("myeff","0")
- setgrouptriggers()
- DoPrompt() -- update display
- end -- group_leave
- function group_join (name, line, wildcards)
- -- simply request a refresh
- --ResetGroup ()
- end -- group_leave
- function list_group (name, line, wildcards)
- table.foreach (ArrayList ("group"), print)
- Note ("---------")
- table.foreach (ArrayList ("numbers"), print)
- Note ("---------")
- Note (GetVariable("me"))
- Note("---")
- windows = WindowList()
- if windows then
- for _, v in ipairs (windows) do
- if string.sub(v,1,3) == "win" then
- WindowDelete(v)
- end
- Note (v)
- end
- end -- if any
- Note("========")
- for k, v in pairs (ArrayListAll ()) do
- Note (v)
- end
- end -- list_group
- function omitshieldtriggers (value)
- SetTriggerOption("prot_ccc","omit_from_output",value)
- SetTriggerOption("prot_eff","omit_from_output",value)
- SetTriggerOption("prot_major","omit_from_output",value)
- SetTriggerOption("prot_kii","omit_from_output",value)
- SetTriggerOption("prot_tpa","omit_from_output",value)
- SetTriggerOption("prot_other","omit_from_output",value)
- SetTriggerOption("prot_start","omit_from_output",value)
- SetTriggerOption("prot_noprot","omit_from_output",value)
- SetTriggerOption("stat_other","omit_from_output",value)
- SetTriggerOption("stat_me","omit_from_output",value)
- SetTriggerOption("group_nogroup","omit_from_output",value)
- end -- omitshieldtriggers
- function setgrouptriggers ()
- if groupnumber == 0 then
- -- not in a group - don't run triggers
- if GROUP_TRIGGERS then
- setgrouptriggerenable("0")
- GROUP_TRIGGERS = false
- end
- else
- -- enable all group triggers
- if not GROUP_TRIGGERS then
- setgrouptriggerenable("1")
- GROUP_TRIGGERS = true
- end
- end
- end -- setgrouptriggers
- function setgrouptriggerenable(value)
- if value == "0" and SETTINGS.TRIGGER_COLOURS then
- -- set/leave personal triggers on
- SetTriggerOption("up_me__kii","enabled","1")
- SetTriggerOption("up_me__eff","enabled","1")
- SetTriggerOption("up_me__tpa","enabled","1")
- SetTriggerOption("up_me2_tpa","enabled","1")
- SetTriggerOption("up_me__ccc","enabled","1")
- SetTriggerOption("up_me__major","enabled","1")
- SetTriggerOption("up_me2_major","enabled","1")
- SetTriggerOption("dn_me__kii","enabled","1")
- SetTriggerOption("dn_me2_kii","enabled","1")
- SetTriggerOption("dn_me__eff","enabled","1")
- SetTriggerOption("dn_me__tpa","enabled","1")
- SetTriggerOption("dn_me__ccc","enabled","1")
- SetTriggerOption("dn_me__major","enabled","1")
- SetTriggerOption("up_me3_tpa","enabled","1")
- SetTriggerOption("up_me4_tpa","enabled","1")
- SetTriggerOption("up_me5_tpa","enabled","1")
- SetTriggerOption("up_me6_tpa","enabled","1")
- SetTriggerOption("up_me2_kii","enabled","1")
- SetTriggerOption("wk_me__major","enabled","1")
- SetTriggerOption("wk_me__kii","enabled","1")
- SetTriggerOption("wk_me__tpa","enabled","1")
- SetTriggerOption("up_ot__kii","enabled",value)
- SetTriggerOption("up_ot__eff","enabled",value)
- SetTriggerOption("up_ot__tpa","enabled",value)
- SetTriggerOption("up_ot2_tpa","enabled",value)
- SetTriggerOption("up_ot__ccc","enabled",value)
- SetTriggerOption("up_ot__major","enabled",value)
- SetTriggerOption("dn_ot__kii","enabled",value)
- SetTriggerOption("dn_ot2_kii","enabled",value)
- SetTriggerOption("dn_ot__eff","enabled",value)
- SetTriggerOption("dn_ot2_eff","enabled","1")
- SetTriggerOption("dn_ot__tpa","enabled",value)
- SetTriggerOption("dn_ot__ccc","enabled",value)
- SetTriggerOption("dn_ot__major","enabled",value)
- SetTriggerOption("up_ot3_tpa","enabled",value)
- SetTriggerOption("up_ot4_tpa","enabled",value)
- SetTriggerOption("up_ot5_tpa","enabled",value)
- SetTriggerOption("up_ot6_tpa","enabled",value)
- SetTriggerOption("wk_ot__major","enabled",value)
- SetTriggerOption("wk_ot__kii","enabled",value)
- SetTriggerOption("wk_ot__tpa","enabled",value)
- else
- SetTriggerOption("up_me__kii","enabled",value)
- SetTriggerOption("up_me__eff","enabled",value)
- SetTriggerOption("up_me__tpa","enabled",value)
- SetTriggerOption("up_me2_tpa","enabled",value)
- SetTriggerOption("up_me__ccc","enabled",value)
- SetTriggerOption("up_me__major","enabled",value)
- SetTriggerOption("up_me2_major","enabled",value)
- SetTriggerOption("dn_me__kii","enabled",value)
- SetTriggerOption("dn_me2_kii","enabled",value)
- SetTriggerOption("dn_me__eff","enabled",value)
- SetTriggerOption("dn_me__tpa","enabled",value)
- SetTriggerOption("dn_me__ccc","enabled",value)
- SetTriggerOption("dn_me__major","enabled",value)
- SetTriggerOption("up_ot__kii","enabled",value)
- SetTriggerOption("up_ot__eff","enabled",value)
- SetTriggerOption("up_ot__tpa","enabled",value)
- SetTriggerOption("up_ot2_tpa","enabled",value)
- SetTriggerOption("up_ot__ccc","enabled",value)
- SetTriggerOption("up_ot__major","enabled",value)
- SetTriggerOption("dn_ot__kii","enabled",value)
- SetTriggerOption("dn_ot2_kii","enabled",value)
- SetTriggerOption("dn_ot__eff","enabled",value)
- SetTriggerOption("dn_ot2_eff","enabled",value)
- SetTriggerOption("dn_ot__tpa","enabled",value)
- SetTriggerOption("dn_ot__ccc","enabled",value)
- SetTriggerOption("dn_ot__major","enabled",value)
- SetTriggerOption("up_ot3_tpa","enabled",value)
- SetTriggerOption("up_ot4_tpa","enabled",value)
- SetTriggerOption("up_ot5_tpa","enabled",value)
- SetTriggerOption("up_ot6_tpa","enabled",value)
- SetTriggerOption("up_me3_tpa","enabled",value)
- SetTriggerOption("up_me4_tpa","enabled",value)
- SetTriggerOption("up_me5_tpa","enabled",value)
- SetTriggerOption("up_me6_tpa","enabled",value)
- SetTriggerOption("up_me2_kii","enabled",value)
- SetTriggerOption("wk_me__major","enabled",value)
- SetTriggerOption("wk_me__kii","enabled",value)
- SetTriggerOption("wk_me__tpa","enabled",value)
- SetTriggerOption("wk_ot__major","enabled",value)
- SetTriggerOption("wk_ot__kii","enabled",value)
- SetTriggerOption("wk_ot__tpa","enabled",value)
- end
- end -- setgrouptriggerenable
- function downall(pname)
- pname = fixcheckname(pname)
- if pname == nil then
- return
- end
- -- if/else table -- not too many options
- if string.len(ArrayGet(string.lower(pname), "cccm")) > 0 then
- ArraySet (string.lower(pname), "ccc", "red")
- ArraySet (string.lower(pname), "cccm", "!CCC")
- end
- if string.len(ArrayGet(string.lower(pname), "tpam")) > 0 then
- ArraySet (string.lower(pname), "tpa", "red")
- ArraySet (string.lower(pname), "tpam", "!TPA")
- end
- if string.len(ArrayGet(string.lower(pname), "kiim")) > 0 then
- ArraySet (string.lower(pname), "kii", "red")
- ArraySet (string.lower(pname), "kiim", "!KII")
- end
- if string.len(ArrayGet(string.lower(pname), "msm")) > 0 then
- ArraySet (string.lower(pname), "ms", "red")
- ArraySet (string.lower(pname), "msm", "!MS")
- end
- if string.len(ArrayGet(string.lower(pname), "effm")) > 0 then
- ArraySet (string.lower(pname), "eff", "red")
- ArraySet (string.lower(pname), "effm", "!EFF")
- end
- end
- -- prot redirector
- function prot_redirect (name, line, wildcards, styles)
- if name == "prot_start" then
- -- Note("start of prot")
- prot_name = wildcards.player
- -- mark as down any existing shields as gone
- downall(prot_name)
- EnableTrigger ("prot_ccc", true) -- capture subsequent lines
- EnableTrigger ("prot_eff", true) -- capture subsequent lines
- EnableTrigger ("prot_tpa", true) -- capture subsequent lines
- EnableTrigger ("prot_major", true) -- capture subsequent lines
- EnableTrigger ("prot_kii", true) -- capture subsequent lines
- EnableTrigger ("prot_other", true) -- capture subsequent lines
- EnableTrigger ("prot_end", true) -- capture subsequent lines
- elseif name == "prot_noprot" then
- -- Note("start of prot")
- prot_name = wildcards.player
- EnableTrigger ("prot_other", true) -- capture subsequent lines
- EnableTrigger ("prot_end", true) -- capture subsequent lines
- no_shields("ns_ot", line, wildcards)
- elseif name == "prot_end" or name == "prot_end_force" then
- -- Note("end of prot")
- -- table.foreach(wildcards,print)
- EnableTrigger ("prot_ccc", false) -- no more lines to go
- EnableTrigger ("prot_eff", false) -- no more lines to go
- EnableTrigger ("prot_tpa", false) -- no more lines to go
- EnableTrigger ("prot_major", false) -- no more lines to go
- EnableTrigger ("prot_kii", false) -- no more lines to go
- EnableTrigger ("prot_other", false) -- no more lines to go
- EnableTrigger ("prot_end", false) -- no more lines to go
- prot_name = "0"
- omitshieldtriggers("0")
- else
- -- Note("mid prot")
- -- table.foreach(wildcards,print)
- end -- if
- end -- function prot_redirect
- function shield_up (name, line, wildcards)
- if string.sub(name,1,5) == "up_me" then
- -- operating on me rather than other
- if GetVariable("me") == "0" then
- -- operating on 'me', but no idea which player that is..
- return
- else
- pname = GetVariable("me")
- typename = string.sub(name,8) -- remove 'up_meX_'
- end
- else
- if prot_name == "0" then
- pname = wildcards.player
- else
- pname = prot_name
- end
- if string.sub(name,1,5) == "prot_" then
- typename = string.sub(name,6) -- remove 'prot_'
- else
- typename = string.sub(name,8) -- remove 'up_otX_'
- end
- end
- pname = fixcheckname(pname)
- if pname == nil then
- return
- end
- -- if/else table -- not too many options
- if typename == "ccc" then
- if wildcards.strength then
- ccccolour = ArrayGet("cccs", wildcards.strength)
- else
- ccccolour = "white"
- end
- ArraySet (string.lower(pname), "ccc", ccccolour)
- ArraySet (string.lower(pname), "cccm", "CCC")
- elseif typename == "tpa" then
- if wildcards.colour and string.len(wildcards.colour) > 0 then
- tpacolour = ArrayGet("tpas", wildcards.colour)
- else
- tpacolour = "white"
- end
- ArraySet (string.lower(pname), "tpa", tpacolour)
- ArraySet (string.lower(pname), "tpam", "TPA")
- elseif typename == "kii" then
- ArraySet (string.lower(pname), "kii", ArrayGet("kiis", wildcards.size))
- ArraySet (string.lower(pname), "kiim", "KII")
- elseif typename == "major" then
- ArraySet (string.lower(pname), "ms", "white")
- ArraySet (string.lower(pname), "msm", "MS")
- elseif typename == "eff" then
- if pname == GetVariable("me") then
- -- set our eff item
- SetVariable("myeff", wildcards.effitem)
- end
- ArraySet (string.lower(pname), "eff", "white")
- ArraySet (string.lower(pname), "effm", "EFF")
- else -- name not matched
- Note("Unexpected protection type given!")
- return
- end -- 'switch' on name
- refresh_shields ()
- end -- shield_up
- function shield_weaken (name, line, wildcards)
- if string.sub(name,1,5) == "wk_me" then
- -- operating on me rather than other
- if GetVariable("me") == "0" then
- -- operating on 'me', but no idea which player that is..
- return
- else
- pname = GetVariable("me")
- typename = string.sub(name,8) -- remove 'wk_meX_'
- end
- else
- if prot_name == "0" then
- pname = wildcards.player
- else
- pname = prot_name
- end
- typename = string.sub(name,8) -- remove 'wk_otX_'
- end
- pname = fixcheckname(pname)
- if pname == nil then
- return
- end
- -- if/else table -- not too many options
- if typename == "ccc" then
- if wildcards.strength then
- ccccolour = ArrayGet("cccs", wildcards.strength)
- else
- ccccolour = "white"
- end
- ArraySet (string.lower(pname), "ccc", ccccolour)
- ArraySet (string.lower(pname), "cccm", "~CCC")
- elseif typename == "tpa" then
- if wildcards.colour and string.len(wildcards.colour) > 0 then
- tpacolour = ArrayGet("tpas", wildcards.colour)
- else
- tpacolour = "white"
- end
- ArraySet (string.lower(pname), "tpa", tpacolour)
- ArraySet (string.lower(pname), "tpam", "~TPA")
- elseif typename == "kii" then
- ArraySet (string.lower(pname), "kii", ArrayGet("kiis", wildcards.size))
- ArraySet (string.lower(pname), "kiim", "~KII")
- elseif typename == "major" then
- ArraySet (string.lower(pname), "ms", "orange")
- ArraySet (string.lower(pname), "msm", "~MS")
- elseif typename == "eff" then
- ArraySet (string.lower(pname), "eff", "orange")
- ArraySet (string.lower(pname), "effm", "~EFF")
- else -- name not matched
- Note("Unexpected protection type given!")
- return
- end -- 'switch' on name
- refresh_shields ()
- end -- shield_weaken
- function shield_down (name, line, wildcards)
- if string.sub(name,1,5) == "dn_me" then
- -- operating on me rather than other
- if GetVariable("me") == "0" then
- -- operating on 'me', but no idea which player that is..
- return
- else
- pname = GetVariable("me")
- typename = string.sub(name,8) -- remove 'dn_meX_'
- end
- else
- if prot_name == "0" then
- pname = wildcards.player
- else
- pname = prot_name
- end
- typename = string.sub(name,8) -- remove 'dn_otX_'
- end
- pname = fixcheckname(pname)
- if pname == nil then
- return
- end
- -- if/else table -- not too many options
- if typename == "ccc" then
- ArraySet (string.lower(pname), "ccc", "red")
- ArraySet (string.lower(pname), "cccm", "!CCC")
- elseif typename == "tpa" then
- ArraySet (string.lower(pname), "tpa", "red")
- ArraySet (string.lower(pname), "tpam", "!TPA")
- elseif typename == "kii" then
- ArraySet (string.lower(pname), "kii", "red")
- ArraySet (string.lower(pname), "kiim", "!KII")
- elseif typename == "major" then
- ArraySet (string.lower(pname), "ms", "red")
- ArraySet (string.lower(pname), "msm", "!MS")
- elseif typename == "eff" then
- ArraySet (string.lower(pname), "eff", "red")
- ArraySet (string.lower(pname), "effm", "!EFF")
- else -- name not matched
- Note("Unexpected protection type given!")
- return
- end -- 'switch' on name
- refresh_shields ()
- end -- shield_down
- function fixcheckname(pname)
- if ArrayKeyExists ("group", string.lower(pname)) then
- return pname
- end
- -- handle issues with titles...
- for k,_ in pairs(ArrayList("group")) do
- if string.find(string.lower(pname),k) ~= nil then
- return k
- end
- end
- return nil
- end
- function player_kill (name, line, wildcards)
- if name == "mekill" then
- -- operating on me rather than other
- if GetVariable("me") == "0" then
- -- operating on 'me', but no idea which player that is..
- return
- else
- pname = GetVariable("me")
- end
- else
- pname = wildcards.player
- end
- pname = fixcheckname(pname)
- if pname == nil then
- other_kills = other_kills + 1
- return
- end
- ArraySet (string.lower(pname), "kills", ArrayGet(string.lower(pname), "kills") + 1)
- end -- player_kill
- function no_shields (name, line, wildcards)
- if string.sub(name,1,5) == "ns_me" then
- -- operating on me rather than other
- if GetVariable("me") == "0" then
- -- operating on 'me', but no idea which player that is..
- return
- else
- pname = GetVariable("me")
- end
- else
- if prot_name == "0" then
- pname = wildcards.player
- else
- pname = prot_name
- end
- end
- pname = fixcheckname(pname)
- if pname == nil then
- return
- end
- ArraySet (string.lower(pname), "ccc", "black")
- ArraySet (string.lower(pname), "cccm", "")
- ArraySet (string.lower(pname), "tpa", "black")
- ArraySet (string.lower(pname), "tpam", "")
- ArraySet (string.lower(pname), "eff", "black")
- ArraySet (string.lower(pname), "effm", "")
- ArraySet (string.lower(pname), "kii", "black")
- ArraySet (string.lower(pname), "kiim", "")
- ArraySet (string.lower(pname), "ms", "black")
- ArraySet (string.lower(pname), "msm", "")
- refresh_shields ()
- end -- no_shields
- function eff_stopped_any (name, line, wildcards)
- if GetVariable("me") == "0" then
- SetVariable("me", "0")
- else
- if wildcards.effitem == GetVariable("myeff") then
- ArraySet (string.lower(GetVariable("me")), "eff", "black")
- ArraySet (string.lower(GetVariable("me")), "effm", "")
- SetVariable("myeff","0")
- refresh_shields ()
- end
- end -- if
- end -- eff_stopped_me
- function refresh_shields ()
- DoPrompt()
- end -- refresh_shields
- function showkills()
- Note("Kills Report:")
- for k,v in pairs(ArrayList("group")) do
- Note(ArrayGet(k,"player") .. ": " .. ArrayGet(k,"kills"))
- end
- Note("Others: " .. other_kills)
- end
- function reportkills()
- report_text = "Kills report: "
- for k,v in pairs(ArrayList("group")) do
- report_text = report_text .. ArrayGet(k,"player") .. ": " .. ArrayGet(k,"kills") .. ", "
- end
- report_text = report_text .. ("Others: " .. other_kills)
- Execute("group say " .. report_text)
- end
- -------------------------------------------------------------------------------------------
- -- Map code
- -------------------------------------------------------------------------------------------
- -- for legend:
- background_colour = 0x00220E
- border_colour = ColourNameToRGB "dimgray"
- require "checkplugin"
- require "commas"
- require "mw"
- map_lines = {}
- map_title = ""
- map_title_fresh = false
- map_our_pos = 5
- function Display_Line (line, styles)
- local id = map_font_id
- local left = INDENT+22
- --local top = (line - 1) * font_height + 61 + (((10-#map_lines)*font_height)/2) --centre map top to bottom
- -- Kyr mod: want to account for even numbers of lines -> don't centre exactly...
- local nlines = math.ceil(#map_lines /2)* 2
- local lines_to_skip = 6 - map_our_pos
- local top = (line - 1) * font_height + 43 + (lines_to_skip*font_height) --centre map top to bottom
- for _, v in ipairs (styles) do
- left = left + WindowText (MapWin, id, v.text, left, top, 0, 0, v.textcolour)
- end -- for each style run
- end -- Display_Line
- function ColourString(val)
- if val == nil then
- return "000000"
- end
- local tmp = bit.tostring(val, 16)
- local pad = "000000"
- tmp = string.sub(pad,1,6-string.len(tmp)) .. tmp
- return tmp
- end
- function Display_Map ()
- MapWin = GetPluginID() .. "2"
- local mapbg = CalculateHalfColour(COLOURS.OUTLINE);
- WindowCreate (MapWin,
- 0, 0, bar_width, map_height,
- mushvar.mappos, -- center left
- 0,
- COLOURS.MAP_BACKGROUND) -- blank window
- --WindowCircleOp (MapWin, 3, 3, 55, INDENT, map_height-5, COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- WindowRectOp (MapWin, 2, bar_width-15, 59, bar_width-2, 75, mapbg ) -- fill entire box
- WindowRectOp (MapWin, 1, bar_width-15, 59, bar_width-1, 75, COLOURS.OUTLINE ) -- border
- WindowText (MapWin, map_title_font_id, "?", bar_width-10, 61, bar_width-2, 74, 0)
- WindowText (MapWin, map_title_font_id, "?", bar_width-11, 60, bar_width-2, 74, ColourNameToRGB("gray"))
- WindowCircleOp (MapWin, 3, INDENT-15, 50, bar_width, map_height, -- round rectangle
- COLOURS.OUTLINE, 0, 2, ColourNameToRGB ("black"), 1, 15, 15)
- -- Window frame
- WindowCircleOp (MapWin, 3, 0, 0, bar_width, 60, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 15, 15)
- WindowGradient (MapWin, 1, 4, bar_width-2, 30,
- mapbg, COLOURS.BACKGROUND, 2)
- WindowGradient (MapWin, 1, 30, bar_width-2, 60-4,
- COLOURS.BACKGROUND, mapbg, 2)
- -- map title set up
- local id = map_title_font_id
- local left_margin = 5
- local right_margin = 0
- local width = bar_width
- -- derive stuff from font
- local space_width = WindowTextWidth (MapWin, id, " ")
- local line_height = WindowFontInfo (MapWin, id, 1)
- -- starting point
- local x = left_margin
- local y = 0
- local counter = 0
- -- do each word
- message = map_title
- local approxlines = math.ceil(WindowTextWidth (MapWin, id, message) /(width - right_margin - left_margin))
- y = (4 - approxlines) * line_height / 2
- for word in string.gmatch (message, "%S+") do
- local word_width = WindowTextWidth (MapWin, id, word)
- -- time to start a new line?
- if (word_width + x) > (width - right_margin) and (x > left_margin) then
- y = y + line_height
- x = left_margin
- counter = counter + 1
- end -- if
- -- draw the text
- WindowText (MapWin, id, word, x, y, 0, map_height-10, COLOURS.TEXT)
- -- advance past the word and a single space
- x = x + word_width + space_width
- end -- for loop
- -- map display
- -- display each line
- for i, v in ipairs (map_lines) do
- Display_Line (i, v)
- end -- for
- -- make a hotspot
- WindowAddHotspot(MapWin, "legend_hotspot",
- bar_width-15, 60, bar_width-2, 75, -- remainder
- "mouseover", -- MouseOver
- "cancelmouseover", -- CancelMouseOver
- "", -- MouseDown
- "", -- CancelMouseDown
- "", -- MouseUp
- "", -- tooltip text
- 0, 0) -- movement cursor
- WindowShow (MapWin, true)
- end -- Display_Map
- -- map redirector
- function map_redirect (name, line, wildcards, styles)
- EnableTrigger ("multi_line_map", true) -- capture subsequent lines
- EnableTrigger ("map_end", true) -- capture subsequent lines
- if name == "map_start" then
- map_lines = {}
- map_title = wildcards[1]
- map_title_fresh = true
- elseif name == "map_end" then
- EnableTrigger ("multi_line_map", false) -- no more lines to go
- EnableTrigger ("map_end", false) -- no more lines to go
- Display_Map ()
- else
- --local len = #line
- table.insert (map_lines, styles)
- -- Kyr mod: check for player pos...
- for _, v in ipairs (styles) do
- if string.find(v.text, "@") and v.textcolour == ColourNameToRGB("yellow") then
- map_our_pos = #map_lines
- break
- end --if
- end -- for each style run
- end -- if
- end -- function map_redirect
- function ColourFromPercentage(percentage, high, med, low)
- percentage = math.min(math.max(0, percentage), 100)
- local x = (percentage - 50) / 50;
- local highr = tonumber(string.sub(ColourString(high),5,6),16)
- local highg = tonumber(string.sub(ColourString(high),3,4),16)
- local highb = tonumber(string.sub(ColourString(high),1,2),16)
- local medr = tonumber(string.sub(ColourString(med),5,6),16)
- local medg = tonumber(string.sub(ColourString(med),3,4),16)
- local medb = tonumber(string.sub(ColourString(med),1,2),16)
- local lowr = tonumber(string.sub(ColourString(low),5,6),16)
- local lowg = tonumber(string.sub(ColourString(low),3,4),16)
- local lowb = tonumber(string.sub(ColourString(low),1,2),16)
- local colg = math.ceil(highg * math.max(0,x) + medg * (1 - math.abs(x)) + lowg * math.max(0,-x))
- local colr = math.ceil(highr * math.max(0,x) + medr * (1 - math.abs(x)) + lowr * math.max(0,-x))
- local colb = math.ceil(highb * math.max(0,x) + medb * (1 - math.abs(x)) + lowb * math.max(0,-x))
- return colr + colg*256 + colb*65536
- end -- function ColourFromPercentage
- -------------------------------------------------------------------------------------------
- -- Status bar code
- -------------------------------------------------------------------------------------------
- function DrawGauges (sName, sLine, wildcards)
- local percenthp = math.floor (mushvar.hp/mushvar.maxhp*100)
- local percentgp = math.floor (mushvar.GP/mushvar.maxgp*100)
- local percentgpest = math.floor (mushvar.gpest/mushvar.maxgp*100)
- local percentburden = mushvar.burden
- vertical = 5 -- pixel to start at
- WindowCreate (GaugeWin, 0, 1, bar_width, 66, mushvar.barpos, 0, ColourNameToRGB ("black"))
- WindowCircleOp (GaugeWin, 3, 3, 5, INDENT, BUTTON_HEIGHT+5, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
- -- Window frame
- WindowCircleOp (GaugeWin, 3, INDENT-15, 0, bar_width, 66, -- round rectangle
- COLOURS.OUTLINE, 0, 2, COLOURS.BACKGROUND, 0, 15, 15)
- --WindowGradient (GaugeWin, 5, 6, INDENT-13, BUTTON_HEIGHT+3,
- -- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
- -- relate colour to percentage..
- if SETTINGS.PERCENT_COLOURS then
- DoGauge2 (GaugeWin, "HP ", percenthp / 100, ColourFromPercentage(percenthp, COLOURS.HPHIGH,COLOURS.HPMED,COLOURS.HPLOW), mushvar.hp .. " / " .. mushvar.maxhp, "HPhs", nil)
- DoGauge2 (GaugeWin, "GP ", percentgp / 100, ColourFromPercentage(percentgp, COLOURS.GPHIGH,COLOURS.GPMED,COLOURS.GPLOW), mushvar.gp .. "(".. mushvar.gpest .. ") / " .. mushvar.maxgp, "GPhs", percentgpest/100)
- DoGauge2 (GaugeWin, "B ", percentburden / 100, ColourFromPercentage(100-percentburden, COLOURS.BURDENHIGH,COLOURS.BURDENMED,COLOURS.BURDENLOW), mushvar.burden .. "% / 100%", "Burdenhs", nil)
- else
- DoGauge (GaugeWin, "HP ", percenthp / 100, COLOURS.HP, mushvar.hp .. " / " .. mushvar.maxhp, "HPhs", nil)
- DoGauge (GaugeWin, "GP ", percentgp / 100, COLOURS.GP, mushvar.gp .. "(".. mushvar.gpest .. ") / " .. mushvar.maxgp, "GPhs", percentgpest/100)
- DoGauge (GaugeWin, "B ", percentburden / 100, COLOURS.BURDEN, mushvar.burden .. "%", "Burdenhs", nil)
- end
- -- add hotspots
- WindowAddHotspot(GaugeWin, "outline_colour_hotspot", -- hotspot name
- 3, 5, INDENT-15, BUTTON_HEIGHT+5, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Outline Colour", -- tooltip text
- 1, 0) -- hand cursor
- WindowAddHotspot(GaugeWin, "text_colour_hotspot", -- hotspot name
- INDENT-12, 5, INDENT+5, 61, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Text Colour", -- tooltip text
- 1, 0) -- hand cursor
- WindowAddHotspot(GaugeWin, "background_colour_hotspot", -- hotspot name
- INDENT+10, 5, INDENT+25, 61, -- rectangle
- "mouseover",
- "cancelmouseover",
- "mousedown",
- "cancelmousedown",
- "mouseup",
- "Change Background Colour", -- tooltip text
- 1, 0) -- hand cursor
- WindowShow (GaugeWin, true)
- end -- hitcount
- function RedrawAll()
- -- make sure they're all called in a plugin..
- if WindowInfo(MapWin, 5) then
- CallPlugin(pluginid, "Display_Map", "")
- end
- CallPlugin(pluginid, "DrawGauges", "")
- CallPlugin(pluginid, "DoPrompt", "")
- end -- RedrawAll
- -------------------------------------------------------------------------------------------
- -- Hot spot behaviour
- -------------------------------------------------------------------------------------------
- function mouseup (flags, hotspotid)
- -- Timer reset hot spot
- if hotspotid == "XPhs" then
- TimerToZero ()
- return 0 -- needed for some languages
- end -- XPhs if
- -- show xp tab hot spot
- if hotspotid == "XPTABhs" then
- TAB_SHOW = 1
- CompleteSet ()
- return 0 -- needed for some languages
- end -- XPTABhs if
- -- show tab2 hot spot
- if hotspotid == "Off_TABhs" then
- TAB_SHOW = 2
- CompleteSet ()
- return 0 -- needed for some languages
- end -- tab2 hs if
- -- show tab3 hot spot
- if hotspotid == "Def_TABhs" then
- TAB_SHOW = 3
- CompleteSet ()
- return 0 -- needed for some languages
- end -- tab3 hs if
- -- show tab4 hot spot
- if hotspotid == "Grp_TABhs" then
- TAB_SHOW = 4
- CompleteSet ()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- reset xp rate hot spot
- if hotspotid == "XPRatehs" then
- TimerToZero ()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- reset xp graph hot spot
- if hotspotid == "XPGraphhs" then
- StartUp ()
- grab_time ()
- CompleteSet()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- reset combat stats hot spot
- if hotspotid == "Combaths" then
- StatsToZero ()
- CompleteSet()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- update stats hot spot
- if hotspotid == "Grouphs" then
- UpdateGroup ()
- CompleteSet()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- reset stats hot spot
- if hotspotid == "Groupreseths" then
- ResetGroup ()
- CompleteSet()
- return 0 -- needed for some languages
- end -- tab4 hs if
- -- Colour hot spots
- if hotspotid == "background_colour_hotspot" then
- local new_colour = PickColour (COLOURS.BACKGROUND)
- if new_colour ~= -1 then
- COLOURS.BACKGROUND = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "outline_colour_hotspot" then
- local new_colour = PickColour (COLOURS.OUTLINE)
- if new_colour ~= -1 then
- COLOURS.OUTLINE = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "text_colour_hotspot" then
- local new_colour = PickColour (COLOURS.TEXT)
- if new_colour ~= -1 then
- COLOURS.TEXT = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "HPhs" then
- local new_colour = PickColour (COLOURS.HP)
- if new_colour ~= -1 then
- COLOURS.HP = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "GPhs" then
- local new_colour = PickColour (COLOURS.GP)
- if new_colour ~= -1 then
- COLOURS.GP = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "Burdenhs" then
- local new_colour = PickColour (COLOURS.BURDEN)
- if new_colour ~= -1 then
- COLOURS.BURDEN = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "HPhshigh" then
- local new_colour = PickColour (COLOURS.HPHIGH)
- if new_colour ~= -1 then
- COLOURS.HPHIGH = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "HPhsmed" then
- local new_colour = PickColour (COLOURS.HPMED)
- if new_colour ~= -1 then
- COLOURS.HPMED = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "HPhslow" then
- local new_colour = PickColour (COLOURS.HPLOW)
- if new_colour ~= -1 then
- COLOURS.HPLOW = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "GPhshigh" then
- local new_colour = PickColour (COLOURS.GPHIGH)
- if new_colour ~= -1 then
- COLOURS.GPHIGH = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "GPhsmed" then
- local new_colour = PickColour (COLOURS.GPMED)
- if new_colour ~= -1 then
- COLOURS.GPMED = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "GPhslow" then
- local new_colour = PickColour (COLOURS.GPLOW)
- if new_colour ~= -1 then
- COLOURS.GPLOW = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "Burdenhshigh" then
- local new_colour = PickColour (COLOURS.BURDENHIGH)
- if new_colour ~= -1 then
- COLOURS.BURDENHIGH = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "Burdenhsmed" then
- local new_colour = PickColour (COLOURS.BURDENMED)
- if new_colour ~= -1 then
- COLOURS.BURDENMED = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "Burdenhslow" then
- local new_colour = PickColour (COLOURS.BURDENLOW)
- if new_colour ~= -1 then
- COLOURS.BURDENLOW = new_colour
- RedrawAll() -- redraw
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "OHitshs" then
- local new_colour = PickColour (COLOURS.OHITS)
- if new_colour ~= -1 then
- COLOURS.OHITS = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "OSpecialshs" then
- local new_colour = PickColour (COLOURS.OSPECIALS)
- if new_colour ~= -1 then
- COLOURS.OSPECIALS = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "DParryhs" then
- local new_colour = PickColour (COLOURS.DPARRY)
- if new_colour ~= -1 then
- COLOURS.DPARRY = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "DDodgehs" then
- local new_colour = PickColour (COLOURS.DDODGE)
- if new_colour ~= -1 then
- COLOURS.DDODGE = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "DBlockedhs" then
- local new_colour = PickColour (COLOURS.DBLOCK)
- if new_colour ~= -1 then
- COLOURS.DBLOCK = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "DShieldshs" then
- local new_colour = PickColour (COLOURS.DSHIELD)
- if new_colour ~= -1 then
- COLOURS.DSHIELD = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- if hotspotid == "DHitshs" then
- local new_colour = PickColour (COLOURS.DHITS)
- if new_colour ~= -1 then
- COLOURS.DHITS = new_colour
- end -- new colour
- return 0 -- needed for some languages
- end -- colour_hotspot if
- end -- mouseup
- function mouseover (flags, hotspotid)
- -- show map legend hot spot
- if hotspotid == "legend_hotspot" then
- -- what to say - one line per table entry, with imbedded colour codes
- info = {
- "@WRoom contents:@w",
- "",
- " @Y@@@w Where you are / Northeast-southwest exit ",
- " @c*@w Room | North-south exit",
- " @G$@w Room with living things - East-west exit",
- " @r$@w Room with living things \\ Northwest-southeast exit ",
- " in combat x Cross over exits",
- " @G&@w Room with living things ^ Up exit",
- " and non-cardinal exits v Down exit",
- " @r+@w Door ",
- " ",
- "",
- "@WTerrains:@w",
- "",
- " @Y@@@w Where you are . Plains ",
- " @w@@@w Terrain with living things c Cabbage fields ",
- " @r@@@w Road with living things @gf@w Forest ",
- " @r#@w Road @c~@w River / Water ",
- " @b*@w Town / City @wb@w Beach ",
- " ^ Mountains @ge@w Evergreen forest",
- ""
- }
- -- work out coordinates
- local top = WindowInfo (XPWin, 11)
- local left = WindowInfo (XPWin, 10) + bar_width
- heading = ""
- if mushvar.bar_position == "1" then
- align_right = false
- else
- align_right = true
- left = WindowInfo (XPWin, 10)
- end
- align_bottom = false
- capitalize = false
- -- show it
- mw.popup (infowin, -- window name to use
- heading_font_id, -- font to use for the heading
- popup_font_id, -- font to use for each line
- heading, -- heading text
- info, -- table of lines to show (with colour codes)
- left, top, -- where to put it
- border_colour, -- colour for round rectangle line
- background_colour, -- colour for background
- capitalize, -- if true, force the first letter to upper case
- align_right, -- if true, align right side on "Left" parameter
- align_bottom) -- if true, align bottom side on "Top" parameter
- end -- if
- end -- mouseover
- function cancelmouseover (flags, hotspotid)
- WindowShow (infowin, false)
- end -- cancelmouseover
- -------------------------------------------------------------------------------------------
- -- Installation setup
- -------------------------------------------------------------------------------------------
- function OnPluginInstall ()
- StartUp()
- ArrayCreate ("group")
- ArrayCreate ("numbers")
- -- Load saved tables
- assert (loadstring (GetVariable ("COLOURS") or "")) ()
- assert (loadstring (GetVariable ("TRIGCOL") or "")) ()
- assert (loadstring (GetVariable ("SETTINGS") or "")) ()
- -- setup window id's
- XPWin = GetPluginID () .. "1"
- MapWin = GetPluginID () .. "2"
- GaugeWin = GetPluginID () .. "3"
- pluginid = GetPluginID()
- -- setup fonts
- font_id = "f"
- font_size = 10
- font_name = "Arial" -- the actual font
- font_id2 = "f2"
- font_size2 = 8
- font_name2 = "Arial" -- the actual font
- map_font_name = "Courier New" -- the actual font
- map_font_size = 10
- map_font_id = "map_font" -- our internal name
- map_title_font_name = "Arial" -- the actual font for Map title
- map_title_font_size = 8
- map_title_font_id = "map_font_title" -- our internal name for Map title
- -- make windows so I can grab the font info
- WindowCreate (XPWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
- WindowCreate (MapWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
- WindowCreate (GaugeWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
- -- get font info
- check (WindowFont (XPWin, font_id, font_name, font_size)) -- normal
- font_height = WindowFontInfo (XPWin, font_id, 1) -- height
- font_width = WindowFontInfo (XPWin, font_id, 6) -- avg width
- check (WindowFont (MapWin, map_font_id, map_font_name, map_font_size, false, false, false, false, 0, 49)) -- normal
- check (WindowFont (MapWin, map_title_font_id, map_title_font_name, map_title_font_size, false, false, false, false, 0, 49)) -- normal
- check (WindowFont (XPWin, font_id2, font_name2, font_size2)) -- normal
- map_font_height = WindowFontInfo (MapWin, map_font_id, 1) -- height
- map_font_width = WindowFontInfo (MapWin, map_font_id, 6) -- avg width
- --GaugeWin = GetPluginID () .. "3"
- --WindowCreate (GaugeWin, 0, 0, 1, 1, mushvar.barpos, 0, COLOURS.BACKGROUND)
- check (WindowFont (GaugeWin, "f2", "Arial", 9, false, false, false, false))
- --txt_height = WindowFontInfo (GaugeWin, "font", 1) -- height of the font (46)
- --DrawGauges ()
- --WindowShow (GaugeWin, true)
- -- a unique ID
- infowin = GetPluginID () .. ":info"
- -- font IDs
- popup_font_id = "popup_font"
- heading_font_id = "popup_heading_font"
- -- load fonts - mouseover window
- WindowCreate (infowin, 0, 0, 1, 1, 1, 0, 0) -- make 1-pixel wide window
- -- install the fonts (49 is modern / fixed pitch)
- WindowFont (infowin, popup_font_id, map_font_name, font_size, false, false, false, false, 0, 49)
- WindowFont (infowin, heading_font_id, map_font_name, font_size + 2, false, false, false, false, 0, 49)
- EnsureSize()
- -- install trigger colours
- settriggercolours ()
- DoAfterSpecial (58, "XPMath()", sendto.script)
- end -- OnPluginInstall
- -------------------------------------------------------------------------------------------
- -- Show and hide windows on enable and disable
- -------------------------------------------------------------------------------------------
- function OnPluginEnable ()
- ArrayCreate ("group")
- ArrayCreate ("numbers")
- EnsureSize()
- -- install trigger colours
- settriggercolours ()
- -- ensure gpding works in the background
- SetOption ("play_sounds_in_background", 1)
- WindowShow (XPWin, true)
- WindowShow (MapWin, true)
- WindowShow (GaugeWin, true) --gauges.name, true
- end -- OnPluginEnable
- function OnPluginDisable ()
- WindowShow (XPWin, false)
- WindowShow (MapWin, false)
- WindowShow (GaugeWin, false)
- WindowShow (infowin, false)
- TextRectangle (0, 0, 0, 0, 0, 0x000000, 0, 0x000000, 0) -- Push text back to normal
- end -- OnPluginDisable
- function OnPluginClose ()
- WindowShow (XPWin, false)
- WindowShow (MapWin, false)
- WindowShow (GaugeWin, false)
- WindowShow (infowin, false)
- TextRectangle (0, 0, 0, 0, 0, 0x000000, 0, 0x000000, 0) -- Push text back to normal
- -- Properly clear up after ourselves
- WindowDelete (XPWin)
- WindowDelete (MapWin)
- WindowDelete (GaugeWin)
- WindowDelete (infowin)
- end -- OnPluginClose
- function SidebarConfig()
- Send ("options output prompt=off")
- Send ("options output look=verbose")
- Send ("options output shortinlong=on")
- Send ("options output map look=top")
- Send ("options output map lookcity=top")
- Send ("options output map glance=tagged")
- Send ("options output map glancecity=tagged")
- Send ("options output map reversecolour=off")
- Send ("options output map written=off")
- Send ("options output map mxp=off")
- end
- function print_help()
- Note([[Plugin Help: Sidebar++
- This plugin produces a Sidebar to the left of the output screen. This Sidebar is designed to track XP made per hour, display the lookmap from the room you are currently in and show a health and GP bar.
- The following information may be useful:
- * reportxp Sends a 'group say' to the mud reporting on XP information.
- * resetxp Resets the XP counter (This is the same as clicking the "Reset" button).
- * resetstats Resets the combat stats.
- * reportstats Sends a 'group say' to the mud reporting the combat stats.
- * reportkills Sends a 'group say' to the mud reporting the kill counters for the group.
- * showkills Displays the kill counters for the group without reporting them.
- * groupreset Resets and refreshes the grouping details, including shields.
- * groupupdate Requests an update to the group details (sends 'group status brief' and 'group shields' to the mud).
- * groupjointoggle Toggles addition of a 'groupreset' on sending 'group join *' (default: on).
- * triggercolours Toggles colour triggering.
- * hidelookmap Toggles hiding of the look map and glance.
- * hidecombatspam Toggles between greying out, hiding, and no effect on verbose combat messages.
- * showhitcolours Toggles colouring of hits by damage.
- * fixedbarcolours Toggles proportional or fixed colouring of HP/GP/B bars.
- * xpdetailplot Toggles green xp details plot.
- * xpdetailplot(x) Enables green xp details plot with moving averaging period of x minutes (default 5).
- * gpregenrate(x) Sets sidebar to use x (between 1 and 4) for the gp regen rate for its tick-up estimate (default 3).
- * sidebarleft Show sidebar on the left.
- * sidebarright Show sidebar on the right.
- * doublewin Toggle double-height tabbed window, showing group details (tab 4) as well as one other choice.
- * doublewin(x) Set double-height tabbed window, showing tab number x as well as one other choice (default 4).
- * gpding Toggle 'ding' on reaching GP max.
- * gpding(file) Enable playing specified sound file on reaching GP max (default: C:\Windows\Media\ding.wav).
- * showmxpdebug Toggle display of MXP debug messages. Can potentially be interesting/useful.
- * help sidebar Displays this help file.
- * sidebar_config Will automatically implement all the recommended MUD settings below.
- Trigger colours for shields can now be configured using one of:
- * settriggercolour(<what><who>, <custom_colour_number (0 turns off colouring, 17 is custom)>)
- * settriggercolour(<what><who>, <foreground name>, <background name (defaults to black if not given)>)
- * settriggercolour(<what><who>) Resets the given item to its default colours
- * showtriggercolours Displays current colour list
- Where <what> takes values:
- up - shields up
- dn - shields down
- wk - shields getting weaker (for 'me' only)
- go - shields going, shown by getting hit
- ht - any combat hit (for 'me' only)
- And <who> takes values:
- me - your player
- ot - others in the group
- The following mud settings should be used for this plugin to function correctly:
- * options output prompt=off
- * options output look=verbose
- * options output shortinlong=on
- * options output map look=top
- * options output map lookcity=top
- * options output map glance=tagged
- * options output map glancecity=tagged
- * options output map reversecolour=off
- * options output map written=off
- * options output map mxp=off
- ]])
- end
- -------------------------------------------------------------------------------------------
- -- on saving state, convert Lua table back into string variable save_simple is for simple
- -- tables that do not have cycles (self-reference) or refer to other tables
- -------------------------------------------------------------------------------------------
- function OnPluginSaveState ()
- SetVariable ("COLOURS", "COLOURS = " .. serialize.save_simple (COLOURS))
- SetVariable ("TRIGCOL", "TRIGCOL = " .. serialize.save_simple (TRIGCOL))
- SetVariable ("SETTINGS", "SETTINGS = " .. serialize.save_simple (SETTINGS))
- end -- function OnPluginSaveState
- function OnWorldSave ()
- SetVariable ("COLOURS", "COLOURS = " .. serialize.save_simple (COLOURS))
- SetVariable ("TRIGCOL", "TRIGCOL = " .. serialize.save_simple (TRIGCOL))
- SetVariable ("SETTINGS", "SETTINGS = " .. serialize.save_simple (SETTINGS))
- end -- function
- function OnPluginWorldOutputResized ()
- CallPlugin(pluginid, "EnsureSize", "")
- end -- function
- function OnPluginSend(stext)
- -- check if stext is 'group join <x>'
- if SETTINGS.GROUPJOIN and (string.match(stext,"^ *group *join *.+") ~= nil or string.match(stext,"^ *group *create *.+") ~= nil) then
- -- matched
- Send(stext)
- ResetGroup()
- return false
- end
- return true
- end
- ]]>
- </script>
- </muclient>
Add Comment
Please, Sign In to add comment