-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathPhone Message - PHONE.txt
40 lines (26 loc) · 3.42 KB
/
Phone Message - PHONE.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
30
31
32
33
34
35
36
37
38
39
40
@@ DEPENDENCIES: Core
th u(NEWCOBJ,Phone Message <PHONE>,phone,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
@lock/command [u(cobj,phone)]=!POWER^GUEST&!FLAG^JAILED&!FLAG^GAGGED
&CMD`+PHONE`PENNMUSH [u(cobj,phone)]=$^(?\:\+)?(?\:phone|call)(?\:/(\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+PHONE`MAIN
@set [u(cobj,phone)]/CMD`+PHONE`PENNMUSH=regexp
&CMD`+PHONE`RHOSTMUSH [u(cobj,phone)]=$^(?\:\+)?(?\:phone|call)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+PHONE`MAIN
@set [u(cobj,phone)]/CMD`+PHONE`RHOSTMUSH=regexp
&CMD`+PHONE`MAIN [u(cobj,phone)]=@attach %!/INC`GETSWITCH=%1;@attach %!/INC`[u(strfirstof,%q<switch>,MAIN)]=%2,%3
@set [u(cobj,phone)]/CMD`+PHONE`[switch(%va,PennMUSH,RHOSTMUSH,RhostMUSH,PENNMUSH)]=no_command
&SWITCHES`PLAYER [u(cobj,phone)]=ON|OFF|OPTIONS
&SYSTEm`NAME [u(cobj,phone)]=PHONE
&INC`OPTIONS [u(cobj,phone)]=@attach %!/INC`OPTION=%0,%1,PHONE
&OPTION`OPTIONS [u(cobj,phone)]=PREFIX
&OPTION`PREFIX [u(cobj,phone)]=What color the PHONE: prefix appears in.
&OPTION`PREFIX`DEFAULT [u(Cobj,phone)]=hc
&OPTION`PREFIX`VALID [u(cobj,phone)]=COLOR
&INC`MAIN [u(cobj,phone)]=@check u(FUN`ON,%#)=@attach %!/INC`MSG=Your phone is not on!;@attach %!/INC`VERIFYLIST=if(not(strlen(%1)),get(%#/D`PHONE`LAST),%0);@attach %!/INC`SEND=u(strfirstof,%1,%0)
&INC`SEND [u(cobj,phone)]=@check strlen(%0)=@attach %!/INC`MSG=What will you say?;&D`PHONE`LAST %#=%q<targets>;@message/spoof setunion(%q<targets>,%#)=CODE ERROR WITH PHONE,%!/FUN`MESSAGEFORMAT,##,%#,%0,%q<targets>
&FUN`MESSAGEFORMAT [u(cobj,phone)]=ansi(u(opother,%0,PHONE,PREFIX),PHONE:)%B[if(strmatch(%0,%1),if(gt(words(%3),1),\(To [itemize(iter(%3,name(%i0),,|),|,and,\,)]\)%B,Phoning [name(first(if(gt(words(%3),1),setdiff(%3,%1),%3)))]\,%B),if(gt(words(%3),1),\(To [itemize(iter(%3,name(%i0),,|),|,and,\,)]\)%B))][speak(%1,%2)]
&INC`VERIFYLIST [u(cobj,phone)]=@check words(u(setr,targets,u(sortname,u(filter,ISDBREF,namelist(%0,FUN`INVALID)))))=@attach %!/INC`MSG=Invalid targets.;@check words(u(setr,targets,filterbool(#lambda/cand(elock(\%0/page,%#),cor(u(FUN`ON,\%0),isadmin(%#)),hasflag(\%0,CONNECTED)),%q<targets>)))=@attach %!/INC`MSG=You cannot send to those players. Their phones may be off or they are disconnected.
&FUN`INVALID [u(cobj,phone)]=pemit(%#,ERROR: [switch(%1,#-1,Name couldn't be matched: %0,#-2,Name was too ambiguous: %0)])
&FUN`ON [u(cobj,phone)]=t(default(%0/D`PHONE`ON,1))
&INC`ON [u(cobj,phone)]=@attach %!/INC`MSG=Your phone is now on!;&D`PHONE`ON %#=1
&INC`OFF [u(cobj,phone)]=@attach %!/INC`MSG=Your phone is now off!;&D`PHONE`ON %#=0
&HLP`PHONE [u(cobj,phone)]=The Phone system is a simple communications command to represent direct radio, instant messaging, phones, or other methods for something too quick, private, or temporary to warrant a +radio frequency.%R[ansi(hc,Aliases:)] phone, call, +call%R%R[ansi(hc,Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+phone <namelist>=<message>)] - Send a message to one or more players. Namelist uses the same format as page\, so separate names with spaces and encapsulate multi-word names in quotes - "Firstname Lastname" etc (or use their alias!)%R[ansi(h,+phone <message>)] - Send another message to the last person or people you phone'd. Same as page\, do not include a = or the system will think your message is a list of targets.%R[ansi(h,+phone/off)] - Turn off your phone. Cannot receive or send messages.%R[ansi(h,+phone/on)] - Turn your phone back on.)]
+help/add Communications/+phone=[u(cobj,phone)]/HLP`PHONE