Crystal Dreams Waiting Cartons Hilight

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

This one is pretty simple. It highlights the last line of the description in the Sorting Shed by color (red/green) to signal whether there's sorting to be done.

/def -T"tiny.mush3.dream*" -p7 -mregexp -t"There are (\\d+) cartons here, waiting to be sorted\." cd_sort_highlight_cartons = \
  /set CARTON_NUMBER=%P1%;\
    /if ({CARTON_NUMBER} == "0") \
      /test substitute(decode_attr(strcat({PL}, "@{BCred}", {P0}, "@{n}", {PR})))%;\
    /elseif ({CARTON_NUMBER}  >= "1") \
      /test substitute(decode_attr(strcat({PL}, "@{BCgreen}", {P0}, "@{n}", {PR})))%;\
    /else \
      /echo TFRC: Broken match on the number of cartons in this room.%;\
    /endif