/visual on /set status_height=2 /set isize=2 /set status_pad= /status_add -r0 -c blanks::Cgray /status_add -r1 -c prompt_health:40:Cgreen /status_add -r1 prompt_mana:40:Cyellow /status_add -r1 prompt_balance:10:Ccyan /test blanks := strrep("-", 200) /if (!isvar('max_health')) /set max_health=5000 %; /endif /if (!isvar('max_mana')) /set max_mana=5000 %; /endif /def -F -mregexp -t"^Health: +([0-9]+) ?/ ?([0-9]+) +Mana: +([0-9]+) ?/ ?([0-9]+)" max_health = \ /set max_health=$[{P2}+0] %; \ /set max_mana=$[{P4}+0] %; /def -mregexp -Fp1000 -h"PROMPT ([0-9]+)h, ([0-9]+)m (.*)-" normal_prompt = \ ; uncomment the next line if you want to see the prompt in the message area ; /eval /echo %{*} %; \ ; uncomment the next line if you want to see the prompt where you type ; /test prompt({*}) %; \ /set health=%{P1} %; \ /set mana=%{P2} %; \ /set prompt_health=$[make_graph_prompt({P1}, {max_health})] %; \ /set prompt_mana=$[make_graph_prompt({P2}, {max_mana})] %; \ /set prompt_balance=$[strip_attr({P3})] %;\ /if ({P1} * 1.0 / {max_health} > 0.5) \ /eval /status_edit prompt_health:$[columns()/2-5]:Cgreen %; \ /elseif ({P1} * 1.0 / {max_health} > 0.25) \ /eval /status_edit prompt_health:$[columns()/2-5]:Cyellow %; \ /else \ /eval /status_edit prompt_health:$[columns()/2-5]:Cred %; \ /endif %; \ /eval /status_edit -r1 prompt_mana:$[columns()/2-5]:Cyellow %; \ /def make_graph_prompt = \ /let tlength=$[columns()/2-15] %; \ /let length=$[trunc(1.0 * {1} / {2} * tlength)] %; \ /let string=[ %; \ /test string := strcat(string, strrep("#",length-1)) %; \ /test string := strcat(string, strrep(":",tlength-length)) %; \ /test string := strcat(string, "] ", pad({1}, 4)) %; \ /result "%{string}"