/def -F -mregexp -t'^Your falcon reports seeing the following people in its area:$' t_falcon_observe_on = \ /set v_falco=1 %; \ /def -F -mregexp -agL -t'^(\w+)\s+(\d+) health out of (\d+)\.$' t_falcon_observe_get = \ /eval /set v_falco_%{P1}_health=%{P2} %; \ /eval /set v_falco_%{P1}_max=%{P3} %; \ /def -E(v_falco=1) -Fp999 -hPROMPT t_falcon_observe_off = \ /unset v_falco %; \ /quote -S /show_falco `"/listvar -s -mregexp v_falco_[^_]+_health" %; \ /quote -S /unset `"/listvar -s v_falco_*" %; \ /def show_falco = \ /let falco_name=$[replace("_health","",replace("v_falco_","",{1}))] %; \ /let falco_health= %; \ /let falco_max= %; \ /let falco_color=red %; \ /let falco_target= %; \ /eval /test falco_health := v_falco_%{falco_name}_health %; \ /eval /test falco_max := v_falco_%{falco_name}_max %; \ /if (falco_health * 1.0 / falco_max > 0.7) \ /let falco_color=green %; \ /elseif (falco_health * 1.0 / falco_max > 0.4) \ /let falco_color=yellow %; \ /endif %; \ /if (tolower(falco_name) =~ tolower(target)) \ /let falco_target=B %; \ /endif %; \ /eval /echo -p @{n%{falco_target}Cwhite}$[pad(falco_name, -18)] @{n%{falco_target}C%falco_color}$[pad(falco_health, 4)] @{n%{falco_target}Cwhite}/ @{n%{falco_target}Cgreen}$[pad(falco_max, 4)] %; \