Guest User

Untitled

a guest
Apr 18th, 2014
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 211.47 KB | None | 0 0
  1. <?xml version="1.0" encoding="iso-8859-1"?>
  2. <!DOCTYPE muclient>
  3.  
  4. <!-- Thanks to Garrion, Nick Gammon, Ian Kirker and Trevize for the parts that make this plugin -->
  5.  
  6. <muclient>
  7. <plugin
  8. name="Sidebar"
  9. author="Kyr"
  10. id="bff25308e015986fb1a56e9d"
  11. language="Lua"
  12. purpose="Map, xp counter, group status, and status bars"
  13. date_written="2011-04-18"
  14. save_state="y"
  15. requires="4.43"
  16. version="0.14"
  17. >
  18. </plugin>
  19.  
  20. <triggers>
  21. -- Matches on combat monitor (NOT score brief now)
  22. -- old: "^(?:> |)Hp: (\d+) ?\((\d+)\) +(?:Gp: (\d+) ?\((\d+)\)) +(?:Xp: (?!662781)(\d+))(?: Burden: (\d+)\%|)$"
  23. <trigger
  24. enabled="y"
  25. ignore_case="y"
  26. keep_evaluating="y"
  27. match="^(?:> |)Hp: (\d+) ?\((\d+)\) (?:Gp: (\d+) ?\((\d+)\)) +(?:Xp: (?!662781)(\d+))$"
  28. regexp="y"
  29. send_to="12"
  30. sequence="3"
  31. variable="test"
  32. >
  33. <send> OnHealthTrigger(%1,%2,%3,%4,%5)</send>
  34. </trigger>
  35.  
  36.  
  37. -- Trigger to stop the map from matching on informs
  38. -- DO NOT keep evaluting...
  39. <trigger
  40. enabled="y"
  41. ignore_case="y"
  42. match="^(?:> |)\[(.*?)(\:|specialized|birthday|Discworld|achievement|first time|killed by|gains a level|Cpu|Machine|Reclaimed|Cleaning|joined the|now worshipping|now a member of)(.*?)\]$"
  43. name="Informs"
  44. regexp="y"
  45. sequence="2"
  46. >
  47. </trigger>
  48.  
  49. -- Map triggers
  50. <trigger
  51. enabled="y"
  52. keep_evaluating="y"
  53. match="^(?:> |)\[(.*)\]$"
  54. regexp="y"
  55. script="map_redirect"
  56. omit_from_output="y"
  57. name="map_start"
  58. sequence="100"
  59. >
  60. </trigger>
  61.  
  62. -- Do not keep evaluting
  63. <trigger
  64. enabled="n"
  65. match="*"
  66. script="map_redirect"
  67. name="multi_line_map"
  68. omit_from_output="y"
  69. sequence="10"
  70. >
  71. </trigger>
  72.  
  73. -- Possibly change to keep evaluting?
  74. <trigger
  75. enabled="n"
  76. match="^(((\'|\&quot;)[A-Z])|[A-Z])([a-z]|\s)"
  77. regexp="y"
  78. script="map_redirect"
  79. omit_from_output="n"
  80. name="map_end"
  81. sequence="5"
  82. >
  83. </trigger>
  84.  
  85. -- Combat triggers
  86. <trigger
  87. enabled="y"
  88. keep_evaluating="y"
  89. 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).*$"
  90. script="hitcount"
  91. regexp="y"
  92. sequence="98"
  93. name="combathit"
  94. custom_colour="17"
  95. other_text_colour="goldenrod"
  96. >
  97. </trigger>
  98.  
  99. -- ME ATTACK COLOURING
  100. <trigger
  101. enabled="y"
  102. 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.*)$"
  103. keep_evaluating="y"
  104. regexp="y"
  105. sequence="80"
  106. name="hitcolourme1"
  107. custom_colour="17"
  108. other_text_colour="#DDFFDD"
  109. >
  110. </trigger>
  111. <trigger
  112. enabled="y"
  113. 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.*)$"
  114. keep_evaluating="y"
  115. regexp="y"
  116. sequence="80"
  117. name="hitcolourme2"
  118. custom_colour="17"
  119. other_text_colour="#BBFFBB"
  120. >
  121. </trigger>
  122. <trigger
  123. enabled="y"
  124. 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.*)$"
  125. keep_evaluating="y"
  126. regexp="y"
  127. sequence="80"
  128. name="hitcolourme3"
  129. custom_colour="17"
  130. other_text_colour="#99FF99"
  131. >
  132. </trigger>
  133. <trigger
  134. enabled="y"
  135. 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.*)$"
  136. keep_evaluating="y"
  137. regexp="y"
  138. sequence="80"
  139. name="hitcolourme4"
  140. custom_colour="17"
  141. other_text_colour="#77FF77"
  142. >
  143. </trigger>
  144. <trigger
  145. enabled="y"
  146. 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.*)$"
  147. keep_evaluating="y"
  148. regexp="y"
  149. sequence="80"
  150. name="hitcolourme5"
  151. custom_colour="17"
  152. other_text_colour="#55FF55"
  153. >
  154. </trigger>
  155. <trigger
  156. enabled="y"
  157. 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.*)$"
  158. keep_evaluating="y"
  159. regexp="y"
  160. sequence="80"
  161. name="hitcolourme6"
  162. custom_colour="17"
  163. other_text_colour="#33FF33"
  164. >
  165. </trigger>
  166. <trigger
  167. enabled="y"
  168. 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.*)$"
  169. keep_evaluating="y"
  170. regexp="y"
  171. sequence="80"
  172. name="hitcolourme7"
  173. custom_colour="17"
  174. other_text_colour="#11FF11"
  175. >
  176. </trigger>
  177.  
  178. -- HITS ON ME COLOURING
  179.  
  180. <trigger
  181. enabled="y"
  182. 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.*)$"
  183. keep_evaluating="y"
  184. regexp="y"
  185. sequence="99"
  186. name="hitcolourmebad0"
  187. custom_colour="17"
  188. other_text_colour="#FFFFFF"
  189. >
  190. </trigger>
  191. <trigger
  192. enabled="y"
  193. 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.*)$"
  194. keep_evaluating="y"
  195. regexp="y"
  196. sequence="99"
  197. name="hitcolourmebad1"
  198. custom_colour="17"
  199. other_text_colour="#FFEDCB"
  200. >
  201. </trigger>
  202. <trigger
  203. enabled="y"
  204. 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.*)$"
  205. keep_evaluating="y"
  206. regexp="y"
  207. sequence="99"
  208. name="hitcolourmebad2"
  209. custom_colour="17"
  210. other_text_colour="#FFE3B0"
  211. >
  212. </trigger>
  213. <trigger
  214. enabled="y"
  215. 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.*)$"
  216. keep_evaluating="y"
  217. regexp="y"
  218. sequence="99"
  219. name="hitcolourmebad3"
  220. custom_colour="17"
  221. other_text_colour="#FFDA96"
  222. >
  223. </trigger>
  224. <trigger
  225. enabled="y"
  226. 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.*)$"
  227. keep_evaluating="y"
  228. regexp="y"
  229. sequence="99"
  230. name="hitcolourmebad4"
  231. custom_colour="17"
  232. other_text_colour="#FFD07B"
  233. >
  234. </trigger>
  235. <trigger
  236. enabled="y"
  237. 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.*)$"
  238. keep_evaluating="y"
  239. regexp="y"
  240. sequence="99"
  241. name="hitcolourmebad5"
  242. custom_colour="17"
  243. other_text_colour="#FFC761)"
  244. >
  245. </trigger>
  246. <trigger
  247. enabled="y"
  248. 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.*)$"
  249. keep_evaluating="y"
  250. regexp="y"
  251. sequence="99"
  252. name="hitcolourmebad6"
  253. custom_colour="17"
  254. other_text_colour="#FFBD46"
  255. >
  256. </trigger>
  257. <trigger
  258. enabled="y"
  259. 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.*)$"
  260. keep_evaluating="y"
  261. regexp="y"
  262. sequence="99"
  263. name="hitcolourmebad7"
  264. custom_colour="17"
  265. other_text_colour="#FFAA11"
  266. >
  267. </trigger>
  268.  
  269.  
  270. -- OTHER ATTACK COLOURING
  271. <trigger
  272. enabled="y"
  273. 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.*)$"
  274. keep_evaluating="y"
  275. regexp="y"
  276. sequence="80"
  277. name="hitcolourother1"
  278. custom_colour="17"
  279. other_text_colour="#DDFFDD"
  280. >
  281. </trigger>
  282. <trigger
  283. enabled="y"
  284. 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.*)$"
  285. keep_evaluating="y"
  286. regexp="y"
  287. sequence="80"
  288. name="hitcolourother2"
  289. custom_colour="17"
  290. other_text_colour="#BBFFBB"
  291. >
  292. </trigger>
  293. <trigger
  294. enabled="y"
  295. 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.*)$"
  296. keep_evaluating="y"
  297. regexp="y"
  298. sequence="80"
  299. name="hitcolourother3"
  300. custom_colour="17"
  301. other_text_colour="#99FF99"
  302. >
  303. </trigger>
  304. <trigger
  305. enabled="y"
  306. 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.*)$"
  307. keep_evaluating="y"
  308. regexp="y"
  309. sequence="80"
  310. name="hitcolourother4"
  311. custom_colour="17"
  312. other_text_colour="#77FF77"
  313. >
  314. </trigger>
  315. <trigger
  316. enabled="y"
  317. 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.*)$"
  318. keep_evaluating="y"
  319. regexp="y"
  320. sequence="80"
  321. name="hitcolourother5"
  322. custom_colour="17"
  323. other_text_colour="#55FF55"
  324. >
  325. </trigger>
  326. <trigger
  327. enabled="y"
  328. 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.*)$"
  329. keep_evaluating="y"
  330. regexp="y"
  331. sequence="80"
  332. name="hitcolourother6"
  333. custom_colour="17"
  334. other_text_colour="#33FF33"
  335. >
  336. </trigger>
  337. <trigger
  338. enabled="y"
  339. 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.*)$"
  340. keep_evaluating="y"
  341. regexp="y"
  342. sequence="80"
  343. name="hitcolourother7"
  344. custom_colour="17"
  345. other_text_colour="#11FF11"
  346. >
  347. </trigger>
  348.  
  349.  
  350. -- BAD ATTACK COLOURING
  351. <trigger
  352. enabled="y"
  353. 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.*)$"
  354. keep_evaluating="y"
  355. regexp="y"
  356. sequence="81"
  357. name="hitcolourbad1"
  358. custom_colour="17"
  359. other_text_colour="#FFDDDD"
  360. >
  361. </trigger>
  362. <trigger
  363. enabled="y"
  364. 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.*)$"
  365. keep_evaluating="y"
  366. regexp="y"
  367. sequence="81"
  368. name="hitcolourbad2"
  369. custom_colour="17"
  370. other_text_colour="#FFBBBB"
  371. >
  372. </trigger>
  373. <trigger
  374. enabled="y"
  375. 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.*)$"
  376. keep_evaluating="y"
  377. regexp="y"
  378. sequence="81"
  379. name="hitcolourbad3"
  380. custom_colour="17"
  381. other_text_colour="#FF9999"
  382. >
  383. </trigger>
  384. <trigger
  385. enabled="y"
  386. 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.*)$"
  387. keep_evaluating="y"
  388. regexp="y"
  389. sequence="81"
  390. name="hitcolourbad4"
  391. custom_colour="17"
  392. other_text_colour="#FF7777"
  393. >
  394. </trigger>
  395. <trigger
  396. enabled="y"
  397. 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.*)$"
  398. keep_evaluating="y"
  399. regexp="y"
  400. sequence="81"
  401. name="hitcolourbad5"
  402. custom_colour="17"
  403. other_text_colour="#FF5555"
  404. >
  405. </trigger>
  406. <trigger
  407. enabled="y"
  408. 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.*)$"
  409. keep_evaluating="y"
  410. regexp="y"
  411. sequence="81"
  412. name="hitcolourbad6"
  413. custom_colour="17"
  414. other_text_colour="#FF3333"
  415. >
  416. </trigger>
  417.  
  418. <trigger
  419. enabled="y"
  420. 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.*)$"
  421. keep_evaluating="y"
  422. regexp="y"
  423. sequence="81"
  424. name="hitcolourbad7"
  425. custom_colour="17"
  426. other_text_colour="#FF1111"
  427. >
  428. </trigger>
  429.  
  430.  
  431. <trigger
  432. enabled="y"
  433. ignore_case="y"
  434. keep_evaluating="y"
  435. 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).*$"
  436. name="combatspam"
  437. custom_colour="17"
  438. other_text_colour="#303030"
  439. regexp="y"
  440. sequence="90"
  441. >
  442. </trigger>
  443.  
  444. <trigger
  445. enabled="n"
  446. ignore_case="y"
  447. keep_evaluating="y"
  448. match="^(?:> |)You attempt to launch a powerful attack.*$"
  449. name="specialcolour"
  450. custom_colour="17"
  451. other_text_colour="#B1425C"
  452. regexp="y"
  453. sequence="91"
  454. >
  455. </trigger>
  456.  
  457. -- Command / people spam
  458. <trigger
  459. enabled="n"
  460. ignore_case="n"
  461. 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).*$"
  462. keep_evaluating="y"
  463. name="idlespam"
  464. omit_from_output="n"
  465. custom_colour="17"
  466. other_text_colour="#204020"
  467. regexp="y"
  468. sequence="90"
  469. >
  470. </trigger>
  471.  
  472. -- Item / jewellery / pet spam
  473. <trigger
  474. enabled="n"
  475. ignore_case="n"
  476. 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).*$"
  477. keep_evaluating="y"
  478. name="idlespam2"
  479. omit_from_output="n"
  480. custom_colour="17"
  481. other_text_colour="#202040"
  482. regexp="y"
  483. sequence="89"
  484. >
  485. </trigger>
  486.  
  487. -- Magic / ritual spam
  488. <trigger
  489. enabled="n"
  490. ignore_case="n"
  491. 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).*$"
  492. keep_evaluating="y"
  493. name="idlespam3"
  494. omit_from_output="n"
  495. custom_colour="17"
  496. other_text_colour="#402020"
  497. regexp="y"
  498. sequence="89"
  499. >
  500. </trigger>
  501.  
  502. -- Spoken spam
  503. <trigger
  504. enabled="n"
  505. ignore_case="n"
  506. 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'\?).*$"
  507. keep_evaluating="y"
  508. name="idlespam4"
  509. omit_from_output="n"
  510. custom_colour="17"
  511. other_text_colour="#204040"
  512. regexp="y"
  513. sequence="90"
  514. >
  515. </trigger>
  516.  
  517. -- Custom spam reduction bits
  518. <trigger
  519. enabled="n"
  520. ignore_case="n"
  521. 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.*)$"
  522. keep_evaluating="y"
  523. name="idlespam5"
  524. omit_from_output="n"
  525. custom_colour="17"
  526. other_text_colour="#402040"
  527. regexp="y"
  528. sequence="1"
  529. >
  530. </trigger>
  531.  
  532.  
  533. <trigger
  534. enabled="y"
  535. keep_evaluating="y"
  536. match="*but you*block*"
  537. regexp="n"
  538. omit_from_output="n"
  539. script="blockcount"
  540. sequence="100"
  541. >
  542. </trigger>
  543.  
  544. <trigger
  545. enabled="y"
  546. keep_evaluating="y"
  547. match="^(?:> |)(?P<player>.*?) dealt the death blow to .*\.$"
  548. script="player_kill"
  549. name="otherkill"
  550. ignore_case="y"
  551. regexp="y"
  552. lowercase_wildcard="y"
  553. sequence="100"
  554. >
  555. </trigger>
  556.  
  557. <trigger
  558. enabled="y"
  559. keep_evaluating="y"
  560. match="^(?:> |)(?P<player>You) killed .*\.$"
  561. script="player_kill"
  562. name="mekill"
  563. ignore_case="y"
  564. regexp="y"
  565. lowercase_wildcard="y"
  566. sequence="100"
  567. >
  568. </trigger>
  569.  
  570. <trigger
  571. enabled="y"
  572. keep_evaluating="y"
  573. match="*but you*dodge*"
  574. regexp="n"
  575. omit_from_output="n"
  576. script="dodgecount"
  577. sequence="100"
  578. >
  579. </trigger>
  580.  
  581. <trigger
  582. enabled="y"
  583. keep_evaluating="y"
  584. match="*but you*parry*"
  585. regexp="n"
  586. omit_from_output="n"
  587. script="parrycount"
  588. sequence="100"
  589. >
  590. </trigger>
  591.  
  592. <trigger
  593. enabled="y"
  594. keep_evaluating="y"
  595. match="*but your*absorbs all*blow*"
  596. regexp="n"
  597. omit_from_output="n"
  598. script="armourcount"
  599. sequence="100"
  600. >
  601. </trigger>
  602.  
  603. <trigger
  604. enabled="y"
  605. keep_evaluating="y"
  606. ignore_case="n"
  607. 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) .*$"
  608. script="successfulhit"
  609. regexp="y"
  610. sequence="100"
  611. >
  612. </trigger>
  613.  
  614.  
  615. -- do not continue evaluating - override the successfulhit trigger
  616. <trigger
  617. enabled="y"
  618. ignore_case="y"
  619. match="you (.*)(avoids the attack|blocks the blow|dodges out of the way|parries the blow|but (his|her) .*absorbs all.*blow)(.*)"
  620. script="missedhit"
  621. regexp="y"
  622. sequence="99"
  623. >
  624. </trigger>
  625.  
  626. <trigger
  627. enabled="y"
  628. ignore_case="y"
  629. keep_evaluating="y"
  630. match="(You attempt to launch a powerful attack\.(.*)|sneak around.*prepare (the|to) backstab.*)"
  631. script="missedspecial"
  632. regexp="y"
  633. sequence="99"
  634. >
  635. </trigger>
  636.  
  637. <trigger
  638. enabled="y"
  639. ignore_case="y"
  640. keep_evaluating="y"
  641. match="(You launch a powerful attack\.(.*)|You .*sneak around.* without being spotted and manage.*|You hold your cover .*sneak around.* and manage.*)"
  642. script="successfulspecial"
  643. regexp="y"
  644. sequence="99"
  645. >
  646. </trigger>
  647.  
  648. ------------------------------------------------------------------------------------
  649. -- Group Status Triggers -----------------------------------------------------------
  650. <trigger
  651. enabled="y"
  652. keep_evaluating="y"
  653. 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)\."
  654. script="plus_one"
  655. name="stat_other"
  656. regexp="y"
  657. lowercase_wildcard="y"
  658. sequence="95"
  659. omit_from_output="n"
  660. >
  661. </trigger>
  662. <trigger
  663. enabled="y"
  664. keep_evaluating="y"
  665. match="^(?:> |)(?: |)(?!(\[|>))(?P<player>.+?) is (?P<hp>perfectly healthy, for a ghost)(?P<gp>)\."
  666. script="plus_one"
  667. name="stat_other_dead"
  668. regexp="y"
  669. lowercase_wildcard="y"
  670. sequence="95"
  671. omit_from_output="n"
  672. >
  673. </trigger>
  674.  
  675. <trigger
  676. enabled="y"
  677. keep_evaluating="y"
  678. 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)\."
  679. script="plus_one"
  680. name="group_report"
  681. regexp="y"
  682. lowercase_wildcard="y"
  683. sequence="100"
  684. omit_from_output="n"
  685. >
  686. </trigger>
  687. <trigger
  688. enabled="y"
  689. keep_evaluating="y"
  690. match="^(?:> |)(?! )(\[.*\] You report: |\[.*\] )(?P<player>.+?)( .*|) is (?P<hp>perfectly healthy, for a ghost)(?P<gp>)\."
  691. script="plus_one"
  692. name="group_report_dead"
  693. regexp="y"
  694. lowercase_wildcard="y"
  695. sequence="100"
  696. omit_from_output="n"
  697. >
  698. </trigger>
  699.  
  700. <trigger
  701. enabled="y"
  702. keep_evaluating="y"
  703. match="^(?:> |)\[(?P<groupname>.*)\] (?P<player>.+?) has joined the group\.$"
  704. script="plus_one"
  705. ignore_case="y"
  706. regexp="y"
  707. lowercase_wildcard="y"
  708. sequence="90"
  709. >
  710. </trigger>
  711.  
  712. <trigger
  713. enabled="y"
  714. keep_evaluating="y"
  715. match="^(?:> |)\[(?P<groupname>.*)\] You have joined the group\.$"
  716. script="group_join"
  717. ignore_case="y"
  718. regexp="y"
  719. lowercase_wildcard="y"
  720. sequence="90"
  721. >
  722. </trigger>
  723.  
  724. <trigger
  725. enabled="y"
  726. keep_evaluating="y"
  727. match="^(?:> |)(?P<player>.+?)\; Hp\: (?P<hp>.*)/(?P<maxhp>.*) Gp\: (?P<gp>.*)/(?P<maxgp>.*)."
  728. script="plus_one_set_player"
  729. name="stat_me"
  730. ignore_case="y"
  731. regexp="y"
  732. lowercase_wildcard="y"
  733. sequence="95"
  734. omit_from_output="n"
  735. >
  736. </trigger>
  737.  
  738. <trigger
  739. enabled="y"
  740. keep_evaluating="y"
  741. match="^(?:> |)\[(?P<groupname>.*)\] (?P<player>.+?) has left the group\.$"
  742. script="minus_one"
  743. ignore_case="y"
  744. regexp="y"
  745. lowercase_wildcard="y"
  746. sequence="90"
  747. >
  748. </trigger>
  749.  
  750. <trigger
  751. enabled="y"
  752. keep_evaluating="y"
  753. match="^(?:> |)\[(?P<groupname>.*)\] you have left the group\.$"
  754. script="group_leave"
  755. ignore_case="y"
  756. regexp="y"
  757. lowercase_wildcard="y"
  758. sequence="90"
  759. >
  760. </trigger>
  761.  
  762. <trigger
  763. enabled="y"
  764. keep_evaluating="y"
  765. match="^(?:> |)You must be a member of a group to use this command\.$"
  766. name="group_nogroup"
  767. script="group_fail"
  768. ignore_case="y"
  769. regexp="y"
  770. lowercase_wildcard="y"
  771. omit_from_output="n"
  772. sequence="100"
  773. >
  774. </trigger>
  775.  
  776. ------------------------------------------------------------------------------------
  777. -- Group Shields Triggers ----------------------------------------------------------
  778. <trigger
  779. enabled="y"
  780. keep_evaluating="y"
  781. match="^(?:> |)Arcane protection for (?P<player>.*?)\:\-$"
  782. regexp="y"
  783. script="prot_redirect"
  784. name="prot_start"
  785. omit_from_output="n"
  786. sequence="100"
  787. >
  788. </trigger>
  789.  
  790. <trigger
  791. enabled="n"
  792. keep_evaluating="y"
  793. 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)\.$"
  794. script="shield_up"
  795. name="prot_ccc"
  796. ignore_case="y"
  797. regexp="y"
  798. lowercase_wildcard="y"
  799. omit_from_output="n"
  800. sequence="20"
  801. >
  802. </trigger>
  803.  
  804. <trigger
  805. enabled="n"
  806. keep_evaluating="y"
  807. match="^ \* (She|He) is surrounded by a (?P<colour>|dull red|bright red|wobbling orange|flickering yellow|).?magical impact shield\.$"
  808. script="shield_up"
  809. name="prot_tpa"
  810. regexp="y"
  811. lowercase_wildcard="y"
  812. omit_from_output="n"
  813. sequence="20"
  814. >
  815. </trigger>
  816.  
  817. <trigger
  818. enabled="n"
  819. keep_evaluating="y"
  820. match="^ \* (She|He) is surrounded by a (?P<size>.*?) of (.*)\.$"
  821. script="shield_up"
  822. name="prot_kii"
  823. regexp="y"
  824. lowercase_wildcard="y"
  825. omit_from_output="n"
  826. sequence="20"
  827. >
  828. </trigger>
  829.  
  830. <trigger
  831. enabled="n"
  832. keep_evaluating="y"
  833. match="^ \* (She|He) is(.*)protected by the power of (.*)$"
  834. script="shield_up"
  835. name="prot_major"
  836. regexp="y"
  837. ignore_case="y"
  838. lowercase_wildcard="y"
  839. omit_from_output="n"
  840. sequence="20"
  841. >
  842. </trigger>
  843.  
  844. <trigger
  845. enabled="n"
  846. keep_evaluating="y"
  847. match="^ \* (?:A )(?P<effitem>.*) is floating around (him|her)\:$"
  848. script="shield_up"
  849. name="prot_eff"
  850. ignore_case="y"
  851. regexp="y"
  852. lowercase_wildcard="y"
  853. omit_from_output="n"
  854. sequence="20"
  855. >
  856. </trigger>
  857.  
  858. <trigger
  859. enabled="n"
  860. match="^([^ ].*\:|It is .* condition\.| It .*\.|It has the hazy octarine sparkle of a magical talisman\.|\n| \* .*|)$"
  861. script="prot_redirect"
  862. name="prot_other"
  863. ignore_case="y"
  864. regexp="y"
  865. keep_evaluating="y"
  866. omit_from_output="n"
  867. sequence="25"
  868. >
  869. </trigger>
  870.  
  871. <trigger
  872. enabled="y"
  873. keep_evaluating="y"
  874. match="^(?:> |)(?P<player>.*?) has no arcane protection\.$"
  875. regexp="y"
  876. script="prot_redirect"
  877. name="prot_noprot"
  878. lowercase_wildcard="y"
  879. omit_from_output="n"
  880. sequence="100"
  881. >
  882. </trigger>
  883.  
  884. <trigger
  885. enabled="n"
  886. keep_evaluating="y"
  887. match="^(?!( \* .*$|Arcane protection for .*$|.*has no arcane protection\.$|[^ ].*\:$|It is .* condition\.$| It .*\.$|It has the hazy octarine sparkle of a magical talisman\.$|$))"
  888. regexp="y"
  889. ignore_case="y"
  890. script="prot_redirect"
  891. name="prot_end"
  892. lowercase_wildcard="y"
  893. omit_from_output="n"
  894. sequence="25"
  895. >
  896. </trigger>
  897.  
  898. -- no need to keep evaluating on this
  899. <trigger
  900. enabled="y"
  901. match="^(?:> |)<end of shields list>$"
  902. regexp="y"
  903. ignore_case="y"
  904. script="prot_redirect"
  905. name="prot_end_force"
  906. lowercase_wildcard="y"
  907. omit_from_output="y"
  908. sequence="10"
  909. >
  910. </trigger>
  911.  
  912. ------------------------------------------------------------------------------------
  913. -- Individual Shields Triggers -----------------------------------------------------
  914.  
  915. <trigger
  916. enabled="y"
  917. match="^(?:> |) \* You are(.*)protected by the power of (.*)$"
  918. script="shield_up"
  919. name="up_meX_major"
  920. regexp="y"
  921. lowercase_wildcard="y"
  922. omit_from_output="n"
  923. sequence="100"
  924. >
  925. </trigger>
  926.  
  927. <trigger
  928. enabled="y"
  929. match="^(?:> |) \* You are surrounded by a (?P<colour>|dull red|bright red|wobbling orange|flickering yellow|).?magical impact shield\.$"
  930. regexp="y"
  931. script="shield_up"
  932. name="up_meX_tpa"
  933. lowercase_wildcard="y"
  934. sequence="100"
  935. >
  936. </trigger>
  937.  
  938. <trigger
  939. enabled="y"
  940. match="^(?:> |) \* You are surrounded by a (?P<size>.*?) of (.*)\.$"
  941. regexp="y"
  942. script="shield_up"
  943. name="up_meX_kii"
  944. lowercase_wildcard="y"
  945. sequence="100"
  946. >
  947. </trigger>
  948.  
  949. <trigger
  950. enabled="y"
  951. match="^(?:> |) \* (?:A )(?P<effitem>.*) is floating around you:$"
  952. regexp="y"
  953. lowercase_wildcard="y"
  954. script="shield_up"
  955. name="up_meX_eff"
  956. sequence="100"
  957. >
  958. </trigger>
  959.  
  960. <trigger
  961. enabled="y"
  962. 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)\.$"
  963. regexp="y"
  964. lowercase_wildcard="y"
  965. script="shield_up"
  966. name="up_meX_ccc"
  967. sequence="100"
  968. >
  969. </trigger>
  970.  
  971. <trigger
  972. enabled="y"
  973. match="^(?:> |)You have no arcane protection\.$"
  974. regexp="y"
  975. script="no_shields"
  976. name="ns_me"
  977. lowercase_wildcard="y"
  978. omit_from_output="n"
  979. sequence="100"
  980. >
  981. </trigger>
  982.  
  983. ------------------------------------------------------------------------------------
  984. -- Shields Notifications Triggers --------------------------------------------------
  985.  
  986. <trigger
  987. enabled="y"
  988. match="You are protected by the power of *."
  989. script="shield_up"
  990. name="up_me__major"
  991. sequence="100"
  992. custom_colour="17"
  993. other_text_colour="yellowgreen"
  994. other_back_colour="darkgreen"
  995. >
  996. </trigger>
  997.  
  998. <trigger
  999. enabled="y"
  1000. ignore_case="y"
  1001. match="^your (divine protection|protective aura) has been (strengthened|extended)\.$"
  1002. script="shield_up"
  1003. name="up_me2_major"
  1004. regexp="y"
  1005. sequence="100"
  1006. custom_colour="17"
  1007. other_text_colour="yellowgreen"
  1008. other_back_colour="darkgreen"
  1009. >
  1010. </trigger>
  1011.  
  1012. <trigger
  1013. enabled="y"
  1014. match="Your divine protection is weakening."
  1015. script="shield_weaken"
  1016. name="wk_me__major"
  1017. sequence="100"
  1018. custom_colour="17"
  1019. other_text_colour="orangered"
  1020. >
  1021. </trigger>
  1022.  
  1023. <trigger
  1024. enabled="y"
  1025. match="Your divine protection expires."
  1026. script="shield_down"
  1027. name="dn_me__major"
  1028. sequence="100"
  1029. custom_colour="17"
  1030. other_text_colour="gold"
  1031. other_back_colour="darkred"
  1032. >
  1033. </trigger>
  1034.  
  1035. <trigger
  1036. enabled="n"
  1037. match="^(?:> |)You detect (?P<player>.*?)('s| .*|) skin getting harder.$"
  1038. script="shield_up"
  1039. name="up_ot__ccc"
  1040. ignore_case="y"
  1041. regexp="y"
  1042. lowercase_wildcard="y"
  1043. sequence="100"
  1044. custom_colour="17"
  1045. other_text_colour="lawngreen"
  1046. >
  1047. </trigger>
  1048.  
  1049. <trigger
  1050. enabled="n"
  1051. match="^(?:> |)(?P<player>.*?)( .*|) scratches (himself|herself), and large pieces of skin flake off.$"
  1052. script="shield_down"
  1053. name="dn_ot__ccc"
  1054. ignore_case="y"
  1055. regexp="y"
  1056. lowercase_wildcard="y"
  1057. sequence="100"
  1058. custom_colour="17"
  1059. other_text_colour="red"
  1060. >
  1061. </trigger>
  1062.  
  1063. <trigger
  1064. enabled="n"
  1065. match="^(?:> |)With a noise that sounds like (.*)\, the air around (?P<player>.*?)( .*|) flashes (.*) for a moment\.$"
  1066. script="shield_up"
  1067. name="up_ot__tpa"
  1068. ignore_case="y"
  1069. regexp="y"
  1070. lowercase_wildcard="y"
  1071. sequence="100"
  1072. custom_colour="17"
  1073. other_text_colour="lawngreen"
  1074. >
  1075. </trigger>
  1076.  
  1077. <trigger
  1078. enabled="n"
  1079. match="^(?:> |)There is a sudden white flash around (?P<player>.*?)(\.| .*)$"
  1080. script="shield_down"
  1081. name="dn_ot__tpa"
  1082. ignore_case="y"
  1083. regexp="y"
  1084. lowercase_wildcard="y"
  1085. sequence="100"
  1086. custom_colour="17"
  1087. other_text_colour="red"
  1088. >
  1089. </trigger>
  1090.  
  1091. <trigger
  1092. enabled="n"
  1093. match="^(.*) begins to float around (?P<player>.*?)(\.| .*)$"
  1094. script="shield_up"
  1095. name="up_ot__eff"
  1096. ignore_case="y"
  1097. regexp="y"
  1098. lowercase_wildcard="y"
  1099. sequence="100"
  1100. custom_colour="17"
  1101. other_text_colour="lawngreen"
  1102. >
  1103. </trigger>
  1104.  
  1105. <trigger
  1106. enabled="y"
  1107. match="^(?:> |)As the bugs around you fall, you realise you are now only surrounded by a (?P<size>.*) of .*.$"
  1108. script="shield_up"
  1109. name="up_me2_kii"
  1110. regexp="y"
  1111. lowercase_wildcard="y"
  1112. sequence="100"
  1113. custom_colour="17"
  1114. other_text_colour="orangered"
  1115. >
  1116. </trigger>
  1117.  
  1118. <trigger
  1119. enabled="n"
  1120. match="^(?:> |)In blocking the attack (.*) floating around (?P<player>.*?)( .*|) is knocked out of orbit.$"
  1121. script="shield_down"
  1122. name="dn_ot__eff"
  1123. ignore_case="y"
  1124. regexp="y"
  1125. lowercase_wildcard="y"
  1126. sequence="100"
  1127. custom_colour="17"
  1128. other_text_colour="red"
  1129. >
  1130. </trigger>
  1131.  
  1132. <trigger
  1133. enabled="y"
  1134. match="^(?:> |)(You feel your skin become rock hard|Your skin (feels even harder now|is now as hard as it can get))\.$"
  1135. regexp="y"
  1136. lowercase_wildcard="y"
  1137. script="shield_up"
  1138. name="up_me__ccc"
  1139. sequence="100"
  1140. custom_colour="17"
  1141. other_text_colour="yellowgreen"
  1142. other_back_colour="darkgreen"
  1143. >
  1144. </trigger>
  1145.  
  1146. <trigger
  1147. enabled="y"
  1148. match="^(?:> |)Your skin feels itchy\; large pieces flake off as you scratch it.$"
  1149. regexp="y"
  1150. lowercase_wildcard="y"
  1151. script="shield_down"
  1152. name="dn_me__ccc"
  1153. sequence="100"
  1154. custom_colour="17"
  1155. other_text_colour="gold"
  1156. other_back_colour="darkred"
  1157. >
  1158. </trigger>
  1159.  
  1160. <trigger
  1161. enabled="y"
  1162. match="^(?:> |)With a noise that sounds like (.*)\, everything around you flashes red for a moment\.$"
  1163. regexp="y"
  1164. lowercase_wildcard="y"
  1165. script="shield_up"
  1166. name="up_me__tpa"
  1167. sequence="100"
  1168. custom_colour="17"
  1169. other_text_colour="yellowgreen"
  1170. other_back_colour="darkgreen"
  1171. >
  1172. </trigger>
  1173.  
  1174. -- do NOT keep evaluating to occlude up_ot__kii
  1175. <trigger
  1176. enabled="y"
  1177. 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.*)$"
  1178. regexp="y"
  1179. lowercase_wildcard="y"
  1180. script="shield_up"
  1181. name="up_me__kii"
  1182. sequence="99"
  1183. custom_colour="17"
  1184. other_text_colour="yellowgreen"
  1185. other_back_colour="darkgreen"
  1186. >
  1187. </trigger>
  1188.  
  1189. <trigger
  1190. enabled="n"
  1191. 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>.*?)( .*|).*$"
  1192. regexp="y"
  1193. lowercase_wildcard="y"
  1194. script="shield_up"
  1195. name="up_ot__kii"
  1196. sequence="100"
  1197. custom_colour="17"
  1198. other_text_colour="lawngreen"
  1199. >
  1200. </trigger>
  1201.  
  1202. <trigger
  1203. enabled="y"
  1204. match="^(?:> |)The .* surrounding you scatter in different directions and fly off\.$"
  1205. script="shield_down"
  1206. name="dn_me__kii"
  1207. regexp="y"
  1208. lowercase_wildcard="y"
  1209. sequence="100"
  1210. custom_colour="17"
  1211. other_text_colour="gold"
  1212. other_back_colour="darkred"
  1213. >
  1214. </trigger>
  1215.  
  1216. -- do NOT keep evaluating to occlude dn_ot2_kii
  1217. <trigger
  1218. enabled="y"
  1219. match="^(?:> |)The last of the.*you crash to the ground\.$"
  1220. regexp="y"
  1221. lowercase_wildcard="y"
  1222. script="shield_down"
  1223. name="dn_me2_kii"
  1224. sequence="99"
  1225. custom_colour="17"
  1226. other_text_colour="gold"
  1227. other_back_colour="darkred"
  1228. >
  1229. </trigger>
  1230.  
  1231. <trigger
  1232. enabled="n"
  1233. match="^(?:> |)Some of the .* around (?P<player>.*?)( .*|) detach themselves .*\.$"
  1234. script="shield_down"
  1235. name="dn_ot__kii"
  1236. regexp="y"
  1237. lowercase_wildcard="y"
  1238. sequence="100"
  1239. custom_colour="17"
  1240. other_text_colour="red"
  1241. >
  1242. </trigger>
  1243.  
  1244. <trigger
  1245. enabled="n"
  1246. match="^(?:> |)The last of the .*(?P<player>.*?)( .*|) crash to the ground\.$"
  1247. regexp="y"
  1248. lowercase_wildcard="y"
  1249. script="shield_down"
  1250. name="dn_ot2_kii"
  1251. sequence="100"
  1252. custom_colour="17"
  1253. other_text_colour="red"
  1254. >
  1255. </trigger>
  1256.  
  1257. <trigger
  1258. enabled="y"
  1259. match="^(?:> |)There is a sudden white flash\. Your magical shield has broken\.$"
  1260. regexp="y"
  1261. lowercase_wildcard="y"
  1262. script="shield_down"
  1263. name="dn_me__tpa"
  1264. sequence="100"
  1265. custom_colour="17"
  1266. other_text_colour="gold"
  1267. other_back_colour="darkred"
  1268. >
  1269. </trigger>
  1270.  
  1271. -- occlude up_ot__eff
  1272. <trigger
  1273. enabled="y"
  1274. match="(?:The |)(?P<effitem>.*) begins to float around you\.$"
  1275. regexp="y"
  1276. lowercase_wildcard="y"
  1277. script="shield_up"
  1278. name="up_me__eff"
  1279. sequence="99"
  1280. custom_colour="17"
  1281. other_text_colour="yellowgreen"
  1282. other_back_colour="darkgreen"
  1283. >
  1284. </trigger>
  1285.  
  1286. -- occlude dn_ot__eff
  1287. <trigger
  1288. enabled="y"
  1289. match="^(?:> |)In blocking the attack (?:the |)(?P<effitem>.*) floating around you is knocked out of orbit.$"
  1290. regexp="y"
  1291. lowercase_wildcard="y"
  1292. script="shield_down"
  1293. name="dn_me__eff"
  1294. sequence="99"
  1295. custom_colour="17"
  1296. other_text_colour="gold"
  1297. other_back_colour="darkred"
  1298. >
  1299. </trigger>
  1300.  
  1301. <trigger
  1302. enabled="y"
  1303. match="^(?:> |)(?:A |)(?P<effitem>.*) clatters to the ground.$"
  1304. regexp="y"
  1305. lowercase_wildcard="y"
  1306. name="dn_ot2_eff"
  1307. script="eff_stopped_any"
  1308. sequence="100"
  1309. custom_colour="17"
  1310. other_text_colour="red"
  1311. >
  1312. </trigger>
  1313.  
  1314. <trigger
  1315. enabled="n"
  1316. match="^(?:> |)(?=.*(?P<colour>dull red))(The (.*) glow around |A dull red glow appears around )(?P<player>.*?)( .*|)( becomes dull red.|)$"
  1317. regexp="y"
  1318. lowercase_wildcard="y"
  1319. script="shield_up"
  1320. name="up_ot3_tpa"
  1321. keep_evaluating="y"
  1322. sequence="100"
  1323. custom_colour="17"
  1324. other_text_colour="crimson"
  1325. >
  1326. </trigger>
  1327.  
  1328. <trigger
  1329. enabled="n"
  1330. match="^(?:> |)(?=.*(?P<colour>bright red))(The (.*) glow around |A bright red glow appears around )(?P<player>.*?)( .*|)( becomes bright red.|)$"
  1331. regexp="y"
  1332. lowercase_wildcard="y"
  1333. script="shield_up"
  1334. name="up_ot4_tpa"
  1335. sequence="100"
  1336. keep_evaluating="y"
  1337. custom_colour="17"
  1338. other_text_colour="red"
  1339. >
  1340. </trigger>
  1341.  
  1342. <trigger
  1343. enabled="n"
  1344. match="^(?:> |)(?=.*(?P<colour>wobbling orange))(The (.*) glow around |A wobbling orange glow appears around )(?P<player>.*?)( .*|)( becomes wobbling orange.|)$"
  1345. regexp="y"
  1346. lowercase_wildcard="y"
  1347. script="shield_up"
  1348. name="up_ot5_tpa"
  1349. sequence="100"
  1350. keep_evaluating="y"
  1351. custom_colour="17"
  1352. other_text_colour="orange"
  1353. >
  1354. </trigger>
  1355.  
  1356. <trigger
  1357. enabled="n"
  1358. match="^(?:> |)(?=.*(?P<colour>flickering yellow))(The (.*) glow around |A flickering yellow glow appears around )(?P<player>.*?)( .*|)( becomes flickering yellow.|)$"
  1359. regexp="y"
  1360. lowercase_wildcard="y"
  1361. script="shield_up"
  1362. name="up_ot6_tpa"
  1363. keep_evaluating="y"
  1364. sequence="100"
  1365. custom_colour="17"
  1366. other_text_colour="yellow"
  1367. >
  1368. </trigger>
  1369.  
  1370.  
  1371. <trigger
  1372. enabled="n"
  1373. match="^(?:> |)The (.*) glow around (?P<player>.*?)( .*|) disappears\.$"
  1374. regexp="y"
  1375. lowercase_wildcard="y"
  1376. script="shield_up"
  1377. name="up_ot2_tpa"
  1378. keep_evaluating="y"
  1379. sequence="100"
  1380. custom_colour="17"
  1381. other_text_colour="lawngreen"
  1382. >
  1383. </trigger>
  1384.  
  1385. <trigger
  1386. enabled="y"
  1387. match="^(?:> |)Your shield stops glowing a dull red and lapses back into invisibility\.$"
  1388. regexp="y"
  1389. lowercase_wildcard="y"
  1390. script="shield_up"
  1391. name="up_me2_tpa"
  1392. sequence="100"
  1393. keep_evaluating="y"
  1394. custom_colour="17"
  1395. other_text_colour="yellowgreen"
  1396. other_back_colour="darkgreen"
  1397. >
  1398. </trigger>
  1399.  
  1400. <trigger
  1401. enabled="y"
  1402. 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\.)$"
  1403. regexp="y"
  1404. lowercase_wildcard="y"
  1405. script="shield_up"
  1406. name="up_me3_tpa"
  1407. keep_evaluating="y"
  1408. sequence="100"
  1409. custom_colour="17"
  1410. other_text_colour="crimson"
  1411. >
  1412. </trigger>
  1413.  
  1414. <trigger
  1415. enabled="y"
  1416. 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.)$"
  1417. regexp="y"
  1418. lowercase_wildcard="y"
  1419. script="shield_up"
  1420. name="up_me4_tpa"
  1421. keep_evaluating="y"
  1422. sequence="100"
  1423. custom_colour="17"
  1424. other_text_colour="red"
  1425. >
  1426. </trigger>
  1427.  
  1428. <trigger
  1429. enabled="y"
  1430. 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.)$"
  1431. regexp="y"
  1432. lowercase_wildcard="y"
  1433. script="shield_up"
  1434. name="up_me5_tpa"
  1435. sequence="100"
  1436. keep_evaluating="y"
  1437. custom_colour="17"
  1438. other_text_colour="orange"
  1439. >
  1440. </trigger>
  1441.  
  1442. <trigger
  1443. enabled="y"
  1444. 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.)$"
  1445. regexp="y"
  1446. lowercase_wildcard="y"
  1447. keep_evaluating="y"
  1448. script="shield_up"
  1449. name="up_me6_tpa"
  1450. sequence="100"
  1451. custom_colour="17"
  1452. other_text_colour="yellow"
  1453. >
  1454. </trigger>
  1455.  
  1456.  
  1457. ------------------------------------------------------------------------------------
  1458. -- Shields Weakening Triggers -------------------------------------------------------
  1459.  
  1460. <trigger
  1461. enabled="y"
  1462. match="(.*) but your magical shielding absorbs (most|some) of the blow\.$"
  1463. regexp="y"
  1464. lowercase_wildcard="y"
  1465. script="shield_weaken"
  1466. name="wk_me__tpa"
  1467. keep_evaluating="y"
  1468. sequence="99"
  1469. custom_colour="17"
  1470. other_text_colour="orange"
  1471. >
  1472. </trigger>
  1473.  
  1474. <trigger
  1475. enabled="y"
  1476. 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\.$"
  1477. regexp="y"
  1478. keep_evaluating="y"
  1479. lowercase_wildcard="y"
  1480. script="shield_weaken"
  1481. name="wk_me__kii"
  1482. sequence="99"
  1483. custom_colour="17"
  1484. other_text_colour="orangered"
  1485. >
  1486. </trigger>
  1487.  
  1488. <trigger
  1489. enabled="n"
  1490. 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\.$"
  1491. regexp="y"
  1492. keep_evaluating="y"
  1493. lowercase_wildcard="y"
  1494. script="shield_weaken"
  1495. name="wk_ot__tpa"
  1496. sequence="99"
  1497. custom_colour="17"
  1498. other_text_colour="orange"
  1499. >
  1500. </trigger>
  1501.  
  1502. <trigger
  1503. enabled="n"
  1504. 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\.$"
  1505. regexp="y"
  1506. keep_evaluating="y"
  1507. lowercase_wildcard="y"
  1508. script="shield_weaken"
  1509. name="wk_ot__major"
  1510. sequence="99"
  1511. custom_colour="17"
  1512. other_text_colour="orange"
  1513. >
  1514. </trigger>
  1515.  
  1516. <trigger
  1517. enabled="n"
  1518. 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\.$"
  1519. regexp="y"
  1520. keep_evaluating="y"
  1521. lowercase_wildcard="y"
  1522. script="shield_weaken"
  1523. name="wk_ot__kii"
  1524. sequence="99"
  1525. custom_colour="17"
  1526. other_text_colour="orange"
  1527. >
  1528. </trigger>
  1529.  
  1530.  
  1531. </triggers>
  1532.  
  1533. <!-- Aliases -->
  1534. <aliases>
  1535. <alias
  1536. script="GroupReport"
  1537. match="reportxp"
  1538. enabled="y"
  1539. sequence="100"
  1540. >
  1541. </alias>
  1542.  
  1543. <alias
  1544. script="GroupReportCombat"
  1545. match="reportstats"
  1546. enabled="y"
  1547. sequence="100"
  1548. >
  1549. </alias>
  1550.  
  1551. <alias
  1552. script="MeReport"
  1553. match="showxp"
  1554. enabled="y"
  1555. sequence="100"
  1556. >
  1557. </alias>
  1558.  
  1559. <alias
  1560. script="MeReportCombat"
  1561. match="showstats"
  1562. enabled="y"
  1563. sequence="100"
  1564. >
  1565. </alias>
  1566.  
  1567.  
  1568. <alias
  1569. script="TimerToZero"
  1570. match="resetxp"
  1571. enabled="y"
  1572. sequence="100"
  1573. >
  1574. </alias>
  1575.  
  1576. <alias
  1577. script="StatsToZero"
  1578. match="resetstats"
  1579. enabled="y"
  1580. sequence="100"
  1581. >
  1582. </alias>
  1583.  
  1584. <alias
  1585. script="PosLeft"
  1586. match="sidebarleft"
  1587. enabled="y"
  1588. sequence="100"
  1589. >
  1590. </alias>
  1591.  
  1592. <alias
  1593. script="PosRight"
  1594. match="sidebarright"
  1595. enabled="y"
  1596. sequence="100"
  1597. >
  1598. </alias>
  1599.  
  1600. <alias
  1601. script="SidebarConfig"
  1602. match="sidebar_config"
  1603. enabled="y"
  1604. sequence="100"
  1605. >
  1606. </alias>
  1607.  
  1608. <alias
  1609. enabled="y"
  1610. ignore_case="y"
  1611. match="help sidebar"
  1612. name="helpsidebar"
  1613. send_to="12"
  1614. sequence="100"
  1615. >
  1616. <send>print_help()</send>
  1617. </alias>
  1618.  
  1619. <alias
  1620. match="listgroup"
  1621. enabled="y"
  1622. sequence="100"
  1623. script="list_group"
  1624. >
  1625. </alias>
  1626.  
  1627. <alias
  1628. match="reportkills"
  1629. enabled="y"
  1630. sequence="100"
  1631. script="reportkills"
  1632. >
  1633. </alias>
  1634.  
  1635. <alias
  1636. match="showkills"
  1637. enabled="y"
  1638. sequence="100"
  1639. script="showkills"
  1640. >
  1641. </alias>
  1642.  
  1643. <alias
  1644. match="groupupdate"
  1645. enabled="y"
  1646. sequence="100"
  1647. script="UpdateGroup"
  1648. >
  1649. </alias>
  1650.  
  1651. <alias
  1652. match="hideidlespam"
  1653. enabled="y"
  1654. sequence="100"
  1655. script="toggleidlespam"
  1656. >
  1657. </alias>
  1658.  
  1659.  
  1660. <alias
  1661. match="groupreset"
  1662. enabled="y"
  1663. sequence="100"
  1664. script="ResetGroup"
  1665. >
  1666. </alias>
  1667.  
  1668. <alias
  1669. match="showhitcolours"
  1670. enabled="y"
  1671. sequence="100"
  1672. script="togglehitcolour"
  1673. >
  1674. </alias>
  1675.  
  1676. <alias
  1677. match="triggercolours"
  1678. enabled="y"
  1679. sequence="100"
  1680. script="toggletriggercolours"
  1681. >
  1682. </alias>
  1683.  
  1684. <alias
  1685. 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>.*)|)|)\)"
  1686. regexp="y"
  1687. ignore_case="y"
  1688. name="settriggercolouralias"
  1689. enabled="y"
  1690. sequence="100"
  1691. script="settriggercolours"
  1692. >
  1693. </alias>
  1694.  
  1695. <alias
  1696. match="showtriggercolours"
  1697. enabled="y"
  1698. sequence="100"
  1699. script="displaycolours"
  1700. >
  1701. </alias>
  1702.  
  1703. <alias
  1704. match="hidelookmap"
  1705. enabled="y"
  1706. sequence="100"
  1707. script="toggletriggerhiding"
  1708. >
  1709. </alias>
  1710.  
  1711. <alias
  1712. match="fixedbarcolours"
  1713. enabled="y"
  1714. sequence="100"
  1715. script="togglepercentcolours"
  1716. >
  1717. </alias>
  1718.  
  1719. <alias
  1720. match="^xpdetailplot(\((?P<avg>\d+)\)|)$"
  1721. regexp="y"
  1722. enabled="y"
  1723. sequence="100"
  1724. script="togglexpdetail"
  1725. >
  1726. </alias>
  1727.  
  1728. <alias
  1729. match="^gpding(\((?P<file>.*?)(,(?P<vol>.*)\)|\))|)$"
  1730. regexp="y"
  1731. enabled="y"
  1732. sequence="100"
  1733. script="setgpding"
  1734. >
  1735. </alias>
  1736.  
  1737. <alias
  1738. match="^doublewin(\((?P<tab>[1-4])\)|)$"
  1739. regexp="y"
  1740. enabled="y"
  1741. sequence="100"
  1742. script="toggledoublewin"
  1743. >
  1744. </alias>
  1745.  
  1746. <alias
  1747. match="showdebugoptions"
  1748. enabled="y"
  1749. sequence="100"
  1750. script="debugoptions"
  1751. >
  1752. </alias>
  1753.  
  1754. <alias
  1755. match="showmxpdebug"
  1756. enabled="y"
  1757. sequence="100"
  1758. script="toggleshowmxp"
  1759. >
  1760. </alias>
  1761.  
  1762. <alias
  1763. match="groupjointoggle"
  1764. enabled="y"
  1765. sequence="100"
  1766. script="togglegroupjoin"
  1767. >
  1768. </alias>
  1769.  
  1770. <alias
  1771. match="^gpregenrate\((?P<rate>[1-4]*)\)"
  1772. enabled="y"
  1773. regexp="y"
  1774. ignore_case="y"
  1775. name="regenratealias"
  1776. sequence="100"
  1777. script="setgpregen"
  1778. >
  1779. </alias>
  1780.  
  1781. <alias
  1782. match="hidecombatspam"
  1783. enabled="y"
  1784. sequence="100"
  1785. script="togglecombatspam"
  1786. >
  1787. </alias>
  1788.  
  1789.  
  1790. </aliases>
  1791.  
  1792. <timers>
  1793. <timer
  1794. script="grab_time"
  1795. enabled="y"
  1796. minute="1"
  1797. >
  1798. </timer>
  1799.  
  1800. <timer
  1801. script="show_time"
  1802. enabled="y"
  1803. second="1.00"
  1804. >
  1805. </timer>
  1806.  
  1807. <timer
  1808. script="approx_tick"
  1809. enabled="y"
  1810. second="2.00"
  1811. >
  1812. </timer>
  1813. </timers>
  1814.  
  1815. <script>
  1816. <![CDATA[
  1817. bar_width = 180
  1818. map_height = 220
  1819.  
  1820. require "serialize" -- needed to serialize table to string
  1821.  
  1822. -- which tab to show on start up
  1823. TAB_SHOW = 1
  1824.  
  1825. -- colours used
  1826. COLOURS = COLOURS or {}
  1827. COLOURS.BACKGROUND = COLOURS.BACKGROUND or ColourNameToRGB ("black")
  1828. COLOURS.HEADER = COLOURS.HEADER or ColourNameToRGB ("silver")
  1829. COLOURS.OUTLINE = COLOURS.OUTLINE or ColourNameToRGB ("dimgray")
  1830. COLOURS.TEXT = COLOURS.TEXT or ColourNameToRGB ("silver")
  1831. COLOURS.MAP_BACKGROUND = COLOURS.MAP_BACKGROUND or ColourNameToRGB ("black")
  1832. COLOURS.HP = COLOURS.HP or ColourNameToRGB ("forestgreen")
  1833. COLOURS.GP = COLOURS.GP or ColourNameToRGB ("blue")
  1834. COLOURS.BURDEN = COLOURS.BURDEN or ColourNameToRGB ("firebrick")
  1835.  
  1836. COLOURS.HPHIGH = COLOURS.HPHIGH or tonumber("009000",16)
  1837. COLOURS.GPHIGH = COLOURS.GPHIGH or tonumber("ee0000",16)
  1838. COLOURS.BURDENHIGH = COLOURS.BURDENHIGH or tonumber("009000",16)
  1839. COLOURS.HPMED = COLOURS.HPMED or tonumber("00dddd",16)
  1840. COLOURS.GPMED = COLOURS.GPMED or tonumber("990044",16)
  1841. COLOURS.BURDENMED = COLOURS.BURDENMED or tonumber("00dddd",16)
  1842. COLOURS.HPLOW = COLOURS.HPLOW or ColourNameToRGB ("red")
  1843. COLOURS.GPLOW = COLOURS.GPLOW or tonumber("660066",16)
  1844. COLOURS.BURDENLOW = COLOURS.BURDENLOW or ColourNameToRGB ("red")
  1845.  
  1846. COLOURS.OHITS = COLOURS.OHITS or ColourNameToRGB ("forestgreen")
  1847. COLOURS.OSPECIALS = COLOURS.OSPECIALS or ColourNameToRGB ("forestgreen")
  1848. COLOURS.DPARRY = COLOURS.DPARRY or ColourNameToRGB ("firebrick")
  1849. COLOURS.DDODGE = COLOURS.DDODGE or ColourNameToRGB ("firebrick")
  1850. COLOURS.DBLOCK = COLOURS.DBLOCK or ColourNameToRGB ("firebrick")
  1851. COLOURS.DSHIELD = COLOURS.DSHIELD or ColourNameToRGB ("firebrick")
  1852. COLOURS.DHITS = COLOURS.DHITS or ColourNameToRGB ("firebrick")
  1853.  
  1854. DEFTRIGCOL = {}
  1855.  
  1856. DEFTRIGCOL.UPME = "17"
  1857. DEFTRIGCOL.DNME = "17"
  1858. DEFTRIGCOL.WKME = "17"
  1859. DEFTRIGCOL.GOME = "0" -- don't use
  1860.  
  1861. DEFTRIGCOL.UPOT = "0"
  1862. DEFTRIGCOL.DNOT = "0"
  1863. DEFTRIGCOL.GOOT = "0" -- don't use
  1864.  
  1865. DEFTRIGCOL.HTME = "17"
  1866.  
  1867. DEFTRIGCOL.UPMETEXT = "yellowgreen"
  1868. DEFTRIGCOL.UPMEBACK = "darkgreen"
  1869. DEFTRIGCOL.DNMETEXT = "goldenrod"
  1870. DEFTRIGCOL.DNMEBACK = "darkred"
  1871. DEFTRIGCOL.WKMETEXT = "orangered"
  1872. DEFTRIGCOL.WKMEBACK = "black"
  1873. DEFTRIGCOL.GOMETEXT = "orange"
  1874. DEFTRIGCOL.GOMEBACK = "black"
  1875.  
  1876. DEFTRIGCOL.UPOTTEXT = "lawngreen"
  1877. DEFTRIGCOL.UPOTBACK = "black"
  1878. DEFTRIGCOL.DNOTTEXT = "red"
  1879. DEFTRIGCOL.DNOTBACK = "black"
  1880. DEFTRIGCOL.GOOTTEXT = "orange"
  1881. DEFTRIGCOL.GOOTBACK = "black"
  1882.  
  1883. DEFTRIGCOL.HTMETEXT = "goldenrod"
  1884. DEFTRIGCOL.HTMEBACK = "black"
  1885.  
  1886. -- store defaults first time
  1887. TRIGCOL = TRIGCOL or {}
  1888. for k,v in pairs(DEFTRIGCOL) do TRIGCOL[k] = TRIGCOL[k] or v end
  1889.  
  1890. SETTINGS = SETTINGS or {}
  1891. SETTINGS.PERCENT_COLOURS = SETTINGS.PERCENT_COLOURS or true
  1892. SETTINGS.TRIGGER_COLOURS = SETTINGS.TRIGGER_COLOURS or true
  1893. SETTINGS.TRIGGER_SHOW = SETTINGS.TRIGGER_SHOW or false
  1894. SETTINGS.XPDETAIL_SHOW = SETTINGS.XPDETAIL_SHOW or true
  1895. SETTINGS.DOUBLEWIN = SETTINGS.DOUBLEWIN or false
  1896. SETTINGS.SHOWMXP = SETTINGS.SHOWMXP or false
  1897. SETTINGS.DWWIN = SETTINGS.DWWIN or 4
  1898. SETTINGS.COMBAT = SETTINGS.COMBAT or 0
  1899. SETTINGS.IDLE = SETTINGS.IDLE or 0
  1900. SETTINGS.HITCOLOUR = SETTINGS.HITCOLOUR or 0
  1901. SETTINGS.XPDETAIL_AVG = SETTINGS.XPDETAIL_AVG or 10
  1902. SETTINGS.GPDING = SETTINGS.GPDING or false
  1903. SETTINGS.GPFILE = SETTINGS.GPFILE
  1904. SETTINGS.GPVOL = SETTINGS.GPVOL or 0
  1905. SETTINGS.GROUPJOIN = SETTINGS.GROUPJOIN or true
  1906.  
  1907. GROUP_TRIGGERS = false
  1908.  
  1909. -------------------------------------------------------------------------------------------
  1910. -- Stat capture code
  1911. -------------------------------------------------------------------------------------------
  1912.  
  1913. SetVariable ("me", "0")
  1914. SetVariable ("myeff", "0")
  1915. groupnumber = 0
  1916. leavenumber = 0
  1917. shufflenumber = 0
  1918. prot_name = "0"
  1919.  
  1920. ArrayCreate ("group")
  1921. ArrayCreate ("numbers")
  1922.  
  1923. ArrayCreate ("hpt")
  1924. ArrayImport ("hpt", { ['perfectly healthy, for a ghost'] = 0,['near death'] = 1,['critically wounded'] = 2,
  1925. ['seriously wounded'] = 3,['heavily wounded'] = 4,['badly wounded'] = 5,['wounded'] = 6,
  1926. ['slightly wounded'] = 7,['injured'] = 8,['slightly injured'] = 9,['slightly hurt'] = 10,
  1927. ['scratched'] = 11,['almost unhurt'] = 12,['unhurt'] = 13 })
  1928.  
  1929. ArrayCreate ("gpt")
  1930. ArrayImport("gpt", { ['unconscious'] = 0, ['near unconscious'] = 1, ['severely fatigued'] = 2,
  1931. ['highly fatigued'] = 3, ['very fatigued'] = 4, ['fatigued'] = 5, ['slightly fatigued'] = 6,
  1932. ['confused'] = 7, ['slightly confused'] = 8, ['concentrated'] = 9, ['clear of mind'] = 10,
  1933. ['refreshed'] = 11 })
  1934.  
  1935. ArrayCreate ("kiis")
  1936. ArrayImport("kiis", { ['handful'] = "orange", ['cloud'] = "orange", ['small swarm'] = "yellow",
  1937. ['large swarm'] = "yellow", ['vast swarm'] = "yellow", ['plague'] = "white" })
  1938.  
  1939. ArrayCreate ("cccs")
  1940. ArrayImport("cccs", { ['has been hardened to a rock-like form'] = "white",
  1941. ['has been hardened with numerous layers of a mineral-like substance'] = "yellow",
  1942. ['has been hardened with a chalk-like substance'] = "yellow",
  1943. ['is covered with several layers of a chalk-like substance'] = "orange",
  1944. ['has been covered with several layers of a chalk-like substance'] = "orange",
  1945. ['has been covered with a thin layer of chalk'] = "red" })
  1946.  
  1947. ArrayCreate ("tpas")
  1948. ArrayImport("tpas", { ['dull red'] = "crimson",
  1949. ['bright red'] = "red",
  1950. ['wobbling orange'] = "orange",
  1951. ['flickering yellow'] = "yellow" })
  1952.  
  1953.  
  1954. ------------------------------------------------------------------------------------------------------------
  1955. -- This creates the funky metatable that lets us use MUSHClient variables (which persist) as Lua variables--
  1956. -- (which don't). Awesome, no? It uses a metatable, where the __index value refers to a function that --
  1957. -- defines what happens when a value is retrieved, and the __newindex value to a function that defines --
  1958. -- what happens when a value is created. --
  1959. -- --
  1960. -- Due to the case-insensitive and string-valued nature of MUSHClient variables, though, some on-the-fly --
  1961. -- type correction is required, and the table's elements are all also case-insensitive. --
  1962. ------------------------------------------------------------------------------------------------------------
  1963. mushvar = {} -- variables table
  1964.  
  1965. setmetatable (mushvar,
  1966. {
  1967. -- called to access an entry
  1968. __index =
  1969. function (t, name)
  1970. if GetPluginID() ~= "" then
  1971. tmp = GetVariable(string.lower(name))
  1972. else
  1973. Note("Warning: Trying using pluginvariable.")
  1974. tmp = GetPluginVariable(pluginid, string.lower(name))
  1975. end
  1976. tempvalue = tonumber( tmp )
  1977. if tempvalue == nil then
  1978. tempvalue = tmp
  1979. end
  1980. return tempvalue
  1981. end;
  1982.  
  1983. -- called to change or delete an entry
  1984. __newindex =
  1985. function (t, name, val)
  1986.  
  1987. if GetPluginID() == "" then
  1988. error ("Changing mushvar outside plugin.")
  1989. end
  1990.  
  1991. name=string.lower(name)
  1992. local result
  1993. if val == nil then -- nil deletes it
  1994. result = DeleteVariable (name)
  1995. else
  1996. result = SetVariable (name, tostring (val))
  1997. end
  1998.  
  1999. -- warn if they are using bad variable names
  2000. if result == error_code.eInvalidObjectLabel then
  2001. error ("Bad variable name '" .. name .. "'")
  2002. end
  2003. end;
  2004. })
  2005.  
  2006. --[[
  2007. These are all the variables that are saved over instances, and what they do.
  2008.  
  2009. FirstCheck Checks for First Usage to set these.
  2010. HP, GP, XP Hitpoints, guildpoints, experience points currently.
  2011. OldHP Previous values for comparison.
  2012. OldGP
  2013. OldXP
  2014. MaxHP These attribute's maxima.
  2015. MaxGP
  2016. ]]
  2017.  
  2018. if world.GetVariable("FirstChecker") == nil then
  2019. mushvar.FirstChecker = 1
  2020. mushvar.HP=50
  2021. mushvar.GP=50
  2022. mushvar.XP=50
  2023. mushvar.SP=50 -- social points
  2024. mushvar.gpest=50
  2025.  
  2026. mushvar.gptick=3
  2027. mushvar.oldHP=49
  2028. mushvar.oldGP=49
  2029. mushvar.oldXP=49
  2030. mushvar.oldSP=49
  2031. mushvar.maxHP=51
  2032. mushvar.maxGP=51
  2033. mushvar.maxSP=51
  2034. mushvar.burden=20
  2035. mushvar.maxburden=100
  2036. mushvar.oldburden=19
  2037.  
  2038. -- miniwindow locations (left by default)
  2039. mushvar.xppos=4 -- 4 =left 6=right
  2040. mushvar.mappos=11 -- 11=left 7=right
  2041. mushvar.barpos=10 -- 10=left 8=right
  2042. mushvar.bar_position=1 -- 1 =left 2=right
  2043.  
  2044. -- combat varibles
  2045. mushvar.dodgedhits=0
  2046. mushvar.parriedhits=0
  2047. mushvar.blockedhits=0
  2048. mushvar.armourhits=0
  2049. mushvar.totalenemyhits=0
  2050. mushvar.totaldefend=0
  2051. mushvar.percentdefend=0
  2052. mushvar.percentparried=0
  2053. mushvar.percentdodged=0
  2054. mushvar.percentblocked=0
  2055. mushvar.percentshielded=0
  2056. mushvar.percenthit=0
  2057. mushvar.totalhit=0
  2058. mushvar.percentlaunched=0
  2059. mushvar.successhits=0
  2060. mushvar.missedhits=0
  2061. mushvar.attempted=0
  2062. mushvar.combatrounds=0
  2063. mushvar.hitrate=0
  2064. mushvar.successspecials=0
  2065. mushvar.failspecials=0
  2066. mushvar.percentspecialhit=0
  2067. mushvar.attemptedspecials=0
  2068. end -- End of first-run variable definition.
  2069.  
  2070. ------------------------------------------------------------------------------------------------------------
  2071. --This is, arguably, the most important function in the plugin - it takes the values provided by the MUD --
  2072. -- for HP, GP, XP and sets their values in the system, or, more specifically, in mushvar[attributename] --
  2073. ------------------------------------------------------------------------------------------------------------
  2074. boolStatSet={}
  2075. boolStatSet.hp=0
  2076. boolStatSet.gp=0
  2077. boolStatSet.xp=0
  2078. boolStatSet.burden=0
  2079.  
  2080. ignoretable={['xp'] = 1, ['gp'] = 1, ['hp'] = 1, ['maxhp'] = 1, ['maxgp'] = 1, ['burden'] = 1,
  2081. ['sp'] = 1, ['maxsp'] = 1, ['club'] = 1,['informtypes'] = 1, ['guilds'] = 1, ['channels'] = 1,
  2082. ['informtype'] = 1, ['clubnames'] = 1, ['groupcmds'] = 1, ['talkerchannels'] = 1}
  2083.  
  2084. tagignoretable={['send,'] = 1, ['br,'] = 1,['exit,'] = 1}
  2085.  
  2086. function OnPluginMXPerror (level, number, line, message)
  2087. local inputs = utils.split(level, ',')
  2088. level = inputs[1]
  2089. number = inputs[2]
  2090. line = inputs[3]
  2091. message = inputs[4]
  2092.  
  2093. if level == "E" and number == "1023" then
  2094. if string.match(message,"mapstart") ~= nil then
  2095. MapStart()
  2096. return 1
  2097. elseif string.match(message,"mapend") ~= nil then
  2098. MapEnd()
  2099. return 1
  2100. end
  2101. end
  2102.  
  2103. end -- function
  2104.  
  2105. function MapStart()
  2106. map_lines = {}
  2107. EnableTrigger ("multi_line_map", true) -- capture subsequent lines
  2108. EnableTrigger ("map_end", true) -- capture subsequent lines
  2109. if map_title_fresh ~= true then
  2110. map_title = "Map <glance mode>"
  2111. end
  2112. end
  2113.  
  2114. function MapEnd()
  2115. EnableTrigger ("multi_line_map", false) -- capture subsequent lines
  2116. EnableTrigger ("map_end", false) -- capture subsequent lines
  2117. Display_Map ()
  2118. map_title_fresh = false
  2119. end
  2120.  
  2121. function OnPluginMXPsetEntity (sIn)
  2122. local value = utils.split(sIn, '=')
  2123. local attribute = value[1]
  2124. value = tonumber( value[2] )
  2125.  
  2126. if attribute == "xp" and value == 0 and world.GetConnectDuration() < 5 then
  2127. -- ignore it.
  2128. else
  2129. mushvar["old"..attribute] = mushvar[attribute]
  2130. mushvar[attribute] = value
  2131. boolStatSet[attribute]=1
  2132. end
  2133.  
  2134. if SETTINGS.SHOWMXP and ignoretable[attribute] == nil then
  2135. Note(sIn)
  2136. end
  2137.  
  2138. if attribute == "gp" then
  2139. mushvar.gpest = mushvar.gp
  2140. end
  2141.  
  2142. if attribute == "hp" and not (boolStatSet.gp==1 and boolStatSet.xp==1) then
  2143. -- always update the hp bar.. (slight waste if we're going to redo the others later.. but keeps it accurate)
  2144. DrawGauges()
  2145. end
  2146.  
  2147. if attribute == "burden" then DrawGauges() end
  2148. if boolStatSet.hp==1 and boolStatSet.gp==1 and boolStatSet.xp==1 then
  2149. boolStatSet.hp=0
  2150. boolStatSet.gp=0
  2151. boolStatSet.xp=0
  2152. CompleteSet()
  2153. end -- if
  2154. if boolStatSet.maxhp==1 and boolStatSet.maxgp==1 then
  2155. boolStatSet.maxhp=0
  2156. boolStatSet.maxgp=0
  2157. if mushvar.maxhp~=mushvar.oldmaxhp or mushvar.maxgp~=mushvar.oldmaxgp then
  2158. mushvar.oldhp=mushvar.hp
  2159. mushvar.oldgp=mushvar.gp
  2160. mushvar.oldxp=mushvar.xp
  2161. CompleteSet() --Fake it, in order to push the new maxima.
  2162. end -- if
  2163. end -- if
  2164. --CompleteSet()
  2165. end -- OnPluginMXPsetEntity
  2166.  
  2167. function CompleteSet()
  2168. if GetPluginID() == "" then
  2169. Note("Warning: Completeset not in plugin.")
  2170. end
  2171.  
  2172. --[[
  2173. -- Sidebar on the left or right?
  2174. if mushvar.bar_position == 1 then
  2175. mushvar.xppos=4
  2176. mushvar.mappos=11
  2177. mushvar.barpos=10
  2178. TextRectangle(bar_width+1, 0, 0, 0, 0,0x000000,0,0x000000,0) -- Push text left
  2179. elseif mushvar.bar_position == 2 then
  2180. mushvar.xppos=6
  2181. mushvar.mappos=7
  2182. mushvar.barpos=8
  2183. TextRectangle(0, 0, GetInfo (281) - bar_width - 1, 0, 0,0x000000,0,0x000000,0)
  2184. end -- if
  2185. ]]
  2186.  
  2187. DrawGauges ()
  2188. XPMath()
  2189. end -- CompleteSet
  2190.  
  2191. -------------------------------------------------------------------------------------------
  2192. -- This catches the values sent by the trigger that
  2193. -- matches the monitor line, and performs the same
  2194. -- actions as if they had been set as Entities as above.
  2195. -- Maximum HP and GP, and xp, are not sent by the monitor.
  2196. -------------------------------------------------------------------------------------------
  2197. function OnHealthTrigger (iHP, iMaxHP, iGP, iMaxGP, iXP)
  2198. mushvar.MaxHP = iMaxHP
  2199. mushvar.MaxGP = iMaxGP
  2200.  
  2201. mushvar.combatrounds = mushvar.combatrounds + 1
  2202.  
  2203. OnPluginMXPsetEntity ("hp="..iHP)
  2204. OnPluginMXPsetEntity ("xp="..iXP)
  2205. OnPluginMXPsetEntity ("gp="..iGP)
  2206. OnPluginMXPsetEntity ("maxhp="..iMaxHP)
  2207. OnPluginMXPsetEntity ("maxgp="..iMaxGP)
  2208. end -- OnHealthTrigger
  2209.  
  2210. function PosLeft (sName, sLine, wildcards)
  2211. --WindowShow (XPWin, false)
  2212. --WindowShow (MapWin, false)
  2213. --WindowShow (GaugeWin, false)
  2214. mushvar.bar_position = 1
  2215. EnsureSize()
  2216. CompleteSet()
  2217. if WindowInfo(MapWin, 5) then
  2218. Display_Map()
  2219. end
  2220. end -- posleft
  2221.  
  2222. function PosRight (sName, sLine, wildcards)
  2223. --WindowShow (XPWin, false)
  2224. --WindowShow (MapWin, false)
  2225. --WindowShow (GaugeWin, false)
  2226. mushvar.bar_position = 2
  2227. EnsureSize()
  2228. CompleteSet()
  2229. if WindowInfo(MapWin, 5) then
  2230. Display_Map()
  2231. end
  2232. end -- posright
  2233.  
  2234.  
  2235. function EnsureSize (sName, sLine, wildcards)
  2236.  
  2237. -- Sidebar on the left or right?
  2238. if mushvar.bar_position == 1 then
  2239. mushvar.xppos=4
  2240. mushvar.mappos=11
  2241. mushvar.barpos=10
  2242. TextRectangle(bar_width+1, 0, 0, 0, 0,0x000000,0,0x000000,0) -- Push text left
  2243. elseif mushvar.bar_position == 2 then
  2244. mushvar.xppos=6
  2245. mushvar.mappos=7
  2246. mushvar.barpos=8
  2247. TextRectangle(0, 0, GetInfo (281) - bar_width - 1, 0, 0,0x000000,0,0x000000,0)
  2248. end -- if
  2249.  
  2250. --[[if GetOption("auto_wrap_window_width") then
  2251. -- manually calculate and set the text wrap value
  2252. local newcol = math.floor((GetInfo(281)-bar_width - 1) / GetInfo(240))
  2253.  
  2254. if newcol ~= GetOption("wrap_column") then
  2255. Note("Wrapping at: " .. newcol)
  2256. SetOption("wrap_column",math.floor((GetInfo(281)-bar_width - 1) / GetInfo(240)))
  2257. end
  2258. end]]
  2259. end
  2260.  
  2261. function debugoptions (sName, sLine, wildcards)
  2262. for k, v in pairs (GetOptionList()) do
  2263. Note (v, " = ", GetOption (v))
  2264. end
  2265. end
  2266.  
  2267. DoAfterSpecial (1, "EnsureSize()", sendto.script) -- call when starting script
  2268.  
  2269. -------------------------------------------------------------------------------------------
  2270. -- XP counter code
  2271. -------------------------------------------------------------------------------------------
  2272. local time=0
  2273. local basexp
  2274. local xp
  2275. local mins
  2276. local lastxp
  2277. local lasttime=0
  2278. basexp = 0
  2279. time_text = ""
  2280. xp_text = "XP: "
  2281. av_text = "0 mins. 0 xp/h"
  2282. report_text = ""
  2283.  
  2284. -- count number of times non-group members have done killing
  2285. other_kills = 0
  2286.  
  2287.  
  2288. -- window sizes
  2289. GRAPH_WIDTH = 120
  2290. INDENT = 42
  2291. HEADER = 20
  2292. HEIGHT = 150
  2293. SPACE = 20
  2294. FOOTER = 5
  2295. BUTTON_HEIGHT = (HEIGHT-16)/4
  2296.  
  2297. function StartUp (sName, sLine, wildcards) -- set the graph to starting values
  2298. -- XP Point Tables to use on startup
  2299. points = {}
  2300. 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,
  2301. 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,
  2302. 0, 0, 0, 0, 0, 0, 0, 0}
  2303. dpoints = {}
  2304. 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,
  2305. 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,
  2306. 0, 0, 0, 0, 0, 0, 0, 0}
  2307. dvals = {}
  2308. 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,
  2309. 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,
  2310. 0, 0, 0, 0, 0, 0, 0, 0}
  2311. dcount = 0
  2312. end -- StartUp
  2313.  
  2314. -----------------------------------------------
  2315. -- Called by alias and hotspot to zero timer --
  2316. -----------------------------------------------
  2317. function TimerToZero (sName, sLine, wildcards)
  2318. time = 0
  2319. XPMath ()
  2320. end -- TimerToZero
  2321.  
  2322. function GroupReport (sName, sLine, wildcards)
  2323. XPMath ()
  2324. Execute("group say " .. report_text)
  2325. end -- GroupReport
  2326.  
  2327. function GroupReportCombat (sName, sLine, wildcards)
  2328. CompleteSet ()
  2329. 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 .. "%%)")
  2330. Execute("group say " .. report_combat_text)
  2331. end -- GroupReportCombat
  2332.  
  2333. function MeReport (sName, sLine, wildcards)
  2334. XPMath ()
  2335. Note(report_text)
  2336. end -- MeReport
  2337.  
  2338. function MeReportCombat (sName, sLine, wildcards)
  2339. CompleteSet ()
  2340. 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 .. "%%)")
  2341. Note(report_combat_text)
  2342. end -- MeReportCombat
  2343.  
  2344. function XPMath (sName, sLine, wildcards)
  2345.  
  2346. if time==0 or (world.GetConnectDuration() < lasttime) or (mushvar.xp < lastxp) then
  2347. time = world.GetConnectDuration()
  2348. end -- if
  2349.  
  2350. if (world.GetConnectDuration() - time) < 2 then
  2351. --Note("resetting base: " .. tostring(basexp) .. " " .. mushvar.xp)
  2352. basexp = mushvar.xp
  2353. lastxp = mushvar.xp
  2354. end -- if reset xp until 2 seconds gone..
  2355.  
  2356. xpdiff=mushvar.xp-basexp
  2357. timediff = math.max(15, world.GetConnectDuration() - time) -- always use a minimum of 15s difference
  2358. mins=string.format("%4.2f", (timediff/60))
  2359. xp_ph = string.format("%1.0f", (xpdiff/(timediff/3600)))
  2360. lasttime = time;
  2361.  
  2362. -- Text to print
  2363. xp_text = string.format("XP: " .. mushvar.xp)
  2364. av_text = string.format(mins .. " mins. " .. xp_ph .. " xp/h")
  2365. time_text = string.format(xpdiff .. "xp gained in")
  2366.  
  2367. report_text = string.format("Current XP: " .. mushvar.xp .. ". " .. xpdiff .. " xp gained in " .. mins .. " mins. Average xp/h: " .. (math.floor (xpdiff/(timediff/3600))) .. ".")
  2368.  
  2369. DoPrompt ()
  2370. end -- XPMath
  2371.  
  2372. function grab_time (sName, sLine, wildcards)
  2373. -- This moves the graph points along one tick when the timer fires
  2374. table.remove (points, 1)
  2375.  
  2376. -- Do not let the XP Point go above 100 or below 0
  2377. if (xp_ph/10000) > 100 then
  2378. table.insert (points, 100)
  2379. elseif (xp_ph/10000) < 0 then
  2380. table.insert (points, 0)
  2381. else
  2382. table.insert (points, (xp_ph/10000))
  2383. end -- if
  2384.  
  2385. table.remove (dvals, 1)
  2386. table.insert (dvals, mushvar.xp - lastxp)
  2387. if dcount < 60 then
  2388. dcount = dcount + 1
  2389. end
  2390.  
  2391. table.remove (dpoints, 1)
  2392.  
  2393. -- Do not let the Delta XP Point go above 100 or below 0
  2394.  
  2395. local deltaxp_ph = 0
  2396.  
  2397. for i = 1,math.min(SETTINGS.XPDETAIL_AVG,dcount) do
  2398. deltaxp_ph = deltaxp_ph + dvals[61-i]
  2399. end
  2400.  
  2401. deltaxp_ph = deltaxp_ph * 60 / math.min(SETTINGS.XPDETAIL_AVG, dcount)
  2402.  
  2403. lastxp = mushvar.xp
  2404.  
  2405. if (deltaxp_ph/10000) > 100 then
  2406. table.insert (dpoints, 100)
  2407. elseif deltaxp_ph < 0 then
  2408. table.insert (dpoints, 0)
  2409. else
  2410. table.insert (dpoints, (deltaxp_ph/10000))
  2411. end -- if
  2412.  
  2413. DoPrompt ()
  2414. end
  2415.  
  2416. -------------------------------------------------------------------------------------------
  2417. -- Time and date code mostly taken from Ian Kirkers plugin (latest health bar) found at
  2418. -- http://homepage.ntlworld.com/ian.avery2/ on the plugins page
  2419. -------------------------------------------------------------------------------------------
  2420. function show_time( )
  2421. if TAB_SHOW == 3 then
  2422. DoPrompt ()
  2423. end
  2424. end
  2425.  
  2426. function gpding()
  2427. -- script function called when gp estimate reaches max
  2428. if SETTINGS.GPDING then
  2429. --Note("maxgp")
  2430. PlaySound(0,SETTINGS.GPFILE,false,SETTINGS.GPVOL)
  2431. end
  2432. end
  2433.  
  2434. function approx_tick( )
  2435. if mushvar.gpest ~= nil and mushvar.gp ~= mushvar.maxgp and mushvar.gpest ~= mushvar.maxgp then
  2436. if GetPluginID() == "" then
  2437. Note("Warning: Tick occurred outside of plugin.")
  2438. return
  2439. end
  2440. mushvar.gpest = math.min(mushvar.gpest + mushvar.gptick, mushvar.maxgp)
  2441.  
  2442. DrawGauges()
  2443. if mushvar.gpest == mushvar.maxgp then
  2444. gpding()
  2445. end
  2446. end
  2447. end
  2448.  
  2449. --Converts a UNIX Time into an array containing elements
  2450. -- of the Discworld time.
  2451.  
  2452. function unix_to_disc_time( Tick )
  2453. if Tick==nil then Tick = os.time() end --Default to Now.
  2454.  
  2455. --Arrays containing the names of months, days, cycles, and the number of days in each month.
  2456. 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"}
  2457. day_names ={[0] = "Octeday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday", "Oct", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}
  2458. days_per_month={[0] = 31,30,31,31,31,30,31,31,31,30,31,31,31}
  2459. cycles = {[0] = "Prime", "Secundus", "I", "II"}
  2460.  
  2461. fmod = math.fmod --"Pointers" to maths library functions.
  2462. floor = math.floor -- Just because I dislike typing math. every time.
  2463. --Calculating simple elements:
  2464. S = floor(fmod(Tick, 18)) --Seconds
  2465. M = floor(fmod(Tick, 18*60)/18) --Minutes
  2466. H = floor(fmod(Tick, 18*60*24)/(18*60)) --Hours (on the 24 hour clock)
  2467. I = fmod(H, 12) if I == 0 then I = 12 end --Hours (on the 12 hour clock)
  2468. j = floor(fmod(Tick, 18*60*24*400)/(18*60*24)) --Day of the year (0-399)
  2469. 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.
  2470. Y = floor(Tick/(18*60*24*400*2)) + 1966 --Year (four digit number)
  2471. C = floor(fmod((Tick/(18*60*24*400)),2)) --Cycle (0 -> Prime, 1 -> Secundus)
  2472.  
  2473. --Calculating which month the time is in.
  2474. day_stack = j -- Basically, we pop days off the stack in months at a time
  2475. m=0 -- until there are less than a month remaining.
  2476. while (day_stack>=days_per_month[m]) do
  2477. day_stack = day_stack - days_per_month[m]
  2478. m = m + 1
  2479. end
  2480.  
  2481. d = day_stack + 1 ; --And then make a correction for the lack of a 0th day of year, before setting the
  2482. -- day of the month element.
  2483. --d = day_stack -- Or not, if you want to use zero based month days as well.
  2484.  
  2485. --Related Strings.
  2486. B = month_names[m] -- Name of the month.
  2487. b = month_names[m + 13] -- TLA of the month.
  2488. A = day_names[w] -- Name of the day.
  2489. a = day_names[w+8] -- TLA of the day.
  2490. P = cycles[C] -- Name of the cycle.
  2491. p = cycles[C+2] -- Roman numberal of the cycle.
  2492. if H > 11 then Z = "pm" else Z = "am" end -- AM/PM.
  2493.  
  2494. --Special Day checks!
  2495. special_day = nil
  2496.  
  2497. if m==0 and d==1 then
  2498. if C==0 then special_day = "Hogswatch"
  2499. else special_day = "Crueltide"
  2500. end
  2501. end
  2502. if m==6 and d==16 then
  2503. special_day = "Small Gods day"
  2504. end
  2505. if m==7 and d==23 then
  2506. special_day = "Soul Cake Tuesday"
  2507. end
  2508. if m==9 and d==1 then
  2509. special_day = "Sektober Fools' Day"
  2510. end
  2511.  
  2512. if special_day then D=special_day else D=A end
  2513.  
  2514. return S, M, H, Z, I, j, w, Y, C, m, d, B, b, A, a, P, p, special_day, D
  2515. --S Seconds (no leading zeroes added)
  2516. --M Minutes (no leading zeroes added)
  2517. --H Hours (24) (no leading zeroes added)
  2518. --Z am/pm
  2519. --I Hours (12)
  2520. --j Day of Year (0 - 399)
  2521. --w Day of Week as Number
  2522. --Y Year
  2523. --C Cycle as number (0 - 1)
  2524. --m Month of year as number
  2525. --d Day of month
  2526. --B Month of year as string
  2527. --b Month of year as abbreviated string
  2528. --A Day of week as string
  2529. --a Day of week as abbreviated string
  2530. --P Cycle as string
  2531. --p Cycle as abbreviated string
  2532. --special_day Does what it says
  2533. --D if not a special day then the day of the week else the day name
  2534. end -- End Time Query.
  2535.  
  2536.  
  2537. function z( iIn ) --Add leading zeroes.
  2538. if iIn < 10 then return "0" .. tostring(iIn) else return tostring(iIn) end
  2539. end
  2540.  
  2541. function Ord( iIn ) --returns the Ordinal number of iIn.
  2542. tiIn = iIn
  2543. if tiIn > 14 then tiIn = math.fmod(tiIn, 10) end
  2544. if tiIn == 1 then return tostring(iIn).."st" end
  2545. if tiIn == 2 then return tostring(iIn).."nd" end
  2546. if tiIn == 3 then return tostring(iIn).."rd" end
  2547. return tostring(iIn).."th"
  2548. end
  2549.  
  2550. function DoPrompt(sName, sLine, wildcards)
  2551. width = WindowTextWidth (XPWin, "f", "Lazy dog yawns") -- width of text (270)
  2552. height = WindowFontInfo (XPWin, "f", 1) -- height of the font (46)
  2553. ascent = WindowFontInfo (XPWin, "f", 2) -- ascent (amount above the baseline) (36)
  2554. descent = WindowFontInfo (XPWin, "f", 3) -- descent (amount below the baseline) (10)
  2555. leading = WindowFontInfo (XPWin, "f", 4) -- leading (space above the highest letter) (9)
  2556.  
  2557. width2 = WindowTextWidth (XPWin, "f2", "Lazy dog yawns") -- width of text (270)
  2558. height2 = WindowFontInfo (XPWin, "f2", 1) -- height of the font (46)
  2559.  
  2560. if SETTINGS.DOUBLEWIN then
  2561. localheight = HEIGHT*2
  2562. else
  2563. localheight = HEIGHT
  2564. end
  2565. WindowCreate (XPWin, 0, 0, bar_width, localheight, mushvar.xppos, 0, ColourNameToRGB("black")) -- create window
  2566.  
  2567. -- Button frames
  2568. WindowCircleOp (XPWin, 3, 3, 5, INDENT, BUTTON_HEIGHT+5, -- round rectangle
  2569. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  2570. WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT+3+5, INDENT, BUTTON_HEIGHT*2+3+5, -- round rectangle
  2571. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  2572. WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT*2+3+3+5, INDENT, BUTTON_HEIGHT*3+3+3+5, -- round rectangle
  2573. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  2574. WindowCircleOp (XPWin, 3, 3, BUTTON_HEIGHT*3+3+3+3+5, INDENT, BUTTON_HEIGHT*4+3+3+3+5, -- round rectangle
  2575. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  2576.  
  2577. -- Graph frame
  2578. WindowCircleOp (XPWin, 3, INDENT-15, 0, bar_width, localheight, -- round rectangle
  2579. COLOURS.OUTLINE, 0, 2, COLOURS.BACKGROUND, 0, 15, 15)
  2580.  
  2581. if TAB_SHOW == 1 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 1 then
  2582.  
  2583. if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 1 then
  2584. offset = HEIGHT
  2585. else
  2586. offset = 0
  2587. end
  2588.  
  2589. WindowGradient (XPWin, 5, 6, INDENT-13, BUTTON_HEIGHT+3,
  2590. COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
  2591.  
  2592. -- how many worm points?
  2593. tick = tonumber(GRAPH_WIDTH/60)
  2594.  
  2595. -- Graph borders
  2596. WindowLine (XPWin, INDENT, HEIGHT-(FOOTER+100)+offset, INDENT, HEIGHT-FOOTER+offset, COLOURS.TEXT, 0, 2)
  2597. WindowLine (XPWin, INDENT, HEIGHT-FOOTER+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER+offset, COLOURS.TEXT, 0, 2)
  2598.  
  2599. -- Graph scale lines
  2600. WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-SPACE+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-SPACE+offset, COLOURS.TEXT, 2, 1)
  2601. WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*2)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*2)+offset, COLOURS.TEXT, 2, 1)
  2602. WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*3)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*3)+offset, COLOURS.TEXT, 2, 1)
  2603. WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*4)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*4)+offset, COLOURS.TEXT, 2, 1)
  2604. WindowLine (XPWin, INDENT+2, HEIGHT-FOOTER-(SPACE*5)+offset, INDENT+GRAPH_WIDTH, HEIGHT-FOOTER-(SPACE*5)+offset, COLOURS.TEXT, 2, 1)
  2605.  
  2606. -- Draw delta worm
  2607. if SETTINGS.XPDETAIL_SHOW then
  2608. count = 0
  2609. oldv = tonumber(HEIGHT-FOOTER-dpoints [1])
  2610.  
  2611. for k, v in ipairs (dpoints) do
  2612. count = count or 0
  2613. oldv = oldv or tonumber(HEIGHT-FOOTER-0)
  2614. newv = tonumber(HEIGHT-FOOTER-v)
  2615.  
  2616. WindowLine (XPWin, INDENT+tick*count, oldv+offset, INDENT+tick*(count+1), newv+offset, ColourNameToRGB ("green"), 0, 2)
  2617.  
  2618. count = count + 1
  2619. oldv = newv
  2620. end -- for
  2621. end -- if
  2622.  
  2623. count = 0
  2624. oldv = tonumber(HEIGHT-FOOTER-points [1])
  2625.  
  2626. -- Draw worm
  2627. for k, v in ipairs (points) do
  2628. count = count or 0
  2629. oldv = oldv or tonumber(HEIGHT-FOOTER-0)
  2630. newv = tonumber(HEIGHT-FOOTER-v)
  2631.  
  2632. WindowLine (XPWin, INDENT+tick*count, oldv+offset, INDENT+tick*(count+1), newv+offset, ColourNameToRGB ("blue"), 0, 2)
  2633.  
  2634. count = count + 1
  2635. oldv = newv
  2636. end -- for
  2637.  
  2638. --rate_text_width = (WindowTextWidth (XPWin, "f2", rate_text))
  2639. time_text_width = (WindowTextWidth (XPWin, "f2", time_text))
  2640.  
  2641. WindowText (XPWin, "f2", xp_text, INDENT-8, 1+offset, 0, 0, COLOURS.TEXT, false)
  2642. WindowText (XPWin, "f2", time_text, INDENT-8, height2+offset, 0, 0, COLOURS.TEXT, false)
  2643. WindowText (XPWin, "f2", av_text, INDENT-8, height2*2+offset, 0, 0, COLOURS.TEXT, false)
  2644.  
  2645. -- Graph key
  2646. WindowText (XPWin, "f2", "2", INDENT-9, HEIGHT-FOOTER-(SPACE*1)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
  2647. WindowText (XPWin, "f2", "4", INDENT-9, HEIGHT-FOOTER-(SPACE*2)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
  2648. WindowText (XPWin, "f2", "6", INDENT-9, HEIGHT-FOOTER-(SPACE*3)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
  2649. WindowText (XPWin, "f2", "8", INDENT-9, HEIGHT-FOOTER-(SPACE*4)-(height2/2)+offset, 0, 0, COLOURS.TEXT, false)
  2650.  
  2651. -- XP rate reset hotspot
  2652. WindowAddHotspot(XPWin, "XPRatehs", -- hotspot name
  2653. INDENT-13, 2+offset, bar_width-2, height2*3+offset, -- rectangle
  2654. "mouseover",
  2655. "cancelmouseover",
  2656. "mousedown",
  2657. "cancelmousedown",
  2658. "mouseup",
  2659. "Reset XP Rate", -- tooltip text
  2660. 1, 0) -- hand cursor
  2661.  
  2662. -- XP graph reset hotspot
  2663. WindowAddHotspot(XPWin, "XPGraphhs", -- hotspot name
  2664. INDENT-13, height2*3+5+offset, bar_width-2, HEIGHT-2+offset, -- rectangle
  2665. "mouseover",
  2666. "cancelmouseover",
  2667. "mousedown",
  2668. "cancelmousedown",
  2669. "mouseup",
  2670. "Reset Graph", -- tooltip text
  2671. 1, 0) -- hand cursor
  2672. end -- if tab 1
  2673.  
  2674. if TAB_SHOW == 2 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 2 then
  2675.  
  2676. if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 2 then
  2677. offset = HEIGHT
  2678. else
  2679. offset = 0
  2680. end
  2681.  
  2682. WindowGradient (XPWin, 5, BUTTON_HEIGHT+3+6, INDENT-13, BUTTON_HEIGHT*2+3+3,
  2683. COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
  2684.  
  2685. attack_text = string.format("Attacks per round: " .. mushvar.hitrate)
  2686.  
  2687. WindowText (XPWin, "f2", attack_text, INDENT-11, 2+offset, 0, 0, COLOURS.TEXT, false)
  2688.  
  2689. vertical = 2+height2+offset -- pixel to start at
  2690.  
  2691. DoGauge (XPWin, "Hits ", mushvar.percentlaunched / 100, COLOURS.OHITS, mushvar.successhits .. " (" .. mushvar.percentlaunched .. "%)", "OHitshs")
  2692. DoGauge (XPWin, "Special ", mushvar.percentspecialhit / 100, COLOURS.OSPECIALS, mushvar.successspecials .. " (" .. mushvar.percentspecialhit .. "%)", "OSpecialshs")
  2693. DoGauge (XPWin, "Parry ", mushvar.percentparried / 100, COLOURS.DPARRY, mushvar.parriedhits .. " (" .. mushvar.percentparried .. "%)", "DParryhs")
  2694. DoGauge (XPWin, "Dodge ", mushvar.percentdodged / 100, COLOURS.DDODGE, mushvar.dodgedhits .. " (" .. mushvar.percentdodged .. "%)", "DDodgehs")
  2695. DoGauge (XPWin, "Block ", mushvar.percentblocked / 100, COLOURS.DBLOCK, mushvar.blockedhits .. " (" .. mushvar.percentblocked .. "%)", "DBlockedhs")
  2696. DoGauge (XPWin, "Shield ", mushvar.percentshielded / 100, COLOURS.DSHIELD, mushvar.armourhits .. " (" .. mushvar.percentshielded .. "%)", "DShieldshs")
  2697. DoGauge (XPWin, "Hits ", mushvar.percenthit / 100, COLOURS.DHITS, mushvar.totalhit .. " (" .. mushvar.percenthit .. "%)", "DHitshs")
  2698.  
  2699. -- Combat stats reset hotspot
  2700. WindowAddHotspot(XPWin, "Combaths", -- hotspot name
  2701. INDENT-13, 2+offset, INDENT+20, HEIGHT-2+offset, -- rectangle
  2702. "mouseover",
  2703. "cancelmouseover",
  2704. "mousedown",
  2705. "cancelmousedown",
  2706. "mouseup",
  2707. "Reset Combat statistics", -- tooltip text
  2708. 1, 0) -- hand cursor
  2709. end -- if tab 2
  2710.  
  2711. if TAB_SHOW == 3 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 3 then
  2712.  
  2713. if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN==3 then
  2714. offset = HEIGHT
  2715. else
  2716. offset = 0
  2717. end
  2718.  
  2719. WindowGradient (XPWin, 5, BUTTON_HEIGHT*2+3+3+6, INDENT-13, BUTTON_HEIGHT*3+3+3+3,
  2720. COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
  2721.  
  2722. S, M, H, Z, I, j, w, Y, C, m, d, B, b, A, a, P, p, special_day, D = unix_to_disc_time()
  2723.  
  2724. time_text_1 = string.format (I..":"..z(M)..Z)
  2725. time_text_2 = string.format (D.." "..Ord(d).." "..B.." "..P..", UC "..Y..".")
  2726.  
  2727. -- map title set up
  2728. local id = "f2"
  2729. local left_margin = INDENT-5
  2730. local right_margin = 5
  2731. local width = bar_width
  2732.  
  2733. -- derive stuff from font
  2734. local space_width = WindowTextWidth (XPWin, id, " ")
  2735. local line_height = WindowFontInfo (XPWin, id, 1)
  2736.  
  2737. WindowText (XPWin, "f", time_text_1, INDENT-5, HEIGHT-(line_height*3)-5+offset, 0, 0, COLOURS.TEXT, false)
  2738.  
  2739. -- starting point
  2740. local x = left_margin
  2741. local y = HEIGHT-(line_height*2)-2+offset
  2742. local counter = 0
  2743.  
  2744. -- do each word
  2745. message = time_text_2
  2746.  
  2747. for word in string.gmatch (message, "%S+") do
  2748.  
  2749. local word_width = WindowTextWidth (XPWin, id, word)
  2750.  
  2751. -- time to start a new line?
  2752. if (word_width + x) > (width - right_margin) and (x > left_margin) then
  2753. y = y + line_height
  2754. x = left_margin
  2755. counter = counter + 1
  2756. end -- if
  2757.  
  2758. -- draw the text
  2759. WindowText (XPWin, id, word, x, y, 0, map_height-10+offset, COLOURS.TEXT)
  2760.  
  2761. -- advance past the word and a single space
  2762. x = x + word_width + space_width
  2763.  
  2764. end -- for loop
  2765. end -- if tab 3
  2766.  
  2767. if TAB_SHOW == 4 or SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 4 then
  2768. --Group status tab
  2769.  
  2770. if SETTINGS.DOUBLEWIN and SETTINGS.DWWIN == 4 then
  2771. offset = HEIGHT
  2772. else
  2773. offset = 0
  2774. end
  2775.  
  2776. WindowGradient (XPWin, 5, BUTTON_HEIGHT*3+3+3+3+6, INDENT-13, BUTTON_HEIGHT*4+3+3+3+3,
  2777. COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
  2778.  
  2779.  
  2780. grp_text = string.format("Group members: " .. groupnumber)
  2781.  
  2782. WindowText (XPWin, "f2", grp_text, INDENT-11, 2+offset, 0, 0, COLOURS.TEXT, false)
  2783.  
  2784. local buttonbg = CalculateHalfColour(COLOURS.OUTLINE);
  2785.  
  2786. WindowCircleOp (XPWin, 3, bar_width-40, 3+offset, bar_width-5, 16+offset, -- round rectangle
  2787. COLOURS.OUTLINE, 0, 1, buttonbg, 0, 4, 4)
  2788.  
  2789. --WindowRectOp (XPWin, 2, bar_width-15, 59, bar_width-2, 75, mapbg ) -- fill entire box
  2790. --WindowRectOp (XPWin, 1, bar_width-15, 59, bar_width-1, 75, COLOURS.OUTLINE ) -- border
  2791.  
  2792. WindowText (XPWin, "f2", "Reset", bar_width-35, 3+offset, bar_width-5, 16+offset, 0)
  2793. WindowText (XPWin, "f2", "Reset", bar_width-36, 2+offset, bar_width-5, 16+offset, ColourNameToRGB("gray"))
  2794.  
  2795. vertical = 4+height2+offset -- pixel to start at
  2796.  
  2797. -- loop over each group member
  2798.  
  2799. for k,v in pairs(ArrayList("group")) do
  2800. DoShields(XPWin, ArrayGet("numbers", k), ArrayGet(k, "player"), k, vertical)
  2801. end
  2802.  
  2803. -- Group stats update hotspot
  2804. WindowAddHotspot(XPWin, "Grouphs", -- hotspot name
  2805. INDENT-13, 17+offset, INDENT+bar_width-5, HEIGHT-2+offset, -- rectangle
  2806. "mouseover",
  2807. "cancelmouseover",
  2808. "mousedown",
  2809. "cancelmousedown",
  2810. "mouseup",
  2811. "Refresh Group statistics", -- tooltip text
  2812. 1, 0) -- hand cursor
  2813.  
  2814. -- Group reset hotspot
  2815. WindowAddHotspot(XPWin, "Groupreseths", -- hotspot name
  2816. bar_width-40, 3+offset, bar_width-6, 16+offset, -- rectangle
  2817. "mouseover",
  2818. "cancelmouseover",
  2819. "mousedown",
  2820. "cancelmousedown",
  2821. "mouseup",
  2822. "Reset Group details", -- tooltip text
  2823. 1, 0) -- hand cursor
  2824.  
  2825.  
  2826. end -- if tab 4
  2827.  
  2828. XPTAB_TEXT = string.format("XP")
  2829.  
  2830. -- xp tab text
  2831. WindowText (XPWin, "f", XPTAB_TEXT, 8, (BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
  2832.  
  2833. -- xp tab hotspot
  2834. WindowAddHotspot(XPWin, "XPTABhs", -- hotspot name
  2835. 3, 5, INDENT-15, BUTTON_HEIGHT+5, -- rectangle
  2836. "mouseover",
  2837. "cancelmouseover",
  2838. "mousedown",
  2839. "cancelmousedown",
  2840. "mouseup",
  2841. "Show XP tab", -- tooltip text
  2842. 1, 0) -- hand cursor
  2843.  
  2844. Off_TAB_TEXT = string.format("Co")
  2845.  
  2846. -- Combat stats Tab text
  2847. WindowText (XPWin, "f", Off_TAB_TEXT, 8, BUTTON_HEIGHT+3+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
  2848.  
  2849. -- Combat stats Tab hotspot
  2850. WindowAddHotspot(XPWin, "Off_TABhs", -- hotspot name
  2851. 3, BUTTON_HEIGHT+3+5, INDENT-15, BUTTON_HEIGHT*2+3+5, -- rectangle
  2852. "mouseover",
  2853. "cancelmouseover",
  2854. "mousedown",
  2855. "cancelmousedown",
  2856. "mouseup",
  2857. "Show Combat Statistics tab", -- tooltip text
  2858. 1, 0) -- hand cursor
  2859.  
  2860. Def_TAB_TEXT = string.format("Ti")
  2861.  
  2862. -- Def Tab text
  2863. WindowText (XPWin, "f", Def_TAB_TEXT, 7, BUTTON_HEIGHT*2+6+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
  2864.  
  2865. -- Def Tab hotspot
  2866. WindowAddHotspot(XPWin, "Def_TABhs", -- hotspot name
  2867. 3, BUTTON_HEIGHT*2+3+3+5, INDENT-15, BUTTON_HEIGHT*3+3+3+5, -- rectangle
  2868. "mouseover",
  2869. "cancelmouseover",
  2870. "mousedown",
  2871. "cancelmousedown",
  2872. "mouseup",
  2873. "Show Misc tab", -- tooltip text
  2874. 1, 0) -- hand cursor
  2875.  
  2876. Grp_TAB_TEXT = string.format("Gr")
  2877.  
  2878. -- Group stats Tab text
  2879. WindowText (XPWin, "f", Grp_TAB_TEXT, 8, BUTTON_HEIGHT*3+9+(BUTTON_HEIGHT/2)-(height2/2)+3, 0, 0, COLOURS.TEXT, false)
  2880.  
  2881. -- Group stats Tab hotspot
  2882. WindowAddHotspot(XPWin, "Grp_TABhs", -- hotspot name
  2883. 3, BUTTON_HEIGHT*3+3+3+3+5, INDENT-15, BUTTON_HEIGHT*4+3+3+3+5, -- rectangle
  2884. "mouseover",
  2885. "cancelmouseover",
  2886. "mousedown",
  2887. "cancelmousedown",
  2888. "mouseup",
  2889. "Show Group Status tab", -- tooltip text
  2890. 1, 0) -- hand cursor
  2891.  
  2892.  
  2893. WindowShow (XPWin, true) -- show it
  2894. end -- DoPrompt
  2895.  
  2896. function CalculateHalfColour(col)
  2897. local cr = math.floor(tonumber(string.sub(ColourString(col),5,6),16) / 2);
  2898. local cg = math.floor(tonumber(string.sub(ColourString(col),3,4),16) / 2);
  2899. local cb = math.floor(tonumber(string.sub(ColourString(col),1,2),16) / 2);
  2900. return cr + cg*256 + cb*65536;
  2901. end
  2902.  
  2903.  
  2904. function DoGauge (Window, sPrompt, Percent, Colour, BarText, HSname, Percentadd)
  2905. local Fraction = tonumber (Percent)
  2906.  
  2907. GAUGE_HEIGHT = 17
  2908.  
  2909. if Fraction > 1 then Fraction = 1 end
  2910. --if Fraction == 0 then return end
  2911.  
  2912. local width = WindowTextWidth (Window, "f2", sPrompt)
  2913.  
  2914. WindowText (Window, "f2", sPrompt, INDENT-11, vertical+1, 0, 0, COLOURS.TEXT)
  2915.  
  2916. WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
  2917.  
  2918. local gauge_width = (bar_width - INDENT - 25 - 5) * Fraction
  2919.  
  2920. -- box size must be > 0 or WindowGradient fills the whole thing
  2921. if math.floor (gauge_width) > 0 then
  2922. -- top half
  2923. WindowGradient (Window, INDENT+25, vertical, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2,
  2924. 0x000000, Colour, 2)
  2925.  
  2926. -- bottom half
  2927. WindowGradient (Window, INDENT+25, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT,
  2928. Colour, 0x000000, 2)
  2929.  
  2930. if Percentadd ~= nil and Percentadd > 0 then
  2931. --draw additional bar bit
  2932. local add_width = (bar_width - INDENT - 25 - 5) * (tonumber(Percentadd) - tonumber(Percent))
  2933. local halfcol = CalculateHalfColour(Colour)
  2934.  
  2935. -- top half
  2936. WindowGradient (Window, INDENT+25 + gauge_width, vertical, INDENT+25 + gauge_width + add_width, vertical + GAUGE_HEIGHT / 2,
  2937. 0x000000, halfcol, 2)
  2938.  
  2939. -- bottom half
  2940. WindowGradient (Window, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width+add_width,
  2941. vertical + GAUGE_HEIGHT, halfcol, 0x000000, 2)
  2942. end
  2943. end -- non-zero
  2944.  
  2945. WindowText (Window, "f2", BarText,
  2946. INDENT + 36, vertical+2, 0, 0, ColourNameToRGB "black")
  2947. WindowText (Window, "f2", BarText,
  2948. INDENT + 35, vertical+1, 0, 0, COLOURS.TEXT)
  2949.  
  2950. -- draw a box around it
  2951. check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT,
  2952. ColourNameToRGB ("dimgray"))) -- frame entire box
  2953.  
  2954. -- add hotspot
  2955. WindowAddHotspot(Window, HSname, -- hotspot name
  2956. INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
  2957. "mouseover",
  2958. "cancelmouseover",
  2959. "mousedown",
  2960. "cancelmousedown",
  2961. "mouseup",
  2962. "Change Bar Colour", -- tooltip text
  2963. 1, 0) -- hand cursor
  2964.  
  2965. vertical = vertical + GAUGE_HEIGHT + 2
  2966. end -- function
  2967.  
  2968. function DoGauge2 (Window, sPrompt, Percent, Colour, BarText, HSname,Percentadd)
  2969. local Fraction = tonumber (Percent)
  2970.  
  2971. GAUGE_HEIGHT = 17
  2972.  
  2973. if Fraction > 1 then Fraction = 1 end
  2974. --if Fraction == 0 then return end
  2975.  
  2976. local width = WindowTextWidth (Window, "f2", sPrompt)
  2977.  
  2978. WindowText (Window, "f2", sPrompt,
  2979. INDENT-11, vertical+1, 0, 0, COLOURS.TEXT)
  2980.  
  2981. WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
  2982.  
  2983. local gauge_width = (bar_width - INDENT - 25 - 5) * Fraction
  2984.  
  2985. -- box size must be > 0 or WindowGradient fills the whole thing
  2986. if math.floor (gauge_width) > 0 then
  2987. -- top half
  2988. WindowGradient (Window, INDENT+25, vertical, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2,
  2989. 0x000000, Colour, 2)
  2990.  
  2991. -- bottom half
  2992. WindowGradient (Window, INDENT+25, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT,
  2993. Colour, 0x000000, 2)
  2994.  
  2995. if Percentadd ~= nil then
  2996. --draw additional bar bit
  2997. local add_width = (bar_width - INDENT - 25 - 5) * (tonumber(Percentadd) - tonumber(Percent))
  2998. local halfcol = CalculateHalfColour(Colour)
  2999.  
  3000. -- top half
  3001. WindowGradient (Window, INDENT+25 + gauge_width, vertical, INDENT+25 + gauge_width + add_width, vertical + GAUGE_HEIGHT / 2,
  3002. 0x000000, halfcol, 2)
  3003.  
  3004. -- bottom half
  3005. WindowGradient (Window, INDENT+25 + gauge_width, vertical + GAUGE_HEIGHT / 2, INDENT+25 + gauge_width+add_width,
  3006. vertical + GAUGE_HEIGHT, halfcol, 0x000000, 2)
  3007. end
  3008.  
  3009. end -- non-zero
  3010.  
  3011. WindowText (Window, "f2", BarText,
  3012. INDENT + 36, vertical+2, 0, 0, ColourNameToRGB "black")
  3013. WindowText (Window, "f2", BarText,
  3014. INDENT + 35, vertical+1, 0, 0, COLOURS.TEXT)
  3015.  
  3016. -- draw a box around it
  3017. check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT,
  3018. ColourNameToRGB ("dimgray"))) -- frame entire box
  3019.  
  3020. -- add hotspot
  3021. WindowAddHotspot(Window, HSname .. "high", -- hotspot name
  3022. bar_width-40, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
  3023. "mouseover",
  3024. "cancelmouseover",
  3025. "mousedown",
  3026. "cancelmousedown",
  3027. "mouseup",
  3028. "Change High Bar Colour", -- tooltip text
  3029. 1, 0) -- hand cursor
  3030.  
  3031. WindowAddHotspot(Window, HSname .. "med", -- hotspot name
  3032. bar_width-80, vertical, bar_width - 40, vertical + GAUGE_HEIGHT, -- rectangle
  3033. "mouseover",
  3034. "cancelmouseover",
  3035. "mousedown",
  3036. "cancelmousedown",
  3037. "mouseup",
  3038. "Change Medium Bar Colour", -- tooltip text
  3039. 1, 0) -- hand cursor
  3040.  
  3041. WindowAddHotspot(Window, HSname .. "low", -- hotspot name
  3042. INDENT+25, vertical, bar_width - 80, vertical + GAUGE_HEIGHT, -- rectangle
  3043. "mouseover",
  3044. "cancelmouseover",
  3045. "mousedown",
  3046. "cancelmousedown",
  3047. "mouseup",
  3048. "Change Low Bar Colour", -- tooltip text
  3049. 1, 0) -- hand cursor
  3050.  
  3051.  
  3052. vertical = vertical + GAUGE_HEIGHT + 2
  3053. end -- function DoGauge2
  3054.  
  3055. function DrawGradBar(Window, xstart,ystart,xmax,ymax,fract, Colour, Cmed, Clow)
  3056. local xs = xmax * fract
  3057.  
  3058. if xs >= 0 then
  3059. if math.floor (xs) > 0 then
  3060. if Cmed ~= nil then
  3061. -- get colour from percentage if it's not specified
  3062. Colour = ColourFromPercentage(fract * 100, Colour,Cmed,Clow)
  3063. end
  3064.  
  3065. -- top half
  3066. WindowGradient (Window, xstart, ystart, xstart + xs, ystart + ymax/2,
  3067. 0x000000, Colour, 2)
  3068.  
  3069. -- bottom half
  3070. WindowGradient (Window, xstart, ystart + ymax / 2, xstart + xs, ystart + ymax,
  3071. Colour, 0x000000, 2)
  3072. end -- non-zero
  3073. else
  3074. xs = xmax;
  3075. -- draw gray bars
  3076. -- top half
  3077. WindowGradient (Window, xstart, ystart, xstart + xs, ystart + ymax/2,
  3078. 0x000000, 0x333333, 2)
  3079.  
  3080. -- bottom half
  3081. WindowGradient (Window, xstart, ystart + ymax / 2, xstart + xs, ystart + ymax,
  3082. 0x333333, 0x000000, 2)
  3083. end
  3084.  
  3085. end -- function DrawGradBar
  3086.  
  3087.  
  3088. function DoShields (Window, vidx, sPrompt, ptable, vstart)
  3089. -- local Fraction = tonumber (Percent)
  3090. local Fraction = 0.5
  3091. GAUGE_HEIGHT = 19
  3092.  
  3093. local vertical = vstart + (vidx - 1) * (GAUGE_HEIGHT + 2)
  3094.  
  3095. --if Fraction > 1 then Fraction = 1 end
  3096. --if Fraction == 0 then return end
  3097.  
  3098. local width = WindowTextWidth (Window, "f2", sPrompt)
  3099.  
  3100. WindowText (Window, "f2", sPrompt,
  3101. INDENT-11, vertical+2, 0, 0, COLOURS.TEXT)
  3102.  
  3103. WindowRectOp (Window, 2, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, WindowInfo (Window,9) ) -- fill entire box
  3104.  
  3105.  
  3106. local hpfract = 0.5
  3107. local gpfract = 0.5
  3108.  
  3109. -- box size must be > 0 or WindowGradient fills the whole thing
  3110.  
  3111. if SETTINGS.PERCENT_COLOURS then
  3112. DrawGradBar(Window, INDENT+25, vertical, bar_width-INDENT-25-5, GAUGE_HEIGHT/2+1, ArrayGet(ptable,"hpf"),COLOURS.HPHIGH,COLOURS.HPMED,COLOURS.HPLOW)
  3113. 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)
  3114. else
  3115. DrawGradBar(Window, INDENT+25, vertical, bar_width-INDENT-25-5, GAUGE_HEIGHT/2+1, ArrayGet(ptable,"hpf"), COLOURS.HP, nil, nil)
  3116. DrawGradBar(Window, INDENT+25, vertical+GAUGE_HEIGHT/2, bar_width-INDENT-25-5, GAUGE_HEIGHT/2, ArrayGet(ptable,"gpf"), COLOURS.GP,nil,nil)
  3117. end
  3118.  
  3119. -- draw a box around it
  3120. check (WindowRectOp (Window, 1, INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT/2 + 1,
  3121. ColourNameToRGB ("dimgray"))) -- frame entire box
  3122.  
  3123. check (WindowRectOp (Window, 1, INDENT+25, vertical + GAUGE_HEIGHT/2, bar_width - 5, vertical + GAUGE_HEIGHT,
  3124. ColourNameToRGB ("dimgray"))) -- frame entire box
  3125.  
  3126. -- add text for shields
  3127.  
  3128. local ccc = 29
  3129. local tpa = 53
  3130. local eff = 76
  3131. local kii = 98
  3132. local ms = 113
  3133.  
  3134. WindowText (Window, "f2", ArrayGet(ptable,"cccm"),
  3135. INDENT + ccc+1, vertical+3, 0, 0, ColourNameToRGB "black")
  3136. WindowText (Window, "f2", ArrayGet(ptable,"cccm"),
  3137. INDENT + ccc, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"ccc")))
  3138.  
  3139. WindowText (Window, "f2", ArrayGet(ptable,"tpam"),
  3140. INDENT + tpa+1, vertical+3, 0, 0, ColourNameToRGB "black")
  3141. WindowText (Window, "f2", ArrayGet(ptable,"tpam"),
  3142. INDENT + tpa, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"tpa")))
  3143.  
  3144. WindowText (Window, "f2", ArrayGet(ptable,"effm"),
  3145. INDENT + eff+1, vertical+3, 0, 0, ColourNameToRGB "black")
  3146. WindowText (Window, "f2", ArrayGet(ptable,"effm"),
  3147. INDENT + eff, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"eff")))
  3148.  
  3149. WindowText (Window, "f2", ArrayGet(ptable,"kiim"),
  3150. INDENT + kii+1, vertical+3, 0, 0, ColourNameToRGB "black")
  3151. WindowText (Window, "f2", ArrayGet(ptable,"kiim"),
  3152. INDENT + kii, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"kii")))
  3153.  
  3154. WindowText (Window, "f2", ArrayGet(ptable,"msm"),
  3155. INDENT + ms+1, vertical+3, 0, 0, ColourNameToRGB "black")
  3156. WindowText (Window, "f2", ArrayGet(ptable,"msm"),
  3157. INDENT + ms, vertical+2, 0, 0, ColourNameToRGB (ArrayGet(ptable,"ms")))
  3158.  
  3159. -- add hotspot
  3160. -- WindowAddHotspot(Window, HSname, -- hotspot name
  3161. -- INDENT+25, vertical, bar_width - 5, vertical + GAUGE_HEIGHT, -- rectangle
  3162. -- "mouseover",
  3163. -- "cancelmouseover",
  3164. -- "mousedown",
  3165. -- "cancelmousedown",
  3166. -- "mouseup",
  3167. -- "Change Bar Colour", -- tooltip text
  3168. -- 1, 0) -- hand cursor
  3169.  
  3170. end -- function DoShields
  3171.  
  3172.  
  3173. -------------------------------------------------------------------------------------------
  3174. -- Stats code
  3175. -------------------------------------------------------------------------------------------
  3176.  
  3177. function successfulhit (sName, sLine, wildcards)
  3178. mushvar.successhits = mushvar.successhits + 1
  3179. mushvar.attempted = mushvar.attempted + 1
  3180. UpdateStatusAttack ()
  3181. end -- successfulhit
  3182.  
  3183. function missedhit (sName, sLine, wildcards)
  3184. mushvar.attempted = mushvar.attempted + 1
  3185. UpdateStatusAttack ()
  3186. end -- missedhit
  3187.  
  3188. function successfulspecial (sName, sLine, wildcards)
  3189. mushvar.successspecials = mushvar.successspecials + 1
  3190. mushvar.attemptedspecials = mushvar.attemptedspecials + 1
  3191. UpdateStatusAttack ()
  3192. end -- successfulspecial
  3193.  
  3194. function missedspecial (sName, sLine, wildcards)
  3195. mushvar.failspecials = mushvar.failspecials + 1
  3196. mushvar.attemptedspecials = mushvar.attemptedspecials + 1
  3197. UpdateStatusAttack ()
  3198. end -- missedspecial
  3199.  
  3200. function dodgecount (sName, sLine, wildcards)
  3201. mushvar.dodgedhits = mushvar.dodgedhits + 1
  3202. mushvar.totalenemyhits = mushvar.totalenemyhits + 1
  3203. UpdateStatusDefend ()
  3204. end -- dodgecount
  3205.  
  3206. function parrycount (sName, sLine, wildcards)
  3207. mushvar.parriedhits = mushvar.parriedhits + 1
  3208. mushvar.totalenemyhits = mushvar.totalenemyhits + 1
  3209. UpdateStatusDefend ()
  3210. end -- parrycount
  3211.  
  3212. function blockcount (sName, sLine, wildcards)
  3213. mushvar.blockedhits = mushvar.blockedhits + 1
  3214. mushvar.totalenemyhits = mushvar.totalenemyhits + 1
  3215. UpdateStatusDefend ()
  3216. end -- blockcount
  3217.  
  3218. function armourcount (sName, sLine, wildcards)
  3219. mushvar.armourhits = mushvar.armourhits + 1
  3220. mushvar.totalenemyhits = mushvar.totalenemyhits + 1
  3221. UpdateStatusDefend ()
  3222. end -- armourcount
  3223.  
  3224. function hitcount (sName, sLine, wildcards)
  3225. mushvar.totalenemyhits = mushvar.totalenemyhits + 1
  3226. UpdateStatusDefend ()
  3227. end -- hitcount
  3228.  
  3229. function UpdateStatusDefend (sName, sLine, wildcards)
  3230. mushvar.totaldefend = mushvar.blockedhits + mushvar.dodgedhits + mushvar.parriedhits + mushvar.armourhits
  3231. mushvar.totalhit = mushvar.totalenemyhits - mushvar.totaldefend
  3232. mushvar.percentdefend = string.format ("%3.1f", (((mushvar.totaldefend * 100) / mushvar.totalenemyhits)))
  3233. mushvar.percentparried = string.format ("%3.1f", (((mushvar.parriedhits * 100) / mushvar.totalenemyhits)))
  3234. mushvar.percentdodged = string.format ("%3.1f", (((mushvar.dodgedhits * 100) / mushvar.totalenemyhits)))
  3235. mushvar.percentblocked = string.format ("%3.1f", (((mushvar.blockedhits * 100) / mushvar.totalenemyhits)))
  3236. --mushvar.percentparried = mushvar.percentparried + mushvar.percentblocked
  3237. mushvar.percentshielded = string.format ("%3.1f", (((mushvar.armourhits * 100) / mushvar.totalenemyhits)))
  3238. mushvar.percenthit = string.format ("%3.1f", (100 - mushvar.percentdefend))
  3239.  
  3240. DoPrompt ()
  3241. end -- updateStatusDefend
  3242.  
  3243. function UpdateStatusAttack (sName, sLine, wildcards)
  3244. if mushvar.attempted > 0 then
  3245. mushvar.percentlaunched = string.format ("%3.1f", ((mushvar.successhits*100) / mushvar.attempted))
  3246. else
  3247. mushvar.percentlaunched = 0
  3248. end --if
  3249.  
  3250. if mushvar.attemptedspecials > 0 then
  3251. mushvar.percentspecialhit = string.format ("%3.1f", ((mushvar.successspecials*100) / mushvar.attemptedspecials))
  3252. else
  3253. mushvar.percentspecialhit = 0
  3254. end -- if
  3255.  
  3256. mushvar.missedhits = mushvar.attempted - mushvar.successhits
  3257.  
  3258. if mushvar.combatrounds > 0 then
  3259. mushvar.hitrate = string.format ("%15.2f", (mushvar.attempted / mushvar.combatrounds))
  3260. else
  3261. mushvar.hitrate = mushvar.attempted
  3262. end --if
  3263.  
  3264. DoPrompt ()
  3265. end -- updateStatusAttack
  3266.  
  3267. --------------------------------------------------------------
  3268. -- Alias command scripts ------------------------------------
  3269.  
  3270. function GroupReportCombat (sName, sLine, wildcards)
  3271. CompleteSet ()
  3272. 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 .. "%%)")
  3273. Execute("group say " .. report_combat_text)
  3274. end -- GroupReportCombat
  3275.  
  3276. function StatsToZero (sName, sLine, wildcards)
  3277. mushvar.dodgedhits=0
  3278. mushvar.parriedhits=0
  3279. mushvar.blockedhits=0
  3280. mushvar.armourhits=0
  3281. mushvar.totalenemyhits=0
  3282. mushvar.totaldefend=0
  3283. mushvar.percentdefend=0
  3284. mushvar.percentparried=0
  3285. mushvar.percentdodged=0
  3286. mushvar.percentblocked=0
  3287. mushvar.percentshielded=0
  3288. mushvar.percenthit=0
  3289. mushvar.totalhit=0
  3290. mushvar.percentlaunched=0
  3291. mushvar.successhits=0
  3292. mushvar.missedhits=0
  3293. mushvar.attempted=0
  3294. mushvar.combatrounds=0
  3295. mushvar.hitrate=0
  3296. mushvar.successspecials=0
  3297. mushvar.failspecials=0
  3298. mushvar.percentspecialhit=0
  3299. mushvar.attemptedspecials=0
  3300. CompleteSet ()
  3301. end -- StatsToZero
  3302.  
  3303. function ResetGroup (sName, sLine, wildcards)
  3304. -- treat as though player's left the group, then re-get details
  3305. group_leave()
  3306. UpdateGroup(sName, sLine, wildcards)
  3307. end -- ResetGroup
  3308.  
  3309. function UpdateGroup (sName, sLine, wildcards)
  3310. omitshieldtriggers("1")
  3311. --SendNoEcho("group status brief\ngroup shields\nfrimble <end of shields list>")
  3312. Queue("group status brief\ngroup shields\nfrimble <end of shields list>", false)
  3313. end -- ResetGroup
  3314.  
  3315. function displaycolours()
  3316. Note("Current Trigger Colours:")
  3317. Note("UPME: " .. TRIGCOL.UPME .. ": " .. TRIGCOL.UPMETEXT .. " on " .. TRIGCOL.UPMEBACK)
  3318. Note("DNME: " .. TRIGCOL.DNME .. ": " .. TRIGCOL.DNMETEXT .. " on " .. TRIGCOL.DNMEBACK)
  3319. Note("WKME: " .. TRIGCOL.WKME .. ": " .. TRIGCOL.WKMETEXT .. " on " .. TRIGCOL.WKMEBACK)
  3320. Note("GOME: " .. TRIGCOL.GOME .. ": " .. TRIGCOL.GOMETEXT .. " on " .. TRIGCOL.GOMEBACK)
  3321. Note("HTME: " .. TRIGCOL.HTME .. ": " .. TRIGCOL.HTMETEXT .. " on " .. TRIGCOL.HTMEBACK)
  3322. Note(" ")
  3323. Note("UPOT: " .. TRIGCOL.UPOT .. ": " .. TRIGCOL.UPOTTEXT .. " on " .. TRIGCOL.UPOTBACK)
  3324. Note("DNOT: " .. TRIGCOL.DNOT .. ": " .. TRIGCOL.DNOTTEXT .. " on " .. TRIGCOL.DNOTBACK)
  3325. Note("GOOT: " .. TRIGCOL.GOOT .. ": " .. TRIGCOL.GOOTTEXT .. " on " .. TRIGCOL.GOOTBACK)
  3326.  
  3327. end -- displaycolours
  3328.  
  3329. function toggledoublewin(name, line, wildcards)
  3330. if wildcards.tab and wildcards.tab >= "1" and wildcards.tab <= "4" then
  3331. SETTINGS.DWWIN = tonumber(wildcards.tab)
  3332. SETTINGS.DOUBLEWIN = false --it will then get toggled by the remaining code
  3333. end
  3334.  
  3335. if not SETTINGS.DOUBLEWIN then
  3336. SETTINGS.DOUBLEWIN = true
  3337.  
  3338. Note("Now using double-length window (" .. SETTINGS.DWWIN ..").")
  3339.  
  3340. XPMath()
  3341. else
  3342. SETTINGS.DOUBLEWIN = false
  3343. Note("Now using single-length window.")
  3344.  
  3345. XPMath()
  3346. end
  3347. end
  3348. function toggleshowmxp(name, line, wildcards)
  3349. if not SETTINGS.SHOWMXP then
  3350. SETTINGS.SHOWMXP = true
  3351. Note("Now displaying MXP debug messages.")
  3352. else
  3353. SETTINGS.SHOWMXP = false
  3354. Note("Now hiding MXP debug messages.")
  3355. end
  3356. end
  3357. function togglegroupjoin(name, line, wildcards)
  3358. if not SETTINGS.GROUPJOIN then
  3359. SETTINGS.GROUPJOIN = true
  3360. Note("Automatic groupupdate on group join enabled.")
  3361. else
  3362. SETTINGS.GROUPJOIN = false
  3363. Note("Automatic groupupdate on group join disabled.")
  3364. end
  3365. end
  3366.  
  3367.  
  3368. function setgpding(name, line, wildcards)
  3369. if wildcards.file ~= nil and wildcards.file and string.len(wildcards.file) > 0 then
  3370. -- check file is valid by trying to play it..
  3371.  
  3372. if wildcards.vol ~= nil and wildcards.vol and string.len(wildcards.vol) > 0 then
  3373. SETTINGS.GPVOL = tonumber(wildcards.vol)
  3374. if SETTINGS.GPVOL > 0 then
  3375. SETTINGS.GPVOL = 0
  3376. elseif SETTINGS.GPVOL < -100 then
  3377. SETTINGS.GPVOL = -100
  3378. end
  3379. end
  3380.  
  3381. if PlaySound(0,wildcards.file,false,SETTINGS.GPVOL) ~= 0 then
  3382. Note("Cannot play " .. wildcards.file .. ". Disabling GP ding.")
  3383. SETTINGS.GPDING = false
  3384. else
  3385. SETTINGS.GPFILE = wildcards.file
  3386. SETTINGS.GPDING = true
  3387. Note("Activating GP ding to play: " .. SETTINGS.GPFILE)
  3388. end
  3389. else
  3390. -- just toggle state
  3391. if not SETTINGS.GPDING then
  3392. Note("Activating GP ding to play: " .. SETTINGS.GPFILE)
  3393. SETTINGS.GPDING = true
  3394. else
  3395. Note("Deactiving GP ding.")
  3396. SETTINGS.GPDING = false
  3397. end
  3398. end
  3399. end
  3400.  
  3401. function togglehitcolour(name, line, wildcards)
  3402. if SETTINGS.HITCOLOUR == 1 then
  3403. SETTINGS.HITCOLOUR = 0
  3404. SetTriggerOption("hitcolourme1","enabled","0")
  3405. SetTriggerOption("hitcolourme2","enabled","0")
  3406. SetTriggerOption("hitcolourme3","enabled","0")
  3407. SetTriggerOption("hitcolourme4","enabled","0")
  3408. SetTriggerOption("hitcolourme5","enabled","0")
  3409. SetTriggerOption("hitcolourme6","enabled","0")
  3410. SetTriggerOption("hitcolourme7","enabled","0")
  3411.  
  3412. SetTriggerOption("hitcolourmebad0","enabled","0")
  3413. SetTriggerOption("hitcolourmebad1","enabled","0")
  3414. SetTriggerOption("hitcolourmebad2","enabled","0")
  3415. SetTriggerOption("hitcolourmebad3","enabled","0")
  3416. SetTriggerOption("hitcolourmebad4","enabled","0")
  3417. SetTriggerOption("hitcolourmebad5","enabled","0")
  3418. SetTriggerOption("hitcolourmebad6","enabled","0")
  3419. SetTriggerOption("hitcolourmebad7","enabled","0")
  3420.  
  3421. SetTriggerOption("hitcolourother1","enabled","0")
  3422. SetTriggerOption("hitcolourother2","enabled","0")
  3423. SetTriggerOption("hitcolourother3","enabled","0")
  3424. SetTriggerOption("hitcolourother4","enabled","0")
  3425. SetTriggerOption("hitcolourother5","enabled","0")
  3426. SetTriggerOption("hitcolourother6","enabled","0")
  3427. SetTriggerOption("hitcolourother7","enabled","0")
  3428.  
  3429. SetTriggerOption("hitcolourbad1","enabled","0")
  3430. SetTriggerOption("hitcolourbad2","enabled","0")
  3431. SetTriggerOption("hitcolourbad3","enabled","0")
  3432. SetTriggerOption("hitcolourbad4","enabled","0")
  3433. SetTriggerOption("hitcolourbad5","enabled","0")
  3434. SetTriggerOption("hitcolourbad6","enabled","0")
  3435. SetTriggerOption("hitcolourbad7","enabled","0")
  3436. Note("Hit colours now disabled.")
  3437. else
  3438. SETTINGS.HITCOLOUR = 1
  3439. SetTriggerOption("hitcolourme1","enabled","1")
  3440. SetTriggerOption("hitcolourme2","enabled","1")
  3441. SetTriggerOption("hitcolourme3","enabled","1")
  3442. SetTriggerOption("hitcolourme4","enabled","1")
  3443. SetTriggerOption("hitcolourme5","enabled","1")
  3444. SetTriggerOption("hitcolourme6","enabled","1")
  3445. SetTriggerOption("hitcolourme7","enabled","1")
  3446.  
  3447. SetTriggerOption("hitcolourmebad0","enabled","1")
  3448. SetTriggerOption("hitcolourmebad1","enabled","1")
  3449. SetTriggerOption("hitcolourmebad2","enabled","1")
  3450. SetTriggerOption("hitcolourmebad3","enabled","1")
  3451. SetTriggerOption("hitcolourmebad4","enabled","1")
  3452. SetTriggerOption("hitcolourmebad5","enabled","1")
  3453. SetTriggerOption("hitcolourmebad6","enabled","1")
  3454. SetTriggerOption("hitcolourmebad7","enabled","1")
  3455.  
  3456. SetTriggerOption("hitcolourother1","enabled","1")
  3457. SetTriggerOption("hitcolourother2","enabled","1")
  3458. SetTriggerOption("hitcolourother3","enabled","1")
  3459. SetTriggerOption("hitcolourother4","enabled","1")
  3460. SetTriggerOption("hitcolourother5","enabled","1")
  3461. SetTriggerOption("hitcolourother6","enabled","1")
  3462. SetTriggerOption("hitcolourother7","enabled","1")
  3463.  
  3464. SetTriggerOption("hitcolourbad1","enabled","1")
  3465. SetTriggerOption("hitcolourbad2","enabled","1")
  3466. SetTriggerOption("hitcolourbad3","enabled","1")
  3467. SetTriggerOption("hitcolourbad4","enabled","1")
  3468. SetTriggerOption("hitcolourbad5","enabled","1")
  3469. SetTriggerOption("hitcolourbad6","enabled","1")
  3470. SetTriggerOption("hitcolourbad7","enabled","1")
  3471. Note("Hit colours now enabled.")
  3472. end
  3473. end
  3474.  
  3475. function togglecombatspam(name, line, wildcards)
  3476. if SETTINGS.COMBAT == 0 then
  3477. SETTINGS.COMBAT = 1
  3478. SetTriggerOption("combatspam","custom_colour","17")
  3479. SetTriggerOption("combatspam","omit_from_output","0")
  3480. Note("Now greying out combat spam.")
  3481. elseif SETTINGS.COMBAT == 1 then
  3482. SETTINGS.COMBAT = 2
  3483. SetTriggerOption("combatspam","custom_colour","0")
  3484. SetTriggerOption("combatspam","omit_from_output","1")
  3485. Note("Now hiding combat spam.")
  3486. else
  3487. SETTINGS.COMBAT = 0
  3488. SetTriggerOption("combatspam","custom_colour","0")
  3489. SetTriggerOption("combatspam","omit_from_output","0")
  3490. Note("Now applying no effects to combat spam.")
  3491. end
  3492. end
  3493.  
  3494. function toggleidlespam(name, line, wildcards)
  3495. if SETTINGS.IDLE == 0 then
  3496. SETTINGS.IDLE = 1
  3497. SetTriggerOption("idlespam","custom_colour","17")
  3498. SetTriggerOption("idlespam","omit_from_output","0")
  3499. SetTriggerOption("idlespam","enabled","1")
  3500.  
  3501. SetTriggerOption("idlespam2","custom_colour","17")
  3502. SetTriggerOption("idlespam2","omit_from_output","0")
  3503. SetTriggerOption("idlespam2","enabled","1")
  3504.  
  3505. SetTriggerOption("idlespam3","custom_colour","17")
  3506. SetTriggerOption("idlespam3","omit_from_output","0")
  3507. SetTriggerOption("idlespam3","enabled","1")
  3508.  
  3509. SetTriggerOption("idlespam4","custom_colour","17")
  3510. SetTriggerOption("idlespam4","omit_from_output","0")
  3511. SetTriggerOption("idlespam4","enabled","1")
  3512.  
  3513. SetTriggerOption("idlespam5","custom_colour","17")
  3514. SetTriggerOption("idlespam5","omit_from_output","0")
  3515. SetTriggerOption("idlespam5","enabled","1")
  3516.  
  3517. Note("Now greying out idle spam.")
  3518. elseif SETTINGS.IDLE == 1 then
  3519. SETTINGS.IDLE = 2
  3520. SetTriggerOption("idlespam","custom_colour","0")
  3521. SetTriggerOption("idlespam","omit_from_output","1")
  3522. SetTriggerOption("idlespam","enabled","1")
  3523.  
  3524. SetTriggerOption("idlespam2","custom_colour","0")
  3525. SetTriggerOption("idlespam2","omit_from_output","1")
  3526. SetTriggerOption("idlespam2","enabled","1")
  3527.  
  3528. SetTriggerOption("idlespam3","custom_colour","0")
  3529. SetTriggerOption("idlespam3","omit_from_output","1")
  3530. SetTriggerOption("idlespam3","enabled","1")
  3531.  
  3532. SetTriggerOption("idlespam4","custom_colour","0")
  3533. SetTriggerOption("idlespam4","omit_from_output","1")
  3534. SetTriggerOption("idlespam4","enabled","1")
  3535.  
  3536. SetTriggerOption("idlespam5","custom_colour","0")
  3537. SetTriggerOption("idlespam5","omit_from_output","1")
  3538. SetTriggerOption("idlespam5","enabled","1")
  3539.  
  3540. Note("Now hiding idle spam.")
  3541. else
  3542. SETTINGS.IDLE = 0
  3543. SetTriggerOption("idlespam","custom_colour","0")
  3544. SetTriggerOption("idlespam","omit_from_output","0")
  3545. SetTriggerOption("idlespam","enabled","0")
  3546.  
  3547. SetTriggerOption("idlespam2","custom_colour","0")
  3548. SetTriggerOption("idlespam2","omit_from_output","0")
  3549. SetTriggerOption("idlespam2","enabled","0")
  3550.  
  3551. SetTriggerOption("idlespam3","custom_colour","0")
  3552. SetTriggerOption("idlespam3","omit_from_output","0")
  3553. SetTriggerOption("idlespam3","enabled","0")
  3554.  
  3555. SetTriggerOption("idlespam4","custom_colour","0")
  3556. SetTriggerOption("idlespam4","omit_from_output","0")
  3557. SetTriggerOption("idlespam4","enabled","0")
  3558.  
  3559. SetTriggerOption("idlespam5","custom_colour","0")
  3560. SetTriggerOption("idlespam5","omit_from_output","0")
  3561. SetTriggerOption("idlespam5","enabled","0")
  3562.  
  3563. Note("Now applying no effects to idle spam.")
  3564. end
  3565. end
  3566.  
  3567.  
  3568. function setgpregen(name, line, wildcards)
  3569.  
  3570. if wildcards.rate ~= nil and string.len(wildcards.rate) > 0 then
  3571. Note("Setting gp regeneration rate to: " .. wildcards.rate)
  3572. mushvar.gptick = tonumber(wildcards.rate)
  3573. end
  3574. end
  3575.  
  3576. function settriggercolours(name, line, wildcards)
  3577.  
  3578. if name == "settriggercolouralias" then
  3579. -- enact change
  3580. local type = string.upper(wildcards.what) .. string.upper(wildcards.who)
  3581.  
  3582. if TRIGCOL [type] == nil or TRIGCOL[type] == "" then
  3583. Note("Unrecognised trigger type string (" .. type ..")!")
  3584. return
  3585. end
  3586.  
  3587. if (wildcards.fore == "" or wildcards.fore == false) and (wildcards.code == "" or wildcards.code == false) then
  3588. Note("Setting " .. type .. " to defaults.")
  3589. TRIGCOL [type] = DEFTRIGCOL [type]
  3590. TRIGCOL [type.."TEXT"] = DEFTRIGCOL [type.."TEXT"]
  3591. TRIGCOL [type.."BACK"] = DEFTRIGCOL [type.."BACK"]
  3592. else
  3593. if wildcards.code ~= "" then
  3594. if tonumber(wildcards.code) < 0 or tonumber(wildcards.code) > 17 then
  3595. Note("Unrecognised colour code (" .. wildcards.code .. ")!")
  3596. return
  3597. end
  3598. TRIGCOL[type] = tostring(wildcards.code)
  3599. Note("Setting " .. type .. " to be custom colour " .. TRIGCOL[type] .. ".")
  3600. else
  3601. TRIGCOL[type] = "17" -- force custom colour to enact change
  3602. TRIGCOL[type.."TEXT"] = tostring(wildcards.fore)
  3603. if wildcards.back then
  3604. TRIGCOL[type.."BACK"] = tostring(wildcards.back)
  3605. Note("Setting " .. type .. " colours to be " .. TRIGCOL[type.."TEXT"] .. " on " .. TRIGCOL[type.."BACK"] .. ".")
  3606. else
  3607. Note("Setting " .. type .. " colours to be " .. TRIGCOL[type.."TEXT"] .. " on black.")
  3608. TRIGCOL[type.."BACK"] = "black"
  3609. end
  3610. end
  3611. end
  3612.  
  3613. end
  3614.  
  3615. --displaycolours()
  3616. if SETTINGS.TRIGGER_COLOURS then
  3617. SetTriggerOption("up_me__kii","custom_colour",TRIGCOL.UPME)
  3618. SetTriggerOption("up_me__eff","custom_colour",TRIGCOL.UPME)
  3619. SetTriggerOption("up_me__tpa","custom_colour",TRIGCOL.UPME)
  3620. SetTriggerOption("up_me2_tpa","custom_colour",TRIGCOL.UPME)
  3621. SetTriggerOption("up_me__ccc","custom_colour",TRIGCOL.UPME)
  3622. SetTriggerOption("up_me__major","custom_colour",TRIGCOL.UPME)
  3623. SetTriggerOption("up_me2_major","custom_colour",TRIGCOL.UPME)
  3624.  
  3625. SetTriggerOption("dn_me__kii","custom_colour",TRIGCOL.DNME)
  3626. SetTriggerOption("dn_me2_kii","custom_colour",TRIGCOL.DNME)
  3627. SetTriggerOption("dn_me__eff","custom_colour",TRIGCOL.DNME)
  3628. SetTriggerOption("dn_me__tpa","custom_colour",TRIGCOL.DNME)
  3629. SetTriggerOption("dn_me__ccc","custom_colour",TRIGCOL.DNME)
  3630. SetTriggerOption("dn_me__major","custom_colour",TRIGCOL.DNME)
  3631.  
  3632. SetTriggerOption("up_ot__kii","custom_colour",TRIGCOL.UPOT)
  3633. SetTriggerOption("up_ot__eff","custom_colour",TRIGCOL.UPOT)
  3634. SetTriggerOption("up_ot__tpa","custom_colour",TRIGCOL.UPOT)
  3635. SetTriggerOption("up_ot2_tpa","custom_colour",TRIGCOL.UPOT)
  3636. SetTriggerOption("up_ot__ccc","custom_colour",TRIGCOL.UPOT)
  3637. SetTriggerOption("up_ot__major","custom_colour",TRIGCOL.UPOT)
  3638.  
  3639. SetTriggerOption("dn_ot__kii","custom_colour",TRIGCOL.DNOT)
  3640. SetTriggerOption("dn_ot2_kii","custom_colour",TRIGCOL.DNOT)
  3641. SetTriggerOption("dn_ot__eff","custom_colour",TRIGCOL.DNOT)
  3642. SetTriggerOption("dn_ot2_eff","custom_colour",TRIGCOL.DNOT)
  3643. SetTriggerOption("dn_ot__tpa","custom_colour",TRIGCOL.DNOT)
  3644. SetTriggerOption("dn_ot__ccc","custom_colour",TRIGCOL.DNOT)
  3645. SetTriggerOption("dn_ot__major","custom_colour",TRIGCOL.DNOT)
  3646.  
  3647. SetTriggerOption("up_ot3_tpa","custom_colour",TRIGCOL.GOOT)
  3648. SetTriggerOption("up_ot4_tpa","custom_colour",TRIGCOL.GOOT)
  3649. SetTriggerOption("up_ot5_tpa","custom_colour",TRIGCOL.GOOT)
  3650. SetTriggerOption("up_ot6_tpa","custom_colour",TRIGCOL.GOOT)
  3651.  
  3652. SetTriggerOption("up_me3_tpa","custom_colour",TRIGCOL.GOME)
  3653. SetTriggerOption("up_me4_tpa","custom_colour",TRIGCOL.GOME)
  3654. SetTriggerOption("up_me5_tpa","custom_colour",TRIGCOL.GOME)
  3655. SetTriggerOption("up_me6_tpa","custom_colour",TRIGCOL.GOME)
  3656.  
  3657. SetTriggerOption("up_me2_kii","custom_colour",TRIGCOL.WKME)
  3658. SetTriggerOption("wk_me__major","custom_colour",TRIGCOL.WKME)
  3659. SetTriggerOption("wk_me__kii","custom_colour",TRIGCOL.GOME)
  3660. SetTriggerOption("wk_me__tpa","custom_colour",TRIGCOL.GOME)
  3661.  
  3662. SetTriggerOption("wk_ot__major","custom_colour",TRIGCOL.GOOT)
  3663. SetTriggerOption("wk_ot__kii","custom_colour",TRIGCOL.GOOT)
  3664. SetTriggerOption("wk_ot__tpa","custom_colour",TRIGCOL.GOOT)
  3665.  
  3666. SetTriggerOption("combathit","custom_colour",TRIGCOL.HTME)
  3667.  
  3668. -- set actual colours
  3669. SetTriggerOption("up_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3670. SetTriggerOption("up_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3671. SetTriggerOption("up_me__eff","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3672. SetTriggerOption("up_me__eff","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3673. SetTriggerOption("up_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3674. SetTriggerOption("up_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3675. SetTriggerOption("up_me2_tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3676. SetTriggerOption("up_me2_tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3677. SetTriggerOption("up_me__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3678. SetTriggerOption("up_me__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3679. SetTriggerOption("up_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3680. SetTriggerOption("up_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3681. SetTriggerOption("up_me2_major","other_text_colour",ColourNameToRGB(TRIGCOL.UPMETEXT))
  3682. SetTriggerOption("up_me2_major","other_back_colour",ColourNameToRGB(TRIGCOL.UPMEBACK))
  3683.  
  3684. SetTriggerOption("dn_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3685. SetTriggerOption("dn_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3686. SetTriggerOption("dn_me2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3687. SetTriggerOption("dn_me2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3688. SetTriggerOption("dn_me__eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3689. SetTriggerOption("dn_me__eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3690. SetTriggerOption("dn_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3691. SetTriggerOption("dn_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3692. SetTriggerOption("dn_me__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3693. SetTriggerOption("dn_me__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3694. SetTriggerOption("dn_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.DNMETEXT))
  3695. SetTriggerOption("dn_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.DNMEBACK))
  3696.  
  3697. SetTriggerOption("up_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3698. SetTriggerOption("up_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3699. SetTriggerOption("up_ot__eff","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3700. SetTriggerOption("up_ot__eff","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3701. SetTriggerOption("up_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3702. SetTriggerOption("up_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3703. SetTriggerOption("up_ot2_tpa","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3704. SetTriggerOption("up_ot2_tpa","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3705. SetTriggerOption("up_ot__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3706. SetTriggerOption("up_ot__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3707. SetTriggerOption("up_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.UPOTTEXT))
  3708. SetTriggerOption("up_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.UPOTBACK))
  3709.  
  3710. SetTriggerOption("dn_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3711. SetTriggerOption("dn_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3712. SetTriggerOption("dn_ot2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3713. SetTriggerOption("dn_ot2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3714. SetTriggerOption("dn_ot__eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3715. SetTriggerOption("dn_ot__eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3716. SetTriggerOption("dn_ot2_eff","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3717. SetTriggerOption("dn_ot2_eff","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3718. SetTriggerOption("dn_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3719. SetTriggerOption("dn_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3720. SetTriggerOption("dn_ot__ccc","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3721. SetTriggerOption("dn_ot__ccc","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3722. SetTriggerOption("dn_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.DNOTTEXT))
  3723. SetTriggerOption("dn_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.DNOTBACK))
  3724.  
  3725. SetTriggerOption("up_ot3_tpa","other_text_colour",ColourNameToRGB("crimson"))
  3726. SetTriggerOption("up_ot4_tpa","other_text_colour",ColourNameToRGB("red"))
  3727. SetTriggerOption("up_ot5_tpa","other_text_colour",ColourNameToRGB("orange"))
  3728. SetTriggerOption("up_ot6_tpa","other_text_colour",ColourNameToRGB("yellow"))
  3729.  
  3730. SetTriggerOption("up_me3_tpa","other_text_colour",ColourNameToRGB("crimson"))
  3731. SetTriggerOption("up_me4_tpa","other_text_colour",ColourNameToRGB("red"))
  3732. SetTriggerOption("up_me5_tpa","other_text_colour",ColourNameToRGB("orange"))
  3733. SetTriggerOption("up_me6_tpa","other_text_colour",ColourNameToRGB("yellow"))
  3734.  
  3735. SetTriggerOption("up_me2_kii","other_text_colour",ColourNameToRGB(TRIGCOL.WKMETEXT))
  3736. SetTriggerOption("up_me2_kii","other_back_colour",ColourNameToRGB(TRIGCOL.WKMEBACK))
  3737. SetTriggerOption("wk_me__major","other_text_colour",ColourNameToRGB(TRIGCOL.WKMETEXT))
  3738. SetTriggerOption("wk_me__major","other_back_colour",ColourNameToRGB(TRIGCOL.WKMEBACK))
  3739. SetTriggerOption("wk_me__kii","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
  3740. SetTriggerOption("wk_me__kii","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
  3741. SetTriggerOption("wk_me__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
  3742. SetTriggerOption("wk_me__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
  3743.  
  3744. SetTriggerOption("wk_ot__major","other_text_colour",ColourNameToRGB(TRIGCOL.GOOTTEXT))
  3745. SetTriggerOption("wk_ot__major","other_back_colour",ColourNameToRGB(TRIGCOL.GOOTBACK))
  3746. SetTriggerOption("wk_ot__kii","other_text_colour",ColourNameToRGB(TRIGCOL.GOOTTEXT))
  3747. SetTriggerOption("wk_ot__kii","other_back_colour",ColourNameToRGB(TRIGCOL.GOOTBACK))
  3748. SetTriggerOption("wk_ot__tpa","other_text_colour",ColourNameToRGB(TRIGCOL.GOMETEXT))
  3749. SetTriggerOption("wk_ot__tpa","other_back_colour",ColourNameToRGB(TRIGCOL.GOMEBACK))
  3750.  
  3751. SetTriggerOption("combathit","other_text_colour",ColourNameToRGB(TRIGCOL.HTMETEXT))
  3752. SetTriggerOption("combathit","other_back_colour",ColourNameToRGB(TRIGCOL.HTMEBACK))
  3753. else
  3754. SetTriggerOption("up_me__kii","custom_colour","0")
  3755. SetTriggerOption("up_me__eff","custom_colour","0")
  3756. SetTriggerOption("up_me__tpa","custom_colour","0")
  3757. SetTriggerOption("up_me2_tpa","custom_colour","0")
  3758. SetTriggerOption("up_me__ccc","custom_colour","0")
  3759. SetTriggerOption("up_me__major","custom_colour","0")
  3760. SetTriggerOption("up_me2_major","custom_colour","0")
  3761.  
  3762. SetTriggerOption("dn_me__kii","custom_colour","0")
  3763. SetTriggerOption("dn_me2_kii","custom_colour","0")
  3764. SetTriggerOption("dn_me__eff","custom_colour","0")
  3765. SetTriggerOption("dn_me__tpa","custom_colour","0")
  3766. SetTriggerOption("dn_me__ccc","custom_colour","0")
  3767. SetTriggerOption("dn_me__major","custom_colour","0")
  3768.  
  3769. SetTriggerOption("up_ot__kii","custom_colour","0")
  3770. SetTriggerOption("up_ot__eff","custom_colour","0")
  3771. SetTriggerOption("up_ot__tpa","custom_colour","0")
  3772. SetTriggerOption("up_ot2_tpa","custom_colour","0")
  3773. SetTriggerOption("up_ot__ccc","custom_colour","0")
  3774. SetTriggerOption("up_ot__major","custom_colour","0")
  3775.  
  3776. SetTriggerOption("dn_ot__kii","custom_colour","0")
  3777. SetTriggerOption("dn_ot2_kii","custom_colour","0")
  3778. SetTriggerOption("dn_ot__eff","custom_colour","0")
  3779. SetTriggerOption("dn_ot2_eff","custom_colour","0")
  3780. SetTriggerOption("dn_ot__tpa","custom_colour","0")
  3781. SetTriggerOption("dn_ot__ccc","custom_colour","0")
  3782. SetTriggerOption("dn_ot__major","custom_colour","0")
  3783.  
  3784. SetTriggerOption("up_ot3_tpa","custom_colour","0")
  3785. SetTriggerOption("up_ot4_tpa","custom_colour","0")
  3786. SetTriggerOption("up_ot5_tpa","custom_colour","0")
  3787. SetTriggerOption("up_ot6_tpa","custom_colour","0")
  3788.  
  3789. SetTriggerOption("up_me3_tpa","custom_colour","0")
  3790. SetTriggerOption("up_me4_tpa","custom_colour","0")
  3791. SetTriggerOption("up_me5_tpa","custom_colour","0")
  3792. SetTriggerOption("up_me6_tpa","custom_colour","0")
  3793.  
  3794. SetTriggerOption("up_me2_kii","custom_colour","0")
  3795. SetTriggerOption("wk_me__major","custom_colour","0")
  3796. SetTriggerOption("wk_me__kii","custom_colour","0")
  3797. SetTriggerOption("wk_me__tpa","custom_colour","0")
  3798.  
  3799. SetTriggerOption("wk_ot__major","custom_colour","0")
  3800. SetTriggerOption("wk_ot__kii","custom_colour","0")
  3801. SetTriggerOption("wk_ot__tpa","custom_colour","0")
  3802.  
  3803. SetTriggerOption("combathit","custom_colour","0")
  3804. end
  3805.  
  3806. if SETTINGS.TRIGGER_SHOW then
  3807. SetTriggerOption("map_start","omit_from_output","0")
  3808. SetTriggerOption("multi_line_map","omit_from_output","0")
  3809. else
  3810. SetTriggerOption("map_start","omit_from_output","1")
  3811. SetTriggerOption("multi_line_map","omit_from_output","1")
  3812. end
  3813.  
  3814. if SETTINGS.COMBAT == 1 then
  3815. SetTriggerOption("combatspam","custom_colour","17")
  3816. SetTriggerOption("combatspam","omit_from_output","0")
  3817. elseif SETTINGS.COMBAT == 2 then
  3818. SetTriggerOption("combatspam","custom_colour","0")
  3819. SetTriggerOption("combatspam","omit_from_output","1")
  3820. else
  3821. SetTriggerOption("combatspam","custom_colour","0")
  3822. SetTriggerOption("combatspam","omit_from_output","0")
  3823. end
  3824.  
  3825. if SETTINGS.IDLE == 1 then
  3826. SETTINGS.IDLE = 1
  3827. SetTriggerOption("idlespam","custom_colour","17")
  3828. SetTriggerOption("idlespam","omit_from_output","0")
  3829. SetTriggerOption("idlespam","enabled","1")
  3830. SetTriggerOption("idlespam2","custom_colour","17")
  3831. SetTriggerOption("idlespam2","omit_from_output","0")
  3832. SetTriggerOption("idlespam2","enabled","1")
  3833. SetTriggerOption("idlespam3","custom_colour","17")
  3834. SetTriggerOption("idlespam3","omit_from_output","0")
  3835. SetTriggerOption("idlespam3","enabled","1")
  3836. SetTriggerOption("idlespam4","custom_colour","17")
  3837. SetTriggerOption("idlespam4","omit_from_output","0")
  3838. SetTriggerOption("idlespam4","enabled","1")
  3839. SetTriggerOption("idlespam5","custom_colour","17")
  3840. SetTriggerOption("idlespam5","omit_from_output","0")
  3841. SetTriggerOption("idlespam5","enabled","1")
  3842. elseif SETTINGS.IDLE == 2 then
  3843. SetTriggerOption("idlespam","custom_colour","0")
  3844. SetTriggerOption("idlespam","omit_from_output","1")
  3845. SetTriggerOption("idlespam","enabled","1")
  3846. SetTriggerOption("idlespam2","custom_colour","0")
  3847. SetTriggerOption("idlespam2","omit_from_output","1")
  3848. SetTriggerOption("idlespam2","enabled","1")
  3849. SetTriggerOption("idlespam3","custom_colour","0")
  3850. SetTriggerOption("idlespam3","omit_from_output","1")
  3851. SetTriggerOption("idlespam3","enabled","1")
  3852. SetTriggerOption("idlespam4","custom_colour","0")
  3853. SetTriggerOption("idlespam4","omit_from_output","1")
  3854. SetTriggerOption("idlespam4","enabled","1")
  3855. SetTriggerOption("idlespam5","custom_colour","0")
  3856. SetTriggerOption("idlespam5","omit_from_output","1")
  3857. SetTriggerOption("idlespam5","enabled","1")
  3858. else
  3859. SetTriggerOption("idlespam","custom_colour","0")
  3860. SetTriggerOption("idlespam","omit_from_output","0")
  3861. SetTriggerOption("idlespam","enabled","0")
  3862. SetTriggerOption("idlespam2","custom_colour","0")
  3863. SetTriggerOption("idlespam2","omit_from_output","0")
  3864. SetTriggerOption("idlespam2","enabled","0")
  3865. SetTriggerOption("idlespam3","custom_colour","0")
  3866. SetTriggerOption("idlespam3","omit_from_output","0")
  3867. SetTriggerOption("idlespam3","enabled","0")
  3868. SetTriggerOption("idlespam4","custom_colour","0")
  3869. SetTriggerOption("idlespam4","omit_from_output","0")
  3870. SetTriggerOption("idlespam4","enabled","0")
  3871. SetTriggerOption("idlespam5","custom_colour","0")
  3872. SetTriggerOption("idlespam5","omit_from_output","0")
  3873. SetTriggerOption("idlespam5","enabled","0")
  3874. end
  3875.  
  3876. if SETTINGS.HITCOLOUR == 0 then
  3877. SetTriggerOption("hitcolourme1","enabled","0")
  3878. SetTriggerOption("hitcolourme2","enabled","0")
  3879. SetTriggerOption("hitcolourme3","enabled","0")
  3880. SetTriggerOption("hitcolourme4","enabled","0")
  3881. SetTriggerOption("hitcolourme5","enabled","0")
  3882. SetTriggerOption("hitcolourme6","enabled","0")
  3883. SetTriggerOption("hitcolourme7","enabled","0")
  3884.  
  3885. SetTriggerOption("hitcolourother1","enabled","0")
  3886. SetTriggerOption("hitcolourother2","enabled","0")
  3887. SetTriggerOption("hitcolourother3","enabled","0")
  3888. SetTriggerOption("hitcolourother4","enabled","0")
  3889. SetTriggerOption("hitcolourother5","enabled","0")
  3890. SetTriggerOption("hitcolourother6","enabled","0")
  3891. SetTriggerOption("hitcolourother7","enabled","0")
  3892.  
  3893. SetTriggerOption("hitcolourbad1","enabled","0")
  3894. SetTriggerOption("hitcolourbad2","enabled","0")
  3895. SetTriggerOption("hitcolourbad3","enabled","0")
  3896. SetTriggerOption("hitcolourbad4","enabled","0")
  3897. SetTriggerOption("hitcolourbad5","enabled","0")
  3898. SetTriggerOption("hitcolourbad6","enabled","0")
  3899. SetTriggerOption("hitcolourbad7","enabled","0")
  3900. else
  3901. SetTriggerOption("hitcolourme1","enabled","1")
  3902. SetTriggerOption("hitcolourme2","enabled","1")
  3903. SetTriggerOption("hitcolourme3","enabled","1")
  3904. SetTriggerOption("hitcolourme4","enabled","1")
  3905. SetTriggerOption("hitcolourme5","enabled","1")
  3906. SetTriggerOption("hitcolourme6","enabled","1")
  3907. SetTriggerOption("hitcolourme7","enabled","1")
  3908.  
  3909. SetTriggerOption("hitcolourother1","enabled","1")
  3910. SetTriggerOption("hitcolourother2","enabled","1")
  3911. SetTriggerOption("hitcolourother3","enabled","1")
  3912. SetTriggerOption("hitcolourother4","enabled","1")
  3913. SetTriggerOption("hitcolourother5","enabled","1")
  3914. SetTriggerOption("hitcolourother6","enabled","1")
  3915. SetTriggerOption("hitcolourother7","enabled","1")
  3916.  
  3917. SetTriggerOption("hitcolourbad1","enabled","1")
  3918. SetTriggerOption("hitcolourbad2","enabled","1")
  3919. SetTriggerOption("hitcolourbad3","enabled","1")
  3920. SetTriggerOption("hitcolourbad4","enabled","1")
  3921. SetTriggerOption("hitcolourbad5","enabled","1")
  3922. SetTriggerOption("hitcolourbad6","enabled","1")
  3923. SetTriggerOption("hitcolourbad7","enabled","1")
  3924. end
  3925.  
  3926.  
  3927. if not GROUP_TRIGGERS then
  3928. setgrouptriggerenable("0")
  3929. end
  3930.  
  3931. end -- settriggercolours
  3932.  
  3933.  
  3934. function toggletriggercolours ()
  3935. if not SETTINGS.TRIGGER_COLOURS then
  3936. SETTINGS.TRIGGER_COLOURS = true
  3937. Note("Now using trigger colours.")
  3938.  
  3939. settriggercolours()
  3940. else
  3941. SETTINGS.TRIGGER_COLOURS = false
  3942. Note("Trigger colours now disabled.")
  3943.  
  3944. settriggercolours()
  3945. end
  3946. end -- toggletriggercolours
  3947.  
  3948.  
  3949. function toggletriggerhiding ()
  3950. if SETTINGS.TRIGGER_SHOW then
  3951. SetTriggerOption("map_start","omit_from_output","1")
  3952. SetTriggerOption("multi_line_map","omit_from_output","1")
  3953. SETTINGS.TRIGGER_SHOW = false
  3954. Note("Now hiding the look map.")
  3955. else
  3956. SetTriggerOption("map_start","omit_from_output","0")
  3957. SetTriggerOption("multi_line_map","omit_from_output","0")
  3958. SETTINGS.TRIGGER_SHOW = true
  3959. Note("Now showing the look map.")
  3960. end
  3961. end -- toggletriggerhiding
  3962.  
  3963. function togglepercentcolours ()
  3964. if SETTINGS.PERCENT_COLOURS then
  3965. SETTINGS.PERCENT_COLOURS = false
  3966. Note("Now using fixed bar colours.")
  3967. else
  3968. SETTINGS.PERCENT_COLOURS = true
  3969. Note("Now using percentage bar colours.")
  3970. end
  3971. end -- togglepercentcolours
  3972.  
  3973. function togglexpdetail(name, line, wildcards)
  3974. if wildcards.avg ~= nil and wildcards.avg and string.len(wildcards.avg) > 0 then
  3975. SETTINGS.XPDETAIL_AVG = math.floor(tonumber(wildcards.avg))
  3976.  
  3977. if SETTINGS.XPDETAIL_AVG < 1 then
  3978. SETTINGS.XPDETAIL_AVG = 1
  3979. end
  3980.  
  3981. if SETTINGS.XPDETAIL_AVG > 60 then
  3982. SETTINGS.XPDETAIL_AVG = 60
  3983. end
  3984. SETTINGS.XPDETAIL_SHOW = true
  3985. Note("Now showing xp details with averaging of " .. SETTINGS.XPDETAIL_AVG .. " mins.")
  3986.  
  3987. -- recalculate current plot..
  3988. local dprecalc, dpnum
  3989.  
  3990. for i = 61-dcount,60 do
  3991. dprecalc = 0
  3992. dpnum = 0
  3993. for j = math.max(61-dcount, i - SETTINGS.XPDETAIL_AVG + 1),i do
  3994. dprecalc = dprecalc + dvals[j]
  3995. dpnum = dpnum + 1
  3996. end
  3997. dprecalc = dprecalc * 60 / dpnum / 10000
  3998. if dprecalc > 100 then
  3999. dpoints[i] = 100
  4000. elseif dprecalc < 0 then
  4001. dpoints[i] = 0
  4002. else
  4003. dpoints[i] = dprecalc
  4004. end -- if
  4005. end
  4006.  
  4007. else
  4008. if SETTINGS.XPDETAIL_SHOW then
  4009. SETTINGS.XPDETAIL_SHOW = false
  4010. Note("Now hiding xp details.")
  4011. else
  4012. SETTINGS.XPDETAIL_SHOW = true
  4013. Note("Now showing xp details.")
  4014. end
  4015. end
  4016. DoPrompt()
  4017. end -- togglexpdetail
  4018.  
  4019. ------------------------------------------------
  4020. -- Shield Bits --
  4021. ------------------------------------------------
  4022.  
  4023. function plus_one (name, line, wildcards)
  4024.  
  4025. if wildcards.hp then
  4026. hpv = (ArrayGet("hpt",wildcards.hp)-0.5) / 12;
  4027. hpv = math.max(math.min(hpv,1),0)
  4028. else
  4029. hpv = -1;
  4030. end
  4031. if wildcards.gp and wildcards.gp ~= "" then
  4032. gpv = (ArrayGet("gpt",wildcards.gp)-0.5) / 10;
  4033. gpv = math.max(math.min(gpv,1),0)
  4034. else
  4035. gpv = -1;
  4036. end
  4037.  
  4038. if ArrayKeyExists ("group", string.lower(wildcards.player)) then
  4039. local ptable = string.lower(wildcards.player)
  4040. ArraySet (ptable, "hpf", hpv)
  4041. ArraySet (ptable, "gpf", gpv)
  4042. else groupnumber = groupnumber + 1
  4043. local ptable = string.lower(wildcards.player)
  4044.  
  4045. ArrayCreate (ptable)
  4046. ArraySet (ptable, "player", wildcards.player)
  4047. ArraySet (ptable, "ccc", "black")
  4048. ArraySet (ptable, "cccm", "")
  4049. ArraySet (ptable, "tpa", "black")
  4050. ArraySet (ptable, "tpam", "")
  4051. ArraySet (ptable, "ms", "black")
  4052. ArraySet (ptable, "msm", "")
  4053. ArraySet (ptable, "eff", "black")
  4054. ArraySet (ptable, "effm", "")
  4055. ArraySet (ptable, "kii", "black")
  4056. ArraySet (ptable, "kiim", "")
  4057. ArraySet (ptable, "hpf", hpv)
  4058. ArraySet (ptable, "gpf", gpv)
  4059. ArraySet (ptable, "kills", 0)
  4060. ArraySet ("group", ptable, "win" .. groupnumber)
  4061. ArraySet ("numbers", ptable, groupnumber)
  4062. ArraySet ("numbers", groupnumber, ptable)
  4063. end -- if
  4064.  
  4065. setgrouptriggers()
  4066. DoPrompt() -- update display
  4067. end -- plus_one
  4068.  
  4069. function plus_one_set_player (name, line, wildcards)
  4070.  
  4071. hpv = wildcards.hp / wildcards.maxhp;
  4072. gpv = wildcards.gp / wildcards.maxgp;
  4073.  
  4074. if ArrayKeyExists ("group", string.lower(wildcards.player)) then
  4075. local ptable = string.lower(wildcards.player)
  4076. ArraySet (ptable, "hpf", hpv)
  4077. ArraySet (ptable, "gpf", gpv)
  4078.  
  4079. else groupnumber = groupnumber + 1
  4080. SetVariable ("me", wildcards.player)
  4081. local ptable = string.lower(wildcards.player)
  4082. ArrayCreate (ptable)
  4083. ArraySet (ptable, "player", wildcards.player)
  4084. ArraySet (ptable, "ccc", "black")
  4085. ArraySet (ptable, "cccm", "")
  4086. ArraySet (ptable, "tpa", "black")
  4087. ArraySet (ptable, "tpam", "")
  4088. ArraySet (ptable, "ms", "black")
  4089. ArraySet (ptable, "msm", "")
  4090. ArraySet (ptable, "eff", "black")
  4091. ArraySet (ptable, "effm", "")
  4092. ArraySet (ptable, "kii", "black")
  4093. ArraySet (ptable, "kiim", "")
  4094. ArraySet (ptable, "hpf", hpv)
  4095. ArraySet (ptable, "gpf", gpv)
  4096. ArraySet (ptable, "kills", 0)
  4097.  
  4098. ArraySet ("group", ptable, "win" .. groupnumber)
  4099. ArraySet ("numbers", ptable, groupnumber)
  4100. ArraySet ("numbers", groupnumber, ptable)
  4101. end -- if
  4102. setgrouptriggers()
  4103. DoPrompt() -- update display
  4104. end -- plus_one_set_player
  4105.  
  4106. function minus_one (name, line, wildcards)
  4107. if ArrayKeyExists ("group", string.lower(wildcards.player)) then
  4108. local ptable = string.lower(wildcards.player)
  4109.  
  4110. ArrayDelete(ptable)
  4111. leavenumber = ArrayGet ("numbers", ptable)
  4112. shufflenumber = ArrayGet ("numbers", ptable)
  4113. ArrayDeleteKey("group", ptable)
  4114. ArrayDeleteKey("numbers", ptable)
  4115. reshuffle ()
  4116. else
  4117. end -- if
  4118. DoPrompt() -- update display
  4119. end -- minus_one
  4120.  
  4121. function reshuffle (name, line, wildcards)
  4122. if leavenumber - groupnumber == 0 then
  4123. ArrayDeleteKey ("numbers", leavenumber)
  4124. groupnumber = groupnumber - 1
  4125. else ArraySet("group", ArrayGet("numbers", leavenumber + 1), "win" .. leavenumber)
  4126. ArraySet("numbers", ArrayGet("numbers", leavenumber + 1), leavenumber)
  4127. ArraySet("numbers", leavenumber, ArrayGet("numbers", leavenumber + 1))
  4128. leavenumber = leavenumber + 1
  4129. reshuffle ()
  4130. end -- if
  4131. end -- reshuffle
  4132.  
  4133. function group_fail (name, line, wildcards)
  4134. omitshieldtriggers("0")
  4135. end -- group_fail
  4136.  
  4137. function group_leave (name, line, wildcards)
  4138. -- get rid of all player arrays
  4139. for k,v in pairs(ArrayList("group")) do
  4140. ArrayDelete(k)
  4141. end
  4142. ArrayClear("group")
  4143. ArrayClear("numbers")
  4144. leavenumber = 0
  4145. groupnumber = 0
  4146. shufflenumber = 0
  4147. other_kills = 0
  4148. SetVariable("me", "0")
  4149. SetVariable("myeff","0")
  4150. setgrouptriggers()
  4151. DoPrompt() -- update display
  4152. end -- group_leave
  4153.  
  4154.  
  4155. function group_join (name, line, wildcards)
  4156. -- simply request a refresh
  4157. --ResetGroup ()
  4158.  
  4159. end -- group_leave
  4160.  
  4161.  
  4162. function list_group (name, line, wildcards)
  4163. table.foreach (ArrayList ("group"), print)
  4164. Note ("---------")
  4165. table.foreach (ArrayList ("numbers"), print)
  4166. Note ("---------")
  4167. Note (GetVariable("me"))
  4168.  
  4169. Note("---")
  4170. windows = WindowList()
  4171.  
  4172. if windows then
  4173. for _, v in ipairs (windows) do
  4174. if string.sub(v,1,3) == "win" then
  4175. WindowDelete(v)
  4176. end
  4177. Note (v)
  4178. end
  4179. end -- if any
  4180.  
  4181. Note("========")
  4182. for k, v in pairs (ArrayListAll ()) do
  4183. Note (v)
  4184. end
  4185. end -- list_group
  4186.  
  4187. function omitshieldtriggers (value)
  4188. SetTriggerOption("prot_ccc","omit_from_output",value)
  4189. SetTriggerOption("prot_eff","omit_from_output",value)
  4190. SetTriggerOption("prot_major","omit_from_output",value)
  4191. SetTriggerOption("prot_kii","omit_from_output",value)
  4192. SetTriggerOption("prot_tpa","omit_from_output",value)
  4193. SetTriggerOption("prot_other","omit_from_output",value)
  4194. SetTriggerOption("prot_start","omit_from_output",value)
  4195. SetTriggerOption("prot_noprot","omit_from_output",value)
  4196. SetTriggerOption("stat_other","omit_from_output",value)
  4197. SetTriggerOption("stat_me","omit_from_output",value)
  4198. SetTriggerOption("group_nogroup","omit_from_output",value)
  4199. end -- omitshieldtriggers
  4200.  
  4201.  
  4202. function setgrouptriggers ()
  4203. if groupnumber == 0 then
  4204. -- not in a group - don't run triggers
  4205. if GROUP_TRIGGERS then
  4206. setgrouptriggerenable("0")
  4207. GROUP_TRIGGERS = false
  4208. end
  4209. else
  4210. -- enable all group triggers
  4211. if not GROUP_TRIGGERS then
  4212. setgrouptriggerenable("1")
  4213. GROUP_TRIGGERS = true
  4214. end
  4215. end
  4216. end -- setgrouptriggers
  4217.  
  4218. function setgrouptriggerenable(value)
  4219. if value == "0" and SETTINGS.TRIGGER_COLOURS then
  4220. -- set/leave personal triggers on
  4221.  
  4222. SetTriggerOption("up_me__kii","enabled","1")
  4223. SetTriggerOption("up_me__eff","enabled","1")
  4224. SetTriggerOption("up_me__tpa","enabled","1")
  4225. SetTriggerOption("up_me2_tpa","enabled","1")
  4226. SetTriggerOption("up_me__ccc","enabled","1")
  4227. SetTriggerOption("up_me__major","enabled","1")
  4228. SetTriggerOption("up_me2_major","enabled","1")
  4229.  
  4230. SetTriggerOption("dn_me__kii","enabled","1")
  4231. SetTriggerOption("dn_me2_kii","enabled","1")
  4232. SetTriggerOption("dn_me__eff","enabled","1")
  4233. SetTriggerOption("dn_me__tpa","enabled","1")
  4234. SetTriggerOption("dn_me__ccc","enabled","1")
  4235. SetTriggerOption("dn_me__major","enabled","1")
  4236.  
  4237. SetTriggerOption("up_me3_tpa","enabled","1")
  4238. SetTriggerOption("up_me4_tpa","enabled","1")
  4239. SetTriggerOption("up_me5_tpa","enabled","1")
  4240. SetTriggerOption("up_me6_tpa","enabled","1")
  4241.  
  4242. SetTriggerOption("up_me2_kii","enabled","1")
  4243. SetTriggerOption("wk_me__major","enabled","1")
  4244. SetTriggerOption("wk_me__kii","enabled","1")
  4245. SetTriggerOption("wk_me__tpa","enabled","1")
  4246.  
  4247. SetTriggerOption("up_ot__kii","enabled",value)
  4248. SetTriggerOption("up_ot__eff","enabled",value)
  4249. SetTriggerOption("up_ot__tpa","enabled",value)
  4250. SetTriggerOption("up_ot2_tpa","enabled",value)
  4251. SetTriggerOption("up_ot__ccc","enabled",value)
  4252. SetTriggerOption("up_ot__major","enabled",value)
  4253.  
  4254. SetTriggerOption("dn_ot__kii","enabled",value)
  4255. SetTriggerOption("dn_ot2_kii","enabled",value)
  4256. SetTriggerOption("dn_ot__eff","enabled",value)
  4257. SetTriggerOption("dn_ot2_eff","enabled","1")
  4258. SetTriggerOption("dn_ot__tpa","enabled",value)
  4259. SetTriggerOption("dn_ot__ccc","enabled",value)
  4260. SetTriggerOption("dn_ot__major","enabled",value)
  4261.  
  4262. SetTriggerOption("up_ot3_tpa","enabled",value)
  4263. SetTriggerOption("up_ot4_tpa","enabled",value)
  4264. SetTriggerOption("up_ot5_tpa","enabled",value)
  4265. SetTriggerOption("up_ot6_tpa","enabled",value)
  4266.  
  4267. SetTriggerOption("wk_ot__major","enabled",value)
  4268. SetTriggerOption("wk_ot__kii","enabled",value)
  4269. SetTriggerOption("wk_ot__tpa","enabled",value)
  4270.  
  4271. else
  4272.  
  4273. SetTriggerOption("up_me__kii","enabled",value)
  4274. SetTriggerOption("up_me__eff","enabled",value)
  4275. SetTriggerOption("up_me__tpa","enabled",value)
  4276. SetTriggerOption("up_me2_tpa","enabled",value)
  4277. SetTriggerOption("up_me__ccc","enabled",value)
  4278. SetTriggerOption("up_me__major","enabled",value)
  4279. SetTriggerOption("up_me2_major","enabled",value)
  4280.  
  4281. SetTriggerOption("dn_me__kii","enabled",value)
  4282. SetTriggerOption("dn_me2_kii","enabled",value)
  4283. SetTriggerOption("dn_me__eff","enabled",value)
  4284. SetTriggerOption("dn_me__tpa","enabled",value)
  4285. SetTriggerOption("dn_me__ccc","enabled",value)
  4286. SetTriggerOption("dn_me__major","enabled",value)
  4287.  
  4288. SetTriggerOption("up_ot__kii","enabled",value)
  4289. SetTriggerOption("up_ot__eff","enabled",value)
  4290. SetTriggerOption("up_ot__tpa","enabled",value)
  4291. SetTriggerOption("up_ot2_tpa","enabled",value)
  4292. SetTriggerOption("up_ot__ccc","enabled",value)
  4293. SetTriggerOption("up_ot__major","enabled",value)
  4294.  
  4295. SetTriggerOption("dn_ot__kii","enabled",value)
  4296. SetTriggerOption("dn_ot2_kii","enabled",value)
  4297. SetTriggerOption("dn_ot__eff","enabled",value)
  4298. SetTriggerOption("dn_ot2_eff","enabled",value)
  4299. SetTriggerOption("dn_ot__tpa","enabled",value)
  4300. SetTriggerOption("dn_ot__ccc","enabled",value)
  4301. SetTriggerOption("dn_ot__major","enabled",value)
  4302.  
  4303. SetTriggerOption("up_ot3_tpa","enabled",value)
  4304. SetTriggerOption("up_ot4_tpa","enabled",value)
  4305. SetTriggerOption("up_ot5_tpa","enabled",value)
  4306. SetTriggerOption("up_ot6_tpa","enabled",value)
  4307.  
  4308. SetTriggerOption("up_me3_tpa","enabled",value)
  4309. SetTriggerOption("up_me4_tpa","enabled",value)
  4310. SetTriggerOption("up_me5_tpa","enabled",value)
  4311. SetTriggerOption("up_me6_tpa","enabled",value)
  4312.  
  4313. SetTriggerOption("up_me2_kii","enabled",value)
  4314. SetTriggerOption("wk_me__major","enabled",value)
  4315. SetTriggerOption("wk_me__kii","enabled",value)
  4316. SetTriggerOption("wk_me__tpa","enabled",value)
  4317.  
  4318. SetTriggerOption("wk_ot__major","enabled",value)
  4319. SetTriggerOption("wk_ot__kii","enabled",value)
  4320. SetTriggerOption("wk_ot__tpa","enabled",value)
  4321.  
  4322. end
  4323.  
  4324. end -- setgrouptriggerenable
  4325.  
  4326. function downall(pname)
  4327.  
  4328. pname = fixcheckname(pname)
  4329. if pname == nil then
  4330. return
  4331. end
  4332.  
  4333. -- if/else table -- not too many options
  4334. if string.len(ArrayGet(string.lower(pname), "cccm")) > 0 then
  4335. ArraySet (string.lower(pname), "ccc", "red")
  4336. ArraySet (string.lower(pname), "cccm", "!CCC")
  4337. end
  4338.  
  4339. if string.len(ArrayGet(string.lower(pname), "tpam")) > 0 then
  4340. ArraySet (string.lower(pname), "tpa", "red")
  4341. ArraySet (string.lower(pname), "tpam", "!TPA")
  4342. end
  4343. if string.len(ArrayGet(string.lower(pname), "kiim")) > 0 then
  4344. ArraySet (string.lower(pname), "kii", "red")
  4345. ArraySet (string.lower(pname), "kiim", "!KII")
  4346. end
  4347. if string.len(ArrayGet(string.lower(pname), "msm")) > 0 then
  4348. ArraySet (string.lower(pname), "ms", "red")
  4349. ArraySet (string.lower(pname), "msm", "!MS")
  4350. end
  4351. if string.len(ArrayGet(string.lower(pname), "effm")) > 0 then
  4352. ArraySet (string.lower(pname), "eff", "red")
  4353. ArraySet (string.lower(pname), "effm", "!EFF")
  4354. end
  4355.  
  4356. end
  4357.  
  4358.  
  4359. -- prot redirector
  4360. function prot_redirect (name, line, wildcards, styles)
  4361.  
  4362. if name == "prot_start" then
  4363. -- Note("start of prot")
  4364. prot_name = wildcards.player
  4365. -- mark as down any existing shields as gone
  4366. downall(prot_name)
  4367.  
  4368. EnableTrigger ("prot_ccc", true) -- capture subsequent lines
  4369. EnableTrigger ("prot_eff", true) -- capture subsequent lines
  4370. EnableTrigger ("prot_tpa", true) -- capture subsequent lines
  4371. EnableTrigger ("prot_major", true) -- capture subsequent lines
  4372. EnableTrigger ("prot_kii", true) -- capture subsequent lines
  4373. EnableTrigger ("prot_other", true) -- capture subsequent lines
  4374. EnableTrigger ("prot_end", true) -- capture subsequent lines
  4375.  
  4376. elseif name == "prot_noprot" then
  4377. -- Note("start of prot")
  4378. prot_name = wildcards.player
  4379. EnableTrigger ("prot_other", true) -- capture subsequent lines
  4380. EnableTrigger ("prot_end", true) -- capture subsequent lines
  4381. no_shields("ns_ot", line, wildcards)
  4382.  
  4383. elseif name == "prot_end" or name == "prot_end_force" then
  4384. -- Note("end of prot")
  4385. -- table.foreach(wildcards,print)
  4386. EnableTrigger ("prot_ccc", false) -- no more lines to go
  4387. EnableTrigger ("prot_eff", false) -- no more lines to go
  4388. EnableTrigger ("prot_tpa", false) -- no more lines to go
  4389. EnableTrigger ("prot_major", false) -- no more lines to go
  4390. EnableTrigger ("prot_kii", false) -- no more lines to go
  4391. EnableTrigger ("prot_other", false) -- no more lines to go
  4392. EnableTrigger ("prot_end", false) -- no more lines to go
  4393. prot_name = "0"
  4394. omitshieldtriggers("0")
  4395. else
  4396. -- Note("mid prot")
  4397. -- table.foreach(wildcards,print)
  4398. end -- if
  4399. end -- function prot_redirect
  4400.  
  4401. function shield_up (name, line, wildcards)
  4402. if string.sub(name,1,5) == "up_me" then
  4403. -- operating on me rather than other
  4404. if GetVariable("me") == "0" then
  4405. -- operating on 'me', but no idea which player that is..
  4406. return
  4407. else
  4408. pname = GetVariable("me")
  4409. typename = string.sub(name,8) -- remove 'up_meX_'
  4410. end
  4411. else
  4412. if prot_name == "0" then
  4413. pname = wildcards.player
  4414. else
  4415. pname = prot_name
  4416. end
  4417. if string.sub(name,1,5) == "prot_" then
  4418. typename = string.sub(name,6) -- remove 'prot_'
  4419. else
  4420. typename = string.sub(name,8) -- remove 'up_otX_'
  4421. end
  4422. end
  4423.  
  4424. pname = fixcheckname(pname)
  4425. if pname == nil then
  4426. return
  4427. end
  4428.  
  4429. -- if/else table -- not too many options
  4430. if typename == "ccc" then
  4431. if wildcards.strength then
  4432. ccccolour = ArrayGet("cccs", wildcards.strength)
  4433. else
  4434. ccccolour = "white"
  4435. end
  4436. ArraySet (string.lower(pname), "ccc", ccccolour)
  4437. ArraySet (string.lower(pname), "cccm", "CCC")
  4438. elseif typename == "tpa" then
  4439. if wildcards.colour and string.len(wildcards.colour) > 0 then
  4440. tpacolour = ArrayGet("tpas", wildcards.colour)
  4441. else
  4442. tpacolour = "white"
  4443. end
  4444. ArraySet (string.lower(pname), "tpa", tpacolour)
  4445. ArraySet (string.lower(pname), "tpam", "TPA")
  4446. elseif typename == "kii" then
  4447. ArraySet (string.lower(pname), "kii", ArrayGet("kiis", wildcards.size))
  4448. ArraySet (string.lower(pname), "kiim", "KII")
  4449. elseif typename == "major" then
  4450. ArraySet (string.lower(pname), "ms", "white")
  4451. ArraySet (string.lower(pname), "msm", "MS")
  4452. elseif typename == "eff" then
  4453. if pname == GetVariable("me") then
  4454. -- set our eff item
  4455. SetVariable("myeff", wildcards.effitem)
  4456. end
  4457. ArraySet (string.lower(pname), "eff", "white")
  4458. ArraySet (string.lower(pname), "effm", "EFF")
  4459. else -- name not matched
  4460. Note("Unexpected protection type given!")
  4461. return
  4462. end -- 'switch' on name
  4463.  
  4464. refresh_shields ()
  4465.  
  4466. end -- shield_up
  4467.  
  4468. function shield_weaken (name, line, wildcards)
  4469. if string.sub(name,1,5) == "wk_me" then
  4470. -- operating on me rather than other
  4471. if GetVariable("me") == "0" then
  4472. -- operating on 'me', but no idea which player that is..
  4473. return
  4474. else
  4475. pname = GetVariable("me")
  4476. typename = string.sub(name,8) -- remove 'wk_meX_'
  4477. end
  4478. else
  4479. if prot_name == "0" then
  4480. pname = wildcards.player
  4481. else
  4482. pname = prot_name
  4483. end
  4484. typename = string.sub(name,8) -- remove 'wk_otX_'
  4485. end
  4486.  
  4487. pname = fixcheckname(pname)
  4488. if pname == nil then
  4489. return
  4490. end
  4491.  
  4492. -- if/else table -- not too many options
  4493. if typename == "ccc" then
  4494. if wildcards.strength then
  4495. ccccolour = ArrayGet("cccs", wildcards.strength)
  4496. else
  4497. ccccolour = "white"
  4498. end
  4499. ArraySet (string.lower(pname), "ccc", ccccolour)
  4500. ArraySet (string.lower(pname), "cccm", "~CCC")
  4501. elseif typename == "tpa" then
  4502. if wildcards.colour and string.len(wildcards.colour) > 0 then
  4503. tpacolour = ArrayGet("tpas", wildcards.colour)
  4504. else
  4505. tpacolour = "white"
  4506. end
  4507. ArraySet (string.lower(pname), "tpa", tpacolour)
  4508. ArraySet (string.lower(pname), "tpam", "~TPA")
  4509. elseif typename == "kii" then
  4510. ArraySet (string.lower(pname), "kii", ArrayGet("kiis", wildcards.size))
  4511. ArraySet (string.lower(pname), "kiim", "~KII")
  4512. elseif typename == "major" then
  4513. ArraySet (string.lower(pname), "ms", "orange")
  4514. ArraySet (string.lower(pname), "msm", "~MS")
  4515. elseif typename == "eff" then
  4516. ArraySet (string.lower(pname), "eff", "orange")
  4517. ArraySet (string.lower(pname), "effm", "~EFF")
  4518. else -- name not matched
  4519. Note("Unexpected protection type given!")
  4520. return
  4521. end -- 'switch' on name
  4522.  
  4523. refresh_shields ()
  4524.  
  4525. end -- shield_weaken
  4526.  
  4527. function shield_down (name, line, wildcards)
  4528.  
  4529. if string.sub(name,1,5) == "dn_me" then
  4530. -- operating on me rather than other
  4531. if GetVariable("me") == "0" then
  4532. -- operating on 'me', but no idea which player that is..
  4533. return
  4534. else
  4535. pname = GetVariable("me")
  4536. typename = string.sub(name,8) -- remove 'dn_meX_'
  4537. end
  4538. else
  4539. if prot_name == "0" then
  4540. pname = wildcards.player
  4541. else
  4542. pname = prot_name
  4543. end
  4544. typename = string.sub(name,8) -- remove 'dn_otX_'
  4545. end
  4546.  
  4547. pname = fixcheckname(pname)
  4548. if pname == nil then
  4549. return
  4550. end
  4551.  
  4552. -- if/else table -- not too many options
  4553. if typename == "ccc" then
  4554. ArraySet (string.lower(pname), "ccc", "red")
  4555. ArraySet (string.lower(pname), "cccm", "!CCC")
  4556. elseif typename == "tpa" then
  4557. ArraySet (string.lower(pname), "tpa", "red")
  4558. ArraySet (string.lower(pname), "tpam", "!TPA")
  4559. elseif typename == "kii" then
  4560. ArraySet (string.lower(pname), "kii", "red")
  4561. ArraySet (string.lower(pname), "kiim", "!KII")
  4562. elseif typename == "major" then
  4563. ArraySet (string.lower(pname), "ms", "red")
  4564. ArraySet (string.lower(pname), "msm", "!MS")
  4565. elseif typename == "eff" then
  4566. ArraySet (string.lower(pname), "eff", "red")
  4567. ArraySet (string.lower(pname), "effm", "!EFF")
  4568. else -- name not matched
  4569. Note("Unexpected protection type given!")
  4570. return
  4571. end -- 'switch' on name
  4572.  
  4573. refresh_shields ()
  4574.  
  4575. end -- shield_down
  4576.  
  4577. function fixcheckname(pname)
  4578. if ArrayKeyExists ("group", string.lower(pname)) then
  4579. return pname
  4580. end
  4581.  
  4582. -- handle issues with titles...
  4583. for k,_ in pairs(ArrayList("group")) do
  4584. if string.find(string.lower(pname),k) ~= nil then
  4585. return k
  4586. end
  4587. end
  4588. return nil
  4589. end
  4590.  
  4591. function player_kill (name, line, wildcards)
  4592.  
  4593. if name == "mekill" then
  4594. -- operating on me rather than other
  4595. if GetVariable("me") == "0" then
  4596. -- operating on 'me', but no idea which player that is..
  4597. return
  4598. else
  4599. pname = GetVariable("me")
  4600. end
  4601. else
  4602. pname = wildcards.player
  4603. end
  4604.  
  4605. pname = fixcheckname(pname)
  4606. if pname == nil then
  4607. other_kills = other_kills + 1
  4608. return
  4609. end
  4610.  
  4611.  
  4612. ArraySet (string.lower(pname), "kills", ArrayGet(string.lower(pname), "kills") + 1)
  4613.  
  4614. end -- player_kill
  4615.  
  4616.  
  4617. function no_shields (name, line, wildcards)
  4618. if string.sub(name,1,5) == "ns_me" then
  4619. -- operating on me rather than other
  4620. if GetVariable("me") == "0" then
  4621. -- operating on 'me', but no idea which player that is..
  4622. return
  4623. else
  4624. pname = GetVariable("me")
  4625. end
  4626. else
  4627. if prot_name == "0" then
  4628. pname = wildcards.player
  4629. else
  4630. pname = prot_name
  4631. end
  4632. end
  4633.  
  4634. pname = fixcheckname(pname)
  4635. if pname == nil then
  4636. return
  4637. end
  4638.  
  4639. ArraySet (string.lower(pname), "ccc", "black")
  4640. ArraySet (string.lower(pname), "cccm", "")
  4641. ArraySet (string.lower(pname), "tpa", "black")
  4642. ArraySet (string.lower(pname), "tpam", "")
  4643. ArraySet (string.lower(pname), "eff", "black")
  4644. ArraySet (string.lower(pname), "effm", "")
  4645. ArraySet (string.lower(pname), "kii", "black")
  4646. ArraySet (string.lower(pname), "kiim", "")
  4647. ArraySet (string.lower(pname), "ms", "black")
  4648. ArraySet (string.lower(pname), "msm", "")
  4649. refresh_shields ()
  4650. end -- no_shields
  4651.  
  4652.  
  4653. function eff_stopped_any (name, line, wildcards)
  4654. if GetVariable("me") == "0" then
  4655. SetVariable("me", "0")
  4656. else
  4657. if wildcards.effitem == GetVariable("myeff") then
  4658. ArraySet (string.lower(GetVariable("me")), "eff", "black")
  4659. ArraySet (string.lower(GetVariable("me")), "effm", "")
  4660. SetVariable("myeff","0")
  4661. refresh_shields ()
  4662. end
  4663. end -- if
  4664. end -- eff_stopped_me
  4665.  
  4666. function refresh_shields ()
  4667. DoPrompt()
  4668. end -- refresh_shields
  4669.  
  4670. function showkills()
  4671. Note("Kills Report:")
  4672. for k,v in pairs(ArrayList("group")) do
  4673. Note(ArrayGet(k,"player") .. ": " .. ArrayGet(k,"kills"))
  4674. end
  4675. Note("Others: " .. other_kills)
  4676. end
  4677.  
  4678. function reportkills()
  4679.  
  4680. report_text = "Kills report: "
  4681.  
  4682. for k,v in pairs(ArrayList("group")) do
  4683. report_text = report_text .. ArrayGet(k,"player") .. ": " .. ArrayGet(k,"kills") .. ", "
  4684. end
  4685. report_text = report_text .. ("Others: " .. other_kills)
  4686.  
  4687. Execute("group say " .. report_text)
  4688.  
  4689. end
  4690.  
  4691.  
  4692. -------------------------------------------------------------------------------------------
  4693. -- Map code
  4694. -------------------------------------------------------------------------------------------
  4695.  
  4696. -- for legend:
  4697. background_colour = 0x00220E
  4698. border_colour = ColourNameToRGB "dimgray"
  4699.  
  4700. require "checkplugin"
  4701. require "commas"
  4702. require "mw"
  4703.  
  4704. map_lines = {}
  4705. map_title = ""
  4706. map_title_fresh = false
  4707.  
  4708. map_our_pos = 5
  4709.  
  4710. function Display_Line (line, styles)
  4711. local id = map_font_id
  4712.  
  4713. local left = INDENT+22
  4714. --local top = (line - 1) * font_height + 61 + (((10-#map_lines)*font_height)/2) --centre map top to bottom
  4715.  
  4716. -- Kyr mod: want to account for even numbers of lines -> don't centre exactly...
  4717. local nlines = math.ceil(#map_lines /2)* 2
  4718. local lines_to_skip = 6 - map_our_pos
  4719. local top = (line - 1) * font_height + 43 + (lines_to_skip*font_height) --centre map top to bottom
  4720.  
  4721. for _, v in ipairs (styles) do
  4722. left = left + WindowText (MapWin, id, v.text, left, top, 0, 0, v.textcolour)
  4723. end -- for each style run
  4724. end -- Display_Line
  4725.  
  4726. function ColourString(val)
  4727.  
  4728. if val == nil then
  4729. return "000000"
  4730. end
  4731.  
  4732. local tmp = bit.tostring(val, 16)
  4733. local pad = "000000"
  4734.  
  4735. tmp = string.sub(pad,1,6-string.len(tmp)) .. tmp
  4736.  
  4737. return tmp
  4738. end
  4739.  
  4740. function Display_Map ()
  4741. MapWin = GetPluginID() .. "2"
  4742.  
  4743. local mapbg = CalculateHalfColour(COLOURS.OUTLINE);
  4744.  
  4745. WindowCreate (MapWin,
  4746. 0, 0, bar_width, map_height,
  4747. mushvar.mappos, -- center left
  4748. 0,
  4749. COLOURS.MAP_BACKGROUND) -- blank window
  4750.  
  4751. --WindowCircleOp (MapWin, 3, 3, 55, INDENT, map_height-5, COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  4752.  
  4753. WindowRectOp (MapWin, 2, bar_width-15, 59, bar_width-2, 75, mapbg ) -- fill entire box
  4754. WindowRectOp (MapWin, 1, bar_width-15, 59, bar_width-1, 75, COLOURS.OUTLINE ) -- border
  4755.  
  4756. WindowText (MapWin, map_title_font_id, "?", bar_width-10, 61, bar_width-2, 74, 0)
  4757. WindowText (MapWin, map_title_font_id, "?", bar_width-11, 60, bar_width-2, 74, ColourNameToRGB("gray"))
  4758.  
  4759. WindowCircleOp (MapWin, 3, INDENT-15, 50, bar_width, map_height, -- round rectangle
  4760. COLOURS.OUTLINE, 0, 2, ColourNameToRGB ("black"), 1, 15, 15)
  4761.  
  4762. -- Window frame
  4763. WindowCircleOp (MapWin, 3, 0, 0, bar_width, 60, -- round rectangle
  4764. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 15, 15)
  4765.  
  4766. WindowGradient (MapWin, 1, 4, bar_width-2, 30,
  4767. mapbg, COLOURS.BACKGROUND, 2)
  4768. WindowGradient (MapWin, 1, 30, bar_width-2, 60-4,
  4769. COLOURS.BACKGROUND, mapbg, 2)
  4770.  
  4771.  
  4772. -- map title set up
  4773. local id = map_title_font_id
  4774. local left_margin = 5
  4775. local right_margin = 0
  4776. local width = bar_width
  4777.  
  4778. -- derive stuff from font
  4779. local space_width = WindowTextWidth (MapWin, id, " ")
  4780. local line_height = WindowFontInfo (MapWin, id, 1)
  4781.  
  4782. -- starting point
  4783. local x = left_margin
  4784. local y = 0
  4785. local counter = 0
  4786.  
  4787. -- do each word
  4788. message = map_title
  4789.  
  4790. local approxlines = math.ceil(WindowTextWidth (MapWin, id, message) /(width - right_margin - left_margin))
  4791. y = (4 - approxlines) * line_height / 2
  4792.  
  4793. for word in string.gmatch (message, "%S+") do
  4794. local word_width = WindowTextWidth (MapWin, id, word)
  4795.  
  4796. -- time to start a new line?
  4797. if (word_width + x) > (width - right_margin) and (x > left_margin) then
  4798. y = y + line_height
  4799. x = left_margin
  4800. counter = counter + 1
  4801. end -- if
  4802.  
  4803. -- draw the text
  4804. WindowText (MapWin, id, word, x, y, 0, map_height-10, COLOURS.TEXT)
  4805.  
  4806. -- advance past the word and a single space
  4807. x = x + word_width + space_width
  4808. end -- for loop
  4809.  
  4810. -- map display
  4811. -- display each line
  4812. for i, v in ipairs (map_lines) do
  4813. Display_Line (i, v)
  4814. end -- for
  4815.  
  4816. -- make a hotspot
  4817. WindowAddHotspot(MapWin, "legend_hotspot",
  4818. bar_width-15, 60, bar_width-2, 75, -- remainder
  4819. "mouseover", -- MouseOver
  4820. "cancelmouseover", -- CancelMouseOver
  4821. "", -- MouseDown
  4822. "", -- CancelMouseDown
  4823. "", -- MouseUp
  4824. "", -- tooltip text
  4825. 0, 0) -- movement cursor
  4826.  
  4827. WindowShow (MapWin, true)
  4828. end -- Display_Map
  4829.  
  4830. -- map redirector
  4831. function map_redirect (name, line, wildcards, styles)
  4832. EnableTrigger ("multi_line_map", true) -- capture subsequent lines
  4833. EnableTrigger ("map_end", true) -- capture subsequent lines
  4834.  
  4835. if name == "map_start" then
  4836. map_lines = {}
  4837. map_title = wildcards[1]
  4838. map_title_fresh = true
  4839. elseif name == "map_end" then
  4840. EnableTrigger ("multi_line_map", false) -- no more lines to go
  4841. EnableTrigger ("map_end", false) -- no more lines to go
  4842. Display_Map ()
  4843. else
  4844. --local len = #line
  4845. table.insert (map_lines, styles)
  4846.  
  4847. -- Kyr mod: check for player pos...
  4848. for _, v in ipairs (styles) do
  4849. if string.find(v.text, "@") and v.textcolour == ColourNameToRGB("yellow") then
  4850. map_our_pos = #map_lines
  4851. break
  4852. end --if
  4853. end -- for each style run
  4854.  
  4855. end -- if
  4856. end -- function map_redirect
  4857.  
  4858.  
  4859. function ColourFromPercentage(percentage, high, med, low)
  4860. percentage = math.min(math.max(0, percentage), 100)
  4861. local x = (percentage - 50) / 50;
  4862.  
  4863. local highr = tonumber(string.sub(ColourString(high),5,6),16)
  4864. local highg = tonumber(string.sub(ColourString(high),3,4),16)
  4865. local highb = tonumber(string.sub(ColourString(high),1,2),16)
  4866. local medr = tonumber(string.sub(ColourString(med),5,6),16)
  4867. local medg = tonumber(string.sub(ColourString(med),3,4),16)
  4868. local medb = tonumber(string.sub(ColourString(med),1,2),16)
  4869. local lowr = tonumber(string.sub(ColourString(low),5,6),16)
  4870. local lowg = tonumber(string.sub(ColourString(low),3,4),16)
  4871. local lowb = tonumber(string.sub(ColourString(low),1,2),16)
  4872.  
  4873. local colg = math.ceil(highg * math.max(0,x) + medg * (1 - math.abs(x)) + lowg * math.max(0,-x))
  4874.  
  4875. local colr = math.ceil(highr * math.max(0,x) + medr * (1 - math.abs(x)) + lowr * math.max(0,-x))
  4876.  
  4877. local colb = math.ceil(highb * math.max(0,x) + medb * (1 - math.abs(x)) + lowb * math.max(0,-x))
  4878.  
  4879. return colr + colg*256 + colb*65536
  4880. end -- function ColourFromPercentage
  4881. -------------------------------------------------------------------------------------------
  4882. -- Status bar code
  4883. -------------------------------------------------------------------------------------------
  4884. function DrawGauges (sName, sLine, wildcards)
  4885. local percenthp = math.floor (mushvar.hp/mushvar.maxhp*100)
  4886. local percentgp = math.floor (mushvar.GP/mushvar.maxgp*100)
  4887. local percentgpest = math.floor (mushvar.gpest/mushvar.maxgp*100)
  4888. local percentburden = mushvar.burden
  4889.  
  4890. vertical = 5 -- pixel to start at
  4891.  
  4892. WindowCreate (GaugeWin, 0, 1, bar_width, 66, mushvar.barpos, 0, ColourNameToRGB ("black"))
  4893.  
  4894. WindowCircleOp (GaugeWin, 3, 3, 5, INDENT, BUTTON_HEIGHT+5, -- round rectangle
  4895. COLOURS.OUTLINE, 0, 2, COLOURS.OUTLINE, 0, 5, 5)
  4896.  
  4897. -- Window frame
  4898. WindowCircleOp (GaugeWin, 3, INDENT-15, 0, bar_width, 66, -- round rectangle
  4899. COLOURS.OUTLINE, 0, 2, COLOURS.BACKGROUND, 0, 15, 15)
  4900.  
  4901. --WindowGradient (GaugeWin, 5, 6, INDENT-13, BUTTON_HEIGHT+3,
  4902. -- COLOURS.OUTLINE, COLOURS.BACKGROUND, 1)
  4903.  
  4904.  
  4905. -- relate colour to percentage..
  4906. if SETTINGS.PERCENT_COLOURS then
  4907. DoGauge2 (GaugeWin, "HP ", percenthp / 100, ColourFromPercentage(percenthp, COLOURS.HPHIGH,COLOURS.HPMED,COLOURS.HPLOW), mushvar.hp .. " / " .. mushvar.maxhp, "HPhs", nil)
  4908. DoGauge2 (GaugeWin, "GP ", percentgp / 100, ColourFromPercentage(percentgp, COLOURS.GPHIGH,COLOURS.GPMED,COLOURS.GPLOW), mushvar.gp .. "(".. mushvar.gpest .. ") / " .. mushvar.maxgp, "GPhs", percentgpest/100)
  4909. DoGauge2 (GaugeWin, "B ", percentburden / 100, ColourFromPercentage(100-percentburden, COLOURS.BURDENHIGH,COLOURS.BURDENMED,COLOURS.BURDENLOW), mushvar.burden .. "% / 100%", "Burdenhs", nil)
  4910. else
  4911. DoGauge (GaugeWin, "HP ", percenthp / 100, COLOURS.HP, mushvar.hp .. " / " .. mushvar.maxhp, "HPhs", nil)
  4912. DoGauge (GaugeWin, "GP ", percentgp / 100, COLOURS.GP, mushvar.gp .. "(".. mushvar.gpest .. ") / " .. mushvar.maxgp, "GPhs", percentgpest/100)
  4913. DoGauge (GaugeWin, "B ", percentburden / 100, COLOURS.BURDEN, mushvar.burden .. "%", "Burdenhs", nil)
  4914. end
  4915.  
  4916. -- add hotspots
  4917. WindowAddHotspot(GaugeWin, "outline_colour_hotspot", -- hotspot name
  4918. 3, 5, INDENT-15, BUTTON_HEIGHT+5, -- rectangle
  4919. "mouseover",
  4920. "cancelmouseover",
  4921. "mousedown",
  4922. "cancelmousedown",
  4923. "mouseup",
  4924. "Change Outline Colour", -- tooltip text
  4925. 1, 0) -- hand cursor
  4926.  
  4927. WindowAddHotspot(GaugeWin, "text_colour_hotspot", -- hotspot name
  4928. INDENT-12, 5, INDENT+5, 61, -- rectangle
  4929. "mouseover",
  4930. "cancelmouseover",
  4931. "mousedown",
  4932. "cancelmousedown",
  4933. "mouseup",
  4934. "Change Text Colour", -- tooltip text
  4935. 1, 0) -- hand cursor
  4936.  
  4937. WindowAddHotspot(GaugeWin, "background_colour_hotspot", -- hotspot name
  4938. INDENT+10, 5, INDENT+25, 61, -- rectangle
  4939. "mouseover",
  4940. "cancelmouseover",
  4941. "mousedown",
  4942. "cancelmousedown",
  4943. "mouseup",
  4944. "Change Background Colour", -- tooltip text
  4945. 1, 0) -- hand cursor
  4946.  
  4947. WindowShow (GaugeWin, true)
  4948. end -- hitcount
  4949.  
  4950. function RedrawAll()
  4951. -- make sure they're all called in a plugin..
  4952. if WindowInfo(MapWin, 5) then
  4953. CallPlugin(pluginid, "Display_Map", "")
  4954. end
  4955. CallPlugin(pluginid, "DrawGauges", "")
  4956. CallPlugin(pluginid, "DoPrompt", "")
  4957. end -- RedrawAll
  4958.  
  4959. -------------------------------------------------------------------------------------------
  4960. -- Hot spot behaviour
  4961. -------------------------------------------------------------------------------------------
  4962. function mouseup (flags, hotspotid)
  4963. -- Timer reset hot spot
  4964. if hotspotid == "XPhs" then
  4965. TimerToZero ()
  4966. return 0 -- needed for some languages
  4967. end -- XPhs if
  4968.  
  4969. -- show xp tab hot spot
  4970. if hotspotid == "XPTABhs" then
  4971. TAB_SHOW = 1
  4972. CompleteSet ()
  4973. return 0 -- needed for some languages
  4974. end -- XPTABhs if
  4975.  
  4976. -- show tab2 hot spot
  4977. if hotspotid == "Off_TABhs" then
  4978. TAB_SHOW = 2
  4979. CompleteSet ()
  4980. return 0 -- needed for some languages
  4981. end -- tab2 hs if
  4982.  
  4983. -- show tab3 hot spot
  4984. if hotspotid == "Def_TABhs" then
  4985. TAB_SHOW = 3
  4986. CompleteSet ()
  4987. return 0 -- needed for some languages
  4988. end -- tab3 hs if
  4989.  
  4990. -- show tab4 hot spot
  4991. if hotspotid == "Grp_TABhs" then
  4992. TAB_SHOW = 4
  4993. CompleteSet ()
  4994. return 0 -- needed for some languages
  4995. end -- tab4 hs if
  4996.  
  4997. -- reset xp rate hot spot
  4998. if hotspotid == "XPRatehs" then
  4999. TimerToZero ()
  5000. return 0 -- needed for some languages
  5001. end -- tab4 hs if
  5002.  
  5003. -- reset xp graph hot spot
  5004. if hotspotid == "XPGraphhs" then
  5005. StartUp ()
  5006. grab_time ()
  5007. CompleteSet()
  5008. return 0 -- needed for some languages
  5009. end -- tab4 hs if
  5010.  
  5011. -- reset combat stats hot spot
  5012. if hotspotid == "Combaths" then
  5013. StatsToZero ()
  5014. CompleteSet()
  5015. return 0 -- needed for some languages
  5016. end -- tab4 hs if
  5017.  
  5018. -- update stats hot spot
  5019. if hotspotid == "Grouphs" then
  5020. UpdateGroup ()
  5021. CompleteSet()
  5022. return 0 -- needed for some languages
  5023. end -- tab4 hs if
  5024.  
  5025. -- reset stats hot spot
  5026. if hotspotid == "Groupreseths" then
  5027. ResetGroup ()
  5028. CompleteSet()
  5029. return 0 -- needed for some languages
  5030. end -- tab4 hs if
  5031.  
  5032.  
  5033. -- Colour hot spots
  5034. if hotspotid == "background_colour_hotspot" then
  5035. local new_colour = PickColour (COLOURS.BACKGROUND)
  5036. if new_colour ~= -1 then
  5037. COLOURS.BACKGROUND = new_colour
  5038. RedrawAll() -- redraw
  5039. end -- new colour
  5040. return 0 -- needed for some languages
  5041. end -- colour_hotspot if
  5042.  
  5043. if hotspotid == "outline_colour_hotspot" then
  5044. local new_colour = PickColour (COLOURS.OUTLINE)
  5045. if new_colour ~= -1 then
  5046. COLOURS.OUTLINE = new_colour
  5047. RedrawAll() -- redraw
  5048. end -- new colour
  5049. return 0 -- needed for some languages
  5050. end -- colour_hotspot if
  5051.  
  5052. if hotspotid == "text_colour_hotspot" then
  5053. local new_colour = PickColour (COLOURS.TEXT)
  5054. if new_colour ~= -1 then
  5055. COLOURS.TEXT = new_colour
  5056. RedrawAll() -- redraw
  5057. end -- new colour
  5058. return 0 -- needed for some languages
  5059. end -- colour_hotspot if
  5060.  
  5061. if hotspotid == "HPhs" then
  5062. local new_colour = PickColour (COLOURS.HP)
  5063. if new_colour ~= -1 then
  5064. COLOURS.HP = new_colour
  5065. RedrawAll() -- redraw
  5066. end -- new colour
  5067. return 0 -- needed for some languages
  5068. end -- colour_hotspot if
  5069.  
  5070. if hotspotid == "GPhs" then
  5071. local new_colour = PickColour (COLOURS.GP)
  5072. if new_colour ~= -1 then
  5073. COLOURS.GP = new_colour
  5074. RedrawAll() -- redraw
  5075. end -- new colour
  5076. return 0 -- needed for some languages
  5077. end -- colour_hotspot if
  5078.  
  5079. if hotspotid == "Burdenhs" then
  5080. local new_colour = PickColour (COLOURS.BURDEN)
  5081. if new_colour ~= -1 then
  5082. COLOURS.BURDEN = new_colour
  5083. RedrawAll() -- redraw
  5084. end -- new colour
  5085. return 0 -- needed for some languages
  5086. end -- colour_hotspot if
  5087.  
  5088. if hotspotid == "HPhshigh" then
  5089. local new_colour = PickColour (COLOURS.HPHIGH)
  5090. if new_colour ~= -1 then
  5091. COLOURS.HPHIGH = new_colour
  5092. RedrawAll() -- redraw
  5093. end -- new colour
  5094. return 0 -- needed for some languages
  5095. end -- colour_hotspot if
  5096. if hotspotid == "HPhsmed" then
  5097. local new_colour = PickColour (COLOURS.HPMED)
  5098. if new_colour ~= -1 then
  5099. COLOURS.HPMED = new_colour
  5100. RedrawAll() -- redraw
  5101. end -- new colour
  5102. return 0 -- needed for some languages
  5103. end -- colour_hotspot if
  5104. if hotspotid == "HPhslow" then
  5105. local new_colour = PickColour (COLOURS.HPLOW)
  5106. if new_colour ~= -1 then
  5107. COLOURS.HPLOW = new_colour
  5108. RedrawAll() -- redraw
  5109. end -- new colour
  5110. return 0 -- needed for some languages
  5111. end -- colour_hotspot if
  5112.  
  5113. if hotspotid == "GPhshigh" then
  5114. local new_colour = PickColour (COLOURS.GPHIGH)
  5115. if new_colour ~= -1 then
  5116. COLOURS.GPHIGH = new_colour
  5117. RedrawAll() -- redraw
  5118. end -- new colour
  5119. return 0 -- needed for some languages
  5120. end -- colour_hotspot if
  5121. if hotspotid == "GPhsmed" then
  5122. local new_colour = PickColour (COLOURS.GPMED)
  5123. if new_colour ~= -1 then
  5124. COLOURS.GPMED = new_colour
  5125. RedrawAll() -- redraw
  5126. end -- new colour
  5127. return 0 -- needed for some languages
  5128. end -- colour_hotspot if
  5129.  
  5130. if hotspotid == "GPhslow" then
  5131. local new_colour = PickColour (COLOURS.GPLOW)
  5132. if new_colour ~= -1 then
  5133. COLOURS.GPLOW = new_colour
  5134. RedrawAll() -- redraw
  5135. end -- new colour
  5136. return 0 -- needed for some languages
  5137. end -- colour_hotspot if
  5138.  
  5139. if hotspotid == "Burdenhshigh" then
  5140. local new_colour = PickColour (COLOURS.BURDENHIGH)
  5141. if new_colour ~= -1 then
  5142. COLOURS.BURDENHIGH = new_colour
  5143. RedrawAll() -- redraw
  5144. end -- new colour
  5145. return 0 -- needed for some languages
  5146. end -- colour_hotspot if
  5147. if hotspotid == "Burdenhsmed" then
  5148. local new_colour = PickColour (COLOURS.BURDENMED)
  5149. if new_colour ~= -1 then
  5150. COLOURS.BURDENMED = new_colour
  5151. RedrawAll() -- redraw
  5152. end -- new colour
  5153. return 0 -- needed for some languages
  5154. end -- colour_hotspot if
  5155. if hotspotid == "Burdenhslow" then
  5156. local new_colour = PickColour (COLOURS.BURDENLOW)
  5157. if new_colour ~= -1 then
  5158. COLOURS.BURDENLOW = new_colour
  5159. RedrawAll() -- redraw
  5160. end -- new colour
  5161. return 0 -- needed for some languages
  5162. end -- colour_hotspot if
  5163.  
  5164.  
  5165.  
  5166.  
  5167. if hotspotid == "OHitshs" then
  5168. local new_colour = PickColour (COLOURS.OHITS)
  5169. if new_colour ~= -1 then
  5170. COLOURS.OHITS = new_colour
  5171. end -- new colour
  5172. return 0 -- needed for some languages
  5173. end -- colour_hotspot if
  5174.  
  5175. if hotspotid == "OSpecialshs" then
  5176. local new_colour = PickColour (COLOURS.OSPECIALS)
  5177. if new_colour ~= -1 then
  5178. COLOURS.OSPECIALS = new_colour
  5179. end -- new colour
  5180. return 0 -- needed for some languages
  5181. end -- colour_hotspot if
  5182.  
  5183. if hotspotid == "DParryhs" then
  5184. local new_colour = PickColour (COLOURS.DPARRY)
  5185. if new_colour ~= -1 then
  5186. COLOURS.DPARRY = new_colour
  5187. end -- new colour
  5188. return 0 -- needed for some languages
  5189. end -- colour_hotspot if
  5190.  
  5191. if hotspotid == "DDodgehs" then
  5192. local new_colour = PickColour (COLOURS.DDODGE)
  5193. if new_colour ~= -1 then
  5194. COLOURS.DDODGE = new_colour
  5195. end -- new colour
  5196. return 0 -- needed for some languages
  5197. end -- colour_hotspot if
  5198.  
  5199. if hotspotid == "DBlockedhs" then
  5200. local new_colour = PickColour (COLOURS.DBLOCK)
  5201. if new_colour ~= -1 then
  5202. COLOURS.DBLOCK = new_colour
  5203. end -- new colour
  5204. return 0 -- needed for some languages
  5205. end -- colour_hotspot if
  5206.  
  5207. if hotspotid == "DShieldshs" then
  5208. local new_colour = PickColour (COLOURS.DSHIELD)
  5209. if new_colour ~= -1 then
  5210. COLOURS.DSHIELD = new_colour
  5211. end -- new colour
  5212. return 0 -- needed for some languages
  5213. end -- colour_hotspot if
  5214.  
  5215. if hotspotid == "DHitshs" then
  5216. local new_colour = PickColour (COLOURS.DHITS)
  5217. if new_colour ~= -1 then
  5218. COLOURS.DHITS = new_colour
  5219. end -- new colour
  5220. return 0 -- needed for some languages
  5221. end -- colour_hotspot if
  5222. end -- mouseup
  5223.  
  5224. function mouseover (flags, hotspotid)
  5225. -- show map legend hot spot
  5226. if hotspotid == "legend_hotspot" then
  5227.  
  5228. -- what to say - one line per table entry, with imbedded colour codes
  5229.  
  5230. info = {
  5231. "@WRoom contents:@w",
  5232. "",
  5233. " @Y@@@w Where you are / Northeast-southwest exit ",
  5234. " @c*@w Room | North-south exit",
  5235. " @G$@w Room with living things - East-west exit",
  5236. " @r$@w Room with living things \\ Northwest-southeast exit ",
  5237. " in combat x Cross over exits",
  5238. " @G&@w Room with living things ^ Up exit",
  5239. " and non-cardinal exits v Down exit",
  5240. " @r+@w Door ",
  5241. " ",
  5242. "",
  5243. "@WTerrains:@w",
  5244. "",
  5245. " @Y@@@w Where you are . Plains ",
  5246. " @w@@@w Terrain with living things c Cabbage fields ",
  5247. " @r@@@w Road with living things @gf@w Forest ",
  5248. " @r#@w Road @c~@w River / Water ",
  5249. " @b*@w Town / City @wb@w Beach ",
  5250. " ^ Mountains @ge@w Evergreen forest",
  5251. ""
  5252.  
  5253. }
  5254.  
  5255. -- work out coordinates
  5256. local top = WindowInfo (XPWin, 11)
  5257. local left = WindowInfo (XPWin, 10) + bar_width
  5258.  
  5259. heading = ""
  5260. if mushvar.bar_position == "1" then
  5261. align_right = false
  5262. else
  5263. align_right = true
  5264. left = WindowInfo (XPWin, 10)
  5265. end
  5266. align_bottom = false
  5267. capitalize = false
  5268.  
  5269. -- show it
  5270. mw.popup (infowin, -- window name to use
  5271. heading_font_id, -- font to use for the heading
  5272. popup_font_id, -- font to use for each line
  5273. heading, -- heading text
  5274. info, -- table of lines to show (with colour codes)
  5275. left, top, -- where to put it
  5276. border_colour, -- colour for round rectangle line
  5277. background_colour, -- colour for background
  5278. capitalize, -- if true, force the first letter to upper case
  5279. align_right, -- if true, align right side on "Left" parameter
  5280. align_bottom) -- if true, align bottom side on "Top" parameter
  5281. end -- if
  5282. end -- mouseover
  5283.  
  5284. function cancelmouseover (flags, hotspotid)
  5285. WindowShow (infowin, false)
  5286. end -- cancelmouseover
  5287.  
  5288. -------------------------------------------------------------------------------------------
  5289. -- Installation setup
  5290. -------------------------------------------------------------------------------------------
  5291. function OnPluginInstall ()
  5292. StartUp()
  5293.  
  5294. ArrayCreate ("group")
  5295. ArrayCreate ("numbers")
  5296.  
  5297. -- Load saved tables
  5298. assert (loadstring (GetVariable ("COLOURS") or "")) ()
  5299. assert (loadstring (GetVariable ("TRIGCOL") or "")) ()
  5300. assert (loadstring (GetVariable ("SETTINGS") or "")) ()
  5301.  
  5302. -- setup window id's
  5303. XPWin = GetPluginID () .. "1"
  5304. MapWin = GetPluginID () .. "2"
  5305. GaugeWin = GetPluginID () .. "3"
  5306.  
  5307. pluginid = GetPluginID()
  5308.  
  5309. -- setup fonts
  5310. font_id = "f"
  5311. font_size = 10
  5312. font_name = "Arial" -- the actual font
  5313.  
  5314. font_id2 = "f2"
  5315. font_size2 = 8
  5316. font_name2 = "Arial" -- the actual font
  5317.  
  5318. map_font_name = "Courier New" -- the actual font
  5319. map_font_size = 10
  5320. map_font_id = "map_font" -- our internal name
  5321.  
  5322. map_title_font_name = "Arial" -- the actual font for Map title
  5323. map_title_font_size = 8
  5324. map_title_font_id = "map_font_title" -- our internal name for Map title
  5325.  
  5326. -- make windows so I can grab the font info
  5327. WindowCreate (XPWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
  5328. WindowCreate (MapWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
  5329. WindowCreate (GaugeWin, 0, 0, 1, 1, 1, 0, 0) -- 1x1 pixel window, position irrelevant
  5330.  
  5331. -- get font info
  5332. check (WindowFont (XPWin, font_id, font_name, font_size)) -- normal
  5333.  
  5334. font_height = WindowFontInfo (XPWin, font_id, 1) -- height
  5335. font_width = WindowFontInfo (XPWin, font_id, 6) -- avg width
  5336.  
  5337. check (WindowFont (MapWin, map_font_id, map_font_name, map_font_size, false, false, false, false, 0, 49)) -- normal
  5338. check (WindowFont (MapWin, map_title_font_id, map_title_font_name, map_title_font_size, false, false, false, false, 0, 49)) -- normal
  5339. check (WindowFont (XPWin, font_id2, font_name2, font_size2)) -- normal
  5340. map_font_height = WindowFontInfo (MapWin, map_font_id, 1) -- height
  5341. map_font_width = WindowFontInfo (MapWin, map_font_id, 6) -- avg width
  5342.  
  5343. --GaugeWin = GetPluginID () .. "3"
  5344. --WindowCreate (GaugeWin, 0, 0, 1, 1, mushvar.barpos, 0, COLOURS.BACKGROUND)
  5345. check (WindowFont (GaugeWin, "f2", "Arial", 9, false, false, false, false))
  5346. --txt_height = WindowFontInfo (GaugeWin, "font", 1) -- height of the font (46)
  5347. --DrawGauges ()
  5348. --WindowShow (GaugeWin, true)
  5349.  
  5350. -- a unique ID
  5351. infowin = GetPluginID () .. ":info"
  5352.  
  5353. -- font IDs
  5354. popup_font_id = "popup_font"
  5355. heading_font_id = "popup_heading_font"
  5356.  
  5357. -- load fonts - mouseover window
  5358. WindowCreate (infowin, 0, 0, 1, 1, 1, 0, 0) -- make 1-pixel wide window
  5359.  
  5360. -- install the fonts (49 is modern / fixed pitch)
  5361. WindowFont (infowin, popup_font_id, map_font_name, font_size, false, false, false, false, 0, 49)
  5362. WindowFont (infowin, heading_font_id, map_font_name, font_size + 2, false, false, false, false, 0, 49)
  5363.  
  5364. EnsureSize()
  5365.  
  5366. -- install trigger colours
  5367. settriggercolours ()
  5368.  
  5369. DoAfterSpecial (58, "XPMath()", sendto.script)
  5370.  
  5371. end -- OnPluginInstall
  5372.  
  5373. -------------------------------------------------------------------------------------------
  5374. -- Show and hide windows on enable and disable
  5375. -------------------------------------------------------------------------------------------
  5376. function OnPluginEnable ()
  5377. ArrayCreate ("group")
  5378. ArrayCreate ("numbers")
  5379.  
  5380. EnsureSize()
  5381.  
  5382. -- install trigger colours
  5383. settriggercolours ()
  5384.  
  5385. -- ensure gpding works in the background
  5386. SetOption ("play_sounds_in_background", 1)
  5387.  
  5388. WindowShow (XPWin, true)
  5389. WindowShow (MapWin, true)
  5390. WindowShow (GaugeWin, true) --gauges.name, true
  5391. end -- OnPluginEnable
  5392.  
  5393. function OnPluginDisable ()
  5394. WindowShow (XPWin, false)
  5395. WindowShow (MapWin, false)
  5396. WindowShow (GaugeWin, false)
  5397. WindowShow (infowin, false)
  5398. TextRectangle (0, 0, 0, 0, 0, 0x000000, 0, 0x000000, 0) -- Push text back to normal
  5399. end -- OnPluginDisable
  5400.  
  5401. function OnPluginClose ()
  5402. WindowShow (XPWin, false)
  5403. WindowShow (MapWin, false)
  5404. WindowShow (GaugeWin, false)
  5405. WindowShow (infowin, false)
  5406. TextRectangle (0, 0, 0, 0, 0, 0x000000, 0, 0x000000, 0) -- Push text back to normal
  5407.  
  5408. -- Properly clear up after ourselves
  5409. WindowDelete (XPWin)
  5410. WindowDelete (MapWin)
  5411. WindowDelete (GaugeWin)
  5412. WindowDelete (infowin)
  5413.  
  5414. end -- OnPluginClose
  5415.  
  5416. function SidebarConfig()
  5417. Send ("options output prompt=off")
  5418. Send ("options output look=verbose")
  5419. Send ("options output shortinlong=on")
  5420. Send ("options output map look=top")
  5421. Send ("options output map lookcity=top")
  5422. Send ("options output map glance=tagged")
  5423. Send ("options output map glancecity=tagged")
  5424. Send ("options output map reversecolour=off")
  5425. Send ("options output map written=off")
  5426. Send ("options output map mxp=off")
  5427. end
  5428.  
  5429. function print_help()
  5430. Note([[Plugin Help: Sidebar++
  5431.  
  5432. 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.
  5433.  
  5434. The following information may be useful:
  5435.  
  5436. * reportxp Sends a 'group say' to the mud reporting on XP information.
  5437. * resetxp Resets the XP counter (This is the same as clicking the "Reset" button).
  5438. * resetstats Resets the combat stats.
  5439. * reportstats Sends a 'group say' to the mud reporting the combat stats.
  5440. * reportkills Sends a 'group say' to the mud reporting the kill counters for the group.
  5441. * showkills Displays the kill counters for the group without reporting them.
  5442. * groupreset Resets and refreshes the grouping details, including shields.
  5443. * groupupdate Requests an update to the group details (sends 'group status brief' and 'group shields' to the mud).
  5444. * groupjointoggle Toggles addition of a 'groupreset' on sending 'group join *' (default: on).
  5445. * triggercolours Toggles colour triggering.
  5446. * hidelookmap Toggles hiding of the look map and glance.
  5447. * hidecombatspam Toggles between greying out, hiding, and no effect on verbose combat messages.
  5448. * showhitcolours Toggles colouring of hits by damage.
  5449. * fixedbarcolours Toggles proportional or fixed colouring of HP/GP/B bars.
  5450. * xpdetailplot Toggles green xp details plot.
  5451. * xpdetailplot(x) Enables green xp details plot with moving averaging period of x minutes (default 5).
  5452. * gpregenrate(x) Sets sidebar to use x (between 1 and 4) for the gp regen rate for its tick-up estimate (default 3).
  5453. * sidebarleft Show sidebar on the left.
  5454. * sidebarright Show sidebar on the right.
  5455. * doublewin Toggle double-height tabbed window, showing group details (tab 4) as well as one other choice.
  5456. * doublewin(x) Set double-height tabbed window, showing tab number x as well as one other choice (default 4).
  5457. * gpding Toggle 'ding' on reaching GP max.
  5458. * gpding(file) Enable playing specified sound file on reaching GP max (default: C:\Windows\Media\ding.wav).
  5459. * showmxpdebug Toggle display of MXP debug messages. Can potentially be interesting/useful.
  5460. * help sidebar Displays this help file.
  5461. * sidebar_config Will automatically implement all the recommended MUD settings below.
  5462.  
  5463. Trigger colours for shields can now be configured using one of:
  5464. * settriggercolour(<what><who>, <custom_colour_number (0 turns off colouring, 17 is custom)>)
  5465. * settriggercolour(<what><who>, <foreground name>, <background name (defaults to black if not given)>)
  5466. * settriggercolour(<what><who>) Resets the given item to its default colours
  5467. * showtriggercolours Displays current colour list
  5468.  
  5469. Where <what> takes values:
  5470. up - shields up
  5471. dn - shields down
  5472. wk - shields getting weaker (for 'me' only)
  5473. go - shields going, shown by getting hit
  5474. ht - any combat hit (for 'me' only)
  5475. And <who> takes values:
  5476. me - your player
  5477. ot - others in the group
  5478.  
  5479.  
  5480. The following mud settings should be used for this plugin to function correctly:
  5481.  
  5482. * options output prompt=off
  5483. * options output look=verbose
  5484. * options output shortinlong=on
  5485. * options output map look=top
  5486. * options output map lookcity=top
  5487. * options output map glance=tagged
  5488. * options output map glancecity=tagged
  5489. * options output map reversecolour=off
  5490. * options output map written=off
  5491. * options output map mxp=off
  5492. ]])
  5493. end
  5494.  
  5495. -------------------------------------------------------------------------------------------
  5496. -- on saving state, convert Lua table back into string variable save_simple is for simple
  5497. -- tables that do not have cycles (self-reference) or refer to other tables
  5498. -------------------------------------------------------------------------------------------
  5499. function OnPluginSaveState ()
  5500. SetVariable ("COLOURS", "COLOURS = " .. serialize.save_simple (COLOURS))
  5501. SetVariable ("TRIGCOL", "TRIGCOL = " .. serialize.save_simple (TRIGCOL))
  5502. SetVariable ("SETTINGS", "SETTINGS = " .. serialize.save_simple (SETTINGS))
  5503. end -- function OnPluginSaveState
  5504.  
  5505. function OnWorldSave ()
  5506. SetVariable ("COLOURS", "COLOURS = " .. serialize.save_simple (COLOURS))
  5507. SetVariable ("TRIGCOL", "TRIGCOL = " .. serialize.save_simple (TRIGCOL))
  5508. SetVariable ("SETTINGS", "SETTINGS = " .. serialize.save_simple (SETTINGS))
  5509. end -- function
  5510.  
  5511. function OnPluginWorldOutputResized ()
  5512. CallPlugin(pluginid, "EnsureSize", "")
  5513. end -- function
  5514.  
  5515. function OnPluginSend(stext)
  5516. -- check if stext is 'group join <x>'
  5517. if SETTINGS.GROUPJOIN and (string.match(stext,"^ *group *join *.+") ~= nil or string.match(stext,"^ *group *create *.+") ~= nil) then
  5518. -- matched
  5519. Send(stext)
  5520. ResetGroup()
  5521. return false
  5522. end
  5523.  
  5524. return true
  5525. end
  5526.  
  5527. ]]>
  5528. </script>
  5529.  
  5530. </muclient>
Add Comment
Please, Sign In to add comment