$include $lib/alynna $include $lib/rp $undef numactiveplayers : numactiveplayers[ d:room -- i:activeplayers ] 0 var! activeplayers #0 "Southern Cross" getprop if room @ "public?" envstat toint swap pop not if room @ "public" envstat toint swap pop not if 0 exit then then else room @ name "[OOC" instr if 0 exit then then room @ contents_array foreach var! target pop target @ player? not if continue then target @ awake? not if continue then target @ "~status" getprop "{ooc|afk|idl|bzy|dnd}" smatch if continue then target @ descrleastidle descridle 900 > if continue then activeplayers ++ repeat activeplayers @ ; PUBLIC numactiveplayers $libdef numactiveplayers : active?[ d:target -- i:active ] #0 "Southern Cross" getprop if target @ location "public?" envstat toint swap pop not if target @ location "public" envstat toint swap pop not if 0 exit then then else target @ location name "[OOC" instr if 0 exit then then target @ player? not if 0 exit then target @ awake? not if 0 exit then target @ "~status" getprop "{ooc|afk|idl|bzy|dnd}" smatch if 0 exit then target @ descrleastidle descridle 900 > if 0 exit then 1 ; : main "Finding rooms with at least 1 IC and active player" header tellme ( Unique list of rooms with people in them ) { online_array dup array_count var! numonline foreach swap pop var! target target @ location repeat }array dup array_union var! rooms ( List of rooms with people in them IC and active ) { rooms @ foreach swap pop dup numactiveplayers not if pop then repeat }array rooms ! ( reduce numonline to the top number of people in any room ) 0 var! toprooms rooms @ foreach swap pop dup numactiveplayers toprooms @ > if numactiveplayers toprooms ! else pop then repeat ( list toprooms from the max down to 1 ) toprooms @ 1 -1 for var! roomcount rooms @ foreach var! room pop room @ numactiveplayers roomcount @ != if continue then { "^CYAN^" roomcount @ tostr 3 rj " " "^YELLOW^" room @ name }tell { " " { { room @ contents_array foreach var! target pop target @ active? not if continue else target @ then repeat }array foreach swap pop ansi_name repeat }array array_commas }tell repeat repeat "+findrp v1.0" footer tellme ;