"Beginning installation of lib-connects... @prog lib-connects 1 99999 d 1 i ( lib-connects: $Date: 2000/01/11 15:36:15 $ $Revision: 1.2 $ ) ( Originally from the Glowmuck MUF distribution ) ( --------------------------------------------------------------------------- ) ( firstconn d -- i Returns d's first connection number ) ( findconn a d -- i Using function at address a for comparison, ) ( finds the connection meeting that criteria ) ( lastconn d -- i Returns d's last connection number ) ( leastidle d -- i Returns d's least idle connection ) ( mostidle d -- i Returns d's most idle connection ) ( --------------------------------------------------------------------------- ) ( $Log: lib-connects,v $ Revision 1.2 2000/01/11 15:36:15 feaelin Added documentation. Revision 1.1 1998/08/23 16:48:30 glow Initial revision ) ( --------------------------------------------------------------------------- ) : findconn (a d -- i) 0 swap concount begin dup while dup condbref 3 pick dbcmp if 3 pick if 3 pick over 6 pick execute if dup 3 put then else dup 3 put then then 1 - repeat pop pop swap pop ; : leastidle-comp conidle swap conidle < ; : leastidle (returns the number of the least idle connection for the given player) 'leastidle-comp swap findconn ; : mostidle-comp conidle swap conidle > ; : mostidle (returns the number of the most idle connection for the given player) 'mostidle-comp swap findconn ; : firstconn (d -- i) 1 begin dup concount <= while dup condbref 3 pick dbcmp if swap pop exit then 1 + repeat pop pop 0 ; : lastconn (d -- i) concount begin dup while dup condbref 3 pick dbcmp if swap pop exit then 1 - repeat pop pop 0 ; public findconn public leastidle public mostidle public firstconn public lastconn . c q @register lib-connects=cmd/look @register lib-connects=lib/connects @register #me lib-connects=tmp/prog1 @set $tmp/prog1=L @set $tmp/prog1=M3 @set $tmp/prog1=/_defs/conn-findconn:"$lib/connects" match "findconn" call @set $tmp/prog1=/_defs/conn-firstconn:"$lib/connects" match "firstconn" call @set $tmp/prog1=/_defs/conn-lastconn:"$lib/connects" match "lastconn" call @set $tmp/prog1=/_defs/conn-leastidle:"$lib/connects" match "leastidle" call @set $tmp/prog1=/_defs/conn-mostidle:"$lib/connects" match "mostidle" call @set $tmp/prog1=/_/de:lib-connects: @list $lib/connects=1-10 for documentation. @set $tmp/prog1=/_docs:@list $lib/connects=1-10 @set $tmp/prog1=/_lib-version:FM$Revision: 1.2 $ "Installation of lib-connects completed.