@desc thing==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%r Purpose: To watch for players whom you want to know when they connect.%r%r Commands:%r%b%b+watchfor name%b%b%b%b%b%b%b%b%b%bWatches for name%r%b%b+watchnot name%b%b%b%b%b%b%b%b%b%bStops watching for name%r%b%b+watchlist%b%b%b%b%b%b%b%b%b%b%b%b%b%bShows you who you are watching for, and if they%r%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%b%bare connected or not.%r%r%b%bname%b%b%b%bThe name of a player to watch for.%r%r%b%bThanks to RavenBlack@TSC for supplying us with this code!%r%b%bModifications made by Pedersen@TSC.%r%r%b%bRemember to @set Connection Device=inherit and%r%b%b@set Connection Device=!halted%r=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
&ADDFRIEND thing=$+watchfor *:setq(0,switch(isdbref(%0),1,%0,0,num(*%0))); @switch isdbref(%q0)=1,{&friends %#=setunion(get(%#/friends),%q0);@pemit %#=name(%q0) added.},{@pemit %#=Not added. There's an error somewhere there. Perhaps it's not a player?}
&REMFRIEND thing=$+watchnot *:setq(0,switch(isdbref(%0),1,%0,0,num(*%0))); @switch and(isdbref(%q0),member(get(%#/FRIENDS),%q0))=0,{@pemit %#=No such player on your list.},{@pemit %#=name(%q0) removed.;&friends %#=remove(get(%#/friends),%q0)}
&LISTFRIENDS thing=$+watchlist:@switch get(%#/friends)=,{@pemit %#=You have an empty list.},{@pemit %#=[center(-=-=-=-> Watch List / Connection Status <-=-=-=-=-,75)]; @pemit %#=%b[iter(get(%#/friends),center(ljust(name(##),19) [switch(and(or(isstaff(%#),not(hasflag(##,DARK))),hasflag(##,CONNECTED)),1,rjust(Connected,14),rjust(Disconnected,14))],75)%r)]; @pemit %#=[center(-=-=-=-=-=-=-=-=-> End Watch <-=-=-=-=-=-=-=-=-=-=,75)]}
@Aconnect thing=@doiter lwho()=@switch and(or(u(fn_isstaff,##),not(hasflag(%#,DARK))),member(get(##/friends),%#),not(member (lcon(loc(##)),%#)))=1,@pemit ##= %N has connected.
@Adisconnect thing=@doiter lwho()=@switch and(or(u(fn_isstaff,##),not(hasflag(%#,DARK))),member(get(##/friends),%#),not(member (lcon(loc(##)),%#)))=1,@pemit ##= %N has disconnected.
&CREDITS thing=RavenBlack@The StoryTeller's Circle | Pedersen@TSC
&FN_ISSTAFF thing=[or(hasflag(%0,WIZARD),hasflag(%0,JUDGE))]
&SIMPLEHELPTEXT thing=[space(14)]-=-=-=-=-=-=-> Watcher Commands <-=-=-=-=-=-=-=%r%b%b+watchlist : Tells you who is already on your list of friends to watch for.%r%b%b+watchfor (name) : Adds (name) to your list.%r%b%b+watchnot (name) : Removes (name) from your list.%r[space(14)]=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=%rThe watcher produces " (name) has connected." on a friend connecting,%rand " (name) has disconnected." on a friend disconnecting.
               (
geocities.com/soho)