Alternate Vein Color Match

From Gwen Morse's Wiki
Jump to: navigation, search

This only hilights the line with the vein color and shade. Substitute it for vein_color in the /Note collection.

;;;
;;; If you want 256 color highlighting available and your terminal
;;; supports it, set /COLORS to 256
;;; 
; /set COLORS=256

;;; Set the color and shade of the vein.

;;; highlight the vein the color of the crystal found within.
/def -T"tiny.mush.cm" -F -mregexp -t"You catch a sparkling glimmer of (very pale|pale|light|medium|deep|rich deep|pure) (rose|blue|green|yellow|black|white|amethyst)" vein_color = \
  /set VEIN_SHADE=%P1%;\
  /set VEIN_COLOR=%P2%;\
  /set VEIN_COLORSHADE=%P1 %P2%;\
  /if ({COLORS} != "256") \
;    /echo 16 colors %;\
    /if ({VEIN_COLOR} =/ "rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Cred}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Cblue}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "green") \
      /test substitute(decode_attr(strcat({PL}, "@{Cgreen}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Cmagenta}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Cyellow}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "white") \
      /test substitute(decode_attr(strcat({PL}, "@{BCwhite}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLOR} =/ "black") \
      /test substitute(decode_attr(strcat({PL}, "@{BCblack}", {P0}, "@{n}", {PR})))%;\
    /endif%;\
  /elseif ({COLORS} == "256")\
;    /echo 256 colors %;\
    /if ({VEIN_COLORSHADE} =/ "pure black") \
      /test substitute(decode_attr(strcat({PL}, "@{BCblack}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "pure white") \
      /test substitute(decode_attr(strcat({PL}, "@{BCwhite}", {P0}, "@{n}", {PR})))%;\
;@@;%;\
    /elseif ({VEIN_COLORSHADE} =/ "very pale rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb545}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "pale rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb535}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "light rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb535}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "medium rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb525}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "deep rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb515}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "rich deep rose") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb505}", {P0}, "@{n}", {PR})))%;\
;@@;%;\
    /elseif ({VEIN_COLORSHADE} =/ "very pale amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb345}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "pale amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb335}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "light amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb335}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "medium amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb325}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "deep amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb315}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "rich deep amethyst") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb305}", {P0}, "@{n}", {PR})))%;\
;@@;%;\
    /elseif ({VEIN_COLORSHADE} =/ "very pale green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb150}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "pale green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb050}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "light green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb040}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "medium green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb030}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "deep green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb020}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "rich deep green") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb010}", {P0}, "@{n}", {PR})))%;\
;@@;%;\
    /elseif ({VEIN_COLORSHADE} =/ "very pale blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb045}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "pale blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb035}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "light blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb035}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "medium blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb025}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "deep blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb015}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "rich deep blue") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb005}", {P0}, "@{n}", {PR})))%;\
;@@;%;\
    /elseif ({VEIN_COLORSHADE} =/ "very pale yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb554}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "pale yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb553}", {P0}, "@{n}", {PR})))%;\
     /elseif ({VEIN_COLORSHADE} =/ "light yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb553}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "medium yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb552}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "deep yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb551}", {P0}, "@{n}", {PR})))%;\
    /elseif ({VEIN_COLORSHADE} =/ "rich deep yellow") \
      /test substitute(decode_attr(strcat({PL}, "@{Crgb550}", {P0}, "@{n}", {PR})))%;\
    /endif%;\
  /endif