@program #3108 1 1000 d i $include $muf/rp/utils $include $lib/gary'smufutils-strings $include $lib/gary'smufutils-lists $include $lib/gary'smufutils-misc $include $muf/scrp/registry $include $lib/rp $define .tell .ansi_tell $enddef lvar target ! : actualHealth (d -- ) (Views the health bars for a specific target) target ! LINE target @ name 16 left strcat OPENITEM strcat "^BRED^" strcat target @ "hp" getstat intostr 5 right "/" strcat target @ maxhp intostr 5 right strcat "HP " swap strcat 50 left target @ "hp" getstat target @ RPlib.getMaxHP swap 100 * swap / dup rot swap intostr 3 right strcat "%" strcat swap 54 * 100 / dup 0 < if pop 0 then ansi_strcut "^BBLACK^" swap strcat strcat strcat CLOSEITEM strcat LINE strcat .tell (Views the health bars for a specific target) LINE " " 16 left strcat OPENITEM strcat "^BBLUE^" strcat target @ "MP" getstat intostr 5 right "/" strcat target @ MaxMP intostr 5 right strcat "MP " swap strcat 50 left target @ "MP" getstat target @ maxmp swap 100 * swap / dup rot swap intostr 3 right strcat "%" strcat swap 54 * 100 / dup 0 < if pop 0 then ansi_strcut "^BBLACK^" swap strcat strcat strcat CLOSEITEM strcat LINE strcat .tell (Views the health bars for a specific target) LINE " " 16 left strcat OPENITEM strcat "^BGREEN^" strcat target @ "TP" getstat intostr 5 right "/" strcat target @ maxtp intostr 5 right strcat "TP " swap strcat 50 left target @ "TP" getstat target @ maxtp swap 100 * swap / dup rot swap intostr 3 right strcat "%" strcat swap 54 * 100 / dup 0 < if pop 0 then ansi_strcut "^BBLACK^" swap strcat strcat strcat CLOSEITEM strcat LINE strcat .tell ; : doHealth (s -- ) (Steps through a list of targets) HEADER .tell "|" explode begin swap atoi dbref dup ok? if actualHealth else pop then 1 - dup not until pop FOOTER .tell "Use '+health #help' to find out more information about this command." sctell ; : collateRoom (d -- s) (Forms everyone in a room into a list) "" swap contents (TotalList LastObject) begin dup player? over "zombie" flag? OR if dup rplib.PC? over Smart_awake? AND if swap over intostr element_list_add swap then then next dup ok? not until pop ; : collateOnline ( -- s) (Forms everyone online into a list) online "" swap (I1..IN List I) begin rot dup rplib.PC? if rot swap intostr element_list_add swap else pop then 1 - dup not until pop ; : main (Work out list) dup "#help" instring if "Health viewer." .tell "Commands:" .tell "+health -- Check the health of people in the same room as you." .tell "+health -- Check the health of people in someone else's location." .tell "+health #online -- Check the health of everyone online." .tell exit then dup "" stringcmp not if (Persume this room) me @ location collateRoom doHealth exit then dup "#online" stringcmp not if collateOnline doHealth exit then verboseSmartMatch dup ok? if dup room? not if location then collateRoom doHealth then ; . c q