-
Notifications
You must be signed in to change notification settings - Fork 0
/
Watch System.txt
29 lines (17 loc) · 3.38 KB
/
Watch System.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
@skip isdbref(tag(setr(1,watch)))={@assert/inline isdbref(globalroom())=@pemit %#=ERROR: No master room set!;@assert/inline isdbref(setr(0,create(Watch System,,t)))=@pemit %#=ERROR: Could not create code object %q1: %q0;@set %q0=INDESTRUCTIBLE !NO_COMMAND;@tag/add %q1=%q0;@tel %q0=globalroom()}
@@ Commands and stuff.
&CMD.WATCH #watch=$^(?s)(?\:\+)(watch|friend)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach #inc/GET_SWITCH=%2;@attach %!/SW.[strfirstof(%q<switch>,MAIN)]=%3,%4
@set #watch/CMD.WATCH=regexp
&SWITCHES.0 #watch=WHO|ADD|ACCADD|REM|ACCREM
&FN.COLUMNS #watch=printf($-23s $16s,Name,LastOn/Idle)
&FN.ROW #watch=printf($-23s $16s,cname(%0),lastidle(%0))
&SW.MAIN #watch=@pemit %#=header(Watching Players);@pemit %#=ansi(confoverride(%#,COLUMN),u(FN.COLUMNS));@if cand(isdbref(setr(!,account(%#),acc)),words(setr(!,sortname(filterobjid(get(%q<acc>/WATCH))),accwatch))={@pemit %#=separator(Account Watching);@dolist/inline %q<accwatch>=@pemit %#=u(FN.ROW,%d0)};@if words(setr(!,sortname(filterobjid(get(%#/GAME.WATCH))),watch))={@pemit %#=separator(%n is Watching);@dolist/inline %q<watch>=@pemit %#=u(FN.ROW,%d0)};@pemit %#=footer()
&SW.WHO #watch=
&SW.ADD #watch=@attach #inc/GET_PLAYER=%0,target;@break/inline match(setr(!,filterobjid(get(%#/GAME.WATCH)),watch),%q<target>)=@pemit %#=[cname(%q<target>)] is already being watched!;@set %#=GAME.WATCH:[setunion(%q<watch>,%q<target>)];@pemit %#=Added [cname(%q<target>)] to watch list.
&SW.ACCADD #watch=@assert/inline isdbref(setr(!,account(%#),acc))=@pemit %#=You don't have an account!;@attach #inc/GET_PLAYER=%0,target;@break/inline match(setr(!,filterobjid(get(%q<acc>/WATCH)),watch),%q<target>)=@pemit %#=[cname(%q<target>)] is already being account-watched!;@set %q<acc>=WATCH:[setunion(%q<watch>,%q<target>)];@pemit %#=Added [cname(%q<target>)] to account-watch list.
&SW.REM #watch=@attach #inc/GET_PLAYER=%0,target;@assert/inline match(setr(!,filterobjid(get(%#/GAME.WATCH)),watch),%q<target>)=@pemit %#=[cname(%q<target>)] is not being watched!;@set %#=GAME.WATCH:[setdiff(%q<watch>,%q<target>)];@pemit %#=Removed [cname(%q<target>)] from watch list.
&SW.ACCREM #watch=@assert/inline isdbref(setr(!,account(%#),acc))=@pemit %#=You don't have an account!;@attach #inc/GET_PLAYER=%0,target;@assert/inline match(setr(!,filterobjid(get(%q<acc>/WATCH)),watch),%q<target>)=@pemit %#=[cname(%q<target>)] is not being account-watched!;@set %q<acc>=WATCH:[setdiff(%q<watch>,%q<target>)];@pemit %#=Removed [cname(%q<target>)] from account-watch list.
@aconnect #watch=
@adisconnect #watch=
&HLP.WATCH #watch=The Watch system allows you to monitor when specific players connect and disconnect.%R[ansi(hc,Aliases:)] +watch, +friend%R%R[ansi(hc,Commands)]%R%R[ansi(hw,+watch)]%R%TDisplays your account and personal watch lists.%R%R[ansi(hw,+watch/who)]%R%TShows only online players from your account and personal lists.%R%R[ansi(hw,+watch/add <player>)]%R%TAdd a player to personal watch list.%R%R[ansi(hw,+watch/rem <player>)]%R%TRemoves a player from your personal watch list.%R%R[ansi(hw,+watch/accadd <player>)]%R%TAdds a player to account watch list.%R%R[ansi(hw,+watch/accrem <player>)]%R%TRemoves a player from account watch list.%R%R[ansi(hc,Reminder: Be Considerate)]%RNot everyone wants to be pounced the moment they log on. Watch is a tool for convenience to stay in touch with friends, not being some kind of creepy clingy stalker.
+help/add Community/+watch=#watch/HLP.WATCH