: timefmt ( i -- s ) "" over 86400 / dup intostr "d " strcat rot pop swap 86400 * rot swap - swap over 3600 / dup if dup intostr ":" strcat dup strlen 2 = if "0" swap strcat then rot swap strcat swap 3600 * rot swap - swap else pop "00:" strcat then over 60 / intostr dup strlen 1 = if "0" swap strcat then strcat swap dup 60 / 60 * - intostr dup strlen 1 = if "0" swap strcat then ":" swap strcat strcat ; : idlefmt ( i -- s ) dup 3600 / dup if swap pop intostr "h" strcat exit else pop then dup 60 / dup if swap pop intostr "m" strcat exit else pop then intostr "s" strcat ; : say ( s -- ) me @ int? if me @ swap connotify else me @ swap notify then ; : level ( d -- i ) dup int? if pop 0 else "@level" getpropstr atoi then ; : extended? ( -- i ) me @ int? if 0 else me @ "Q" flag? me @ level 7 < or not then ; : header ( -- s ) extended? if "Appellation Skill Where" " Dsc Conscious Idle Host" strcat else "Appellation Skill" " Dsc Conscious Idle" strcat then ; : divider ( -- s ) extended? if "--------------------------- ----- ------" " --- ------------ ---- ---------------" strcat else "--------------------------- -----" " --- ------------ ----" strcat then ; : noncon_string ( -- s ) extended? if " (New Arrival) -1" " -1 " strcat else " (New Arrival) -1" then ; : main header say divider say connections begin dup while dup 1 + pick condbref not if noncon_string else dup 1 + pick condbref dup name " " strcat over "_title" getpropstr strcat dup strlen 24 > if 25 strcut pop else " " over strlen strcut swap pop strcat then over "I" flag? if "+" else " " then swap strcat over "U" flag? if "*" else " " then swap strcat " " strcat " " 3 pick "B" flag? if pop "Build" then 3 pick "M" flag? if pop "Magic" then 3 pick "W" flag? if pop " Wiz " then strcat swap extended? if location intostr " " over strlen strcut swap pop swap strcat strcat else pop then over 2 + pick intostr " " over strlen strcut swap pop swap strcat strcat over 2 + pick contime timefmt " " over strlen strcut swap pop swap strcat strcat over 2 + pick conidle idlefmt " " over strlen strcut swap pop swap strcat strcat " " strcat then extended? if over 2 + pick conhost strcat then over 3 + pick "" strcmp not 3 pick 3 + pick condbref not and if say else over 2 + pick condbref if over 2 + pick condbref "U" flag? not me @ level 4 pick 4 + pick condbref level >= or 3 pick 3 + pick condbref name tolower 4 pick 5 + pick tolower dup strlen strncmp not 4 pick 5 + pick "" strcmp not or and if say else pop then else say then then dup 1 + rotate pop 1 - loop pop pop divider say concount "There is " over intostr strcat " conscious entity in the world." strcat swap 1 = not if "are" "is" subst "entities" "entity" subst then say ;