-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathRadio Chat - RADIO.txt
executable file
·244 lines (151 loc) · 42.7 KB
/
Radio Chat - RADIO.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
@@ DEPENDENCIES - CORE
th u(NEWCOBJ,Radio Management System <RADIO>,radio,,,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
th u(NEWCOBJ,Radio Frequency Parent <FREQ>,freq,u(cobj,radio),,,WIZARD SAFE !NO_COMMAND,INHERIT SIDEFX SAFE)
&SEE_LOCK [u(cobj,freq)]=#TRUE
&JOIN_LOCK [u(cobj,freq)]=#TRUE
&SPEAK_LOCK [u(cobj,freq)]=#TRUE
&MODERATE_LOCK [u(cobj,freq)]=#FALSE
&ADMIN_LOCK [u(cobj,freq)]=#FALSE
&SYSTEM`SWITCHES [u(cobj,radio)]=setunion(u(SWITCHES`%q<mode>`PLAYER),if(u(isadmin,%#),u(SWITCHES`%q<mode>`ADMIN)),|,|)
&CMD`+RADIO`PENNMUSH [u(cobj,radio)]=$^(?s)(?\:\+)?(radio|radmin)(?\:/(\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+RADIO`MAIN
@set [u(cobj,radio)]/CMD`+RADIO`PENNMUSH=regexp
&CMD`+RADIO`RHOSTMUSH [u(cobj,radio)]=$^(?s)(?\:\+)?(radio|radmin)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach %!/CMD`+RADIO`MAIN
@set [u(cobj,radio)]/CMD`+RADIO`RHOSTMUSH=regexp
&CMD`+RADIO`MAIN [u(cobj,radio)]=th u(setq,mode,%1);@attach %!/INC`GETSWITCH=%2;@include %!/INC`%1`[u(strfirstof,%q<switch>,MAIN)]=%3,%4
@set [u(cobj,radio)]/CMD`+RADIO`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&CMD`+RADIOSHORT`PENNMUSH [u(cobj,radio)]=$^(?s)\.(\S+?)(?\:/(\S+)?)?(?\: +(.*))?$:@attach %!/CMD`+RADIOSHORT`MAIN
@set [u(cobj,radio)]/CMD`+RADIOSHORT`PENNMUSH=regexp
&CMD`+RADIOSHORT`RHOSTMUSH [u(cobj,radio)]=$^(?s)\.(\\S+?)(?\:/(\\S+)?)?(?\: +(.*))?$:@attach %!/CMD`+RADIOSHORT`MAIN
@set [u(cobj,radio)]/CMD`+RADIOSHORT`RHOSTMUSH=regexp
&CMD`+RADIOSHORT`MAIN [u(cobj,radio)]=@attach %!/INC`GETSWITCH=%2;@include %!/INC`RADIO`[u(strfirstof,%q<switch>,MAIN)]=%1,%3
@set [u(cobj,radio)]/CMD`+RADIOSHORT`[u(choosegame,RHOSTMUSH,PENNMUSH)]=no_command
&SYSTEM`NAME [u(cobj,radio)]=RADIO
&SYSTEM`OPTIONS [u(cobj,radio)]=RADIO
&SYSTEM`COLORS [u(cobj,radio)]=RADIO
&SWITCHES`RADIO`PLAYER [u(cobj,radio)]=JOIN|LEAVE|ON|OFF|GAG|UNGAG|ALIAS|RECALL|CODENAME|NOSPOOF|TITLE|NSRECALL|WHO|COLORS|CUSTCOLOR|DIRECTORY|LIST|EMIT|OPTIONS|INFO
&SWITCHES`RADIO`ADMIN [u(cobj,radio)]=
&SWITCHES`RADMIN`PLAYER [u(cobj,radio)]=CREATE|RENAME|CHOWN|CONFIG|ADDMOD|DELMOD|BAN|MUZZLE|UNMUZZLE|DESCRIBE|LOCK|RAWLOCK|GROUP|OPTIONS|WHO|RECALL|NSRECALL|INFO
&SWITCHES`RADMIN`ADMIN [u(Cobj,radio)]=DELETE|MONITOR|ACCMUZZLE|UNACCMUZZLE
&INC`RADMIN`CREATE [u(cobj,radio)]=@attach %!/INC`NAMECHECK=u(setr,chosename,trim(before(%0,/)));@stop isdbref(u(FUN`FINDFREQ,%q<chosename>))=@attach %!/INC`MSG=ERROR: A radio channel of that name already exists.;@tel u(setr,freq,create(%q<chosename>))=u(cobj,freq);@parent %q<freq>=u(cobj,freq);&OWNER %q<freq>=%:;@attach %!/INC`MSG=Radio channel '%0' created.;@attach %!/INC`MSG`CHAN=Radio channel '%0' created.;@attach %!/INC`RADIO`JOIN
&FUN`FINDFREQ [u(cobj,radio)]=localize(u(setq,all,children(u(cobj,freq)))[if(isdbref(%1),u(setq,vis,u(filter,CANSEE,%q<all>),%b,%b,%:),u(setq,vis,%q<all>))][if(%2,namegraball(%q<vis>,%0),namegrab(%q<vis>,%0))])
&FUN`GETFREQ [u(Cobj,radio)]=u(find_in,u(cobj,freq),%0)
&INC`VALID`RADIONAME [u(cobj,radio)]=@check strlen(u(setr,value,stripansi(trim(%0))))=@attach %!/INC`MSG=ERROR: No Name Entered for the new Frequency!;@stop gt(words(%0),1)=@attach %!/INC`MSG=ERROR: Radio names must not contain spaces.;@check valid(name,%0)=@attach %!/INC`MSG=ERROR: '%0' cannot be used as an object name.;@check valid(attrname,D`RADIO`%0)=@attach %!/INC`MSG=ERROR: '%0' cannot be used as an attribute name.;@stop u(charsearch,%0,u(badchars) / `)=@attach %!/INC`MSG=ERROR: Radio names must not contain: [v(badchars)] / `;@stop cand(,not())
&INC`VALID`SLOTNAME [u(cobj,radio)]=@check strlen(u(setr,value,stripansi(trim(%0))))=@attach %!/INC`MSG=ERROR: No Name Entered for the new Slot!;@stop gt(words(%0),1)=@attach %!/INC`MSG=ERROR: Radio names must not contain spaces.;@check valid(attrname,D`RADIO`%0)=@attach %!/INC`MSG=ERROR: '%0' cannot be used as an attribute name.;@stop u(charsearch,%0,u(badchars) / `)=@attach %!/INC`MSG=ERROR: Radio names must not contain: [v(badchars)] / `;@stop cand(hasattr(%1/D`RADIO`%q<value>),not(strmatch(D`RADIO`%q<value>,%2)))
&INC`FINDFREQ [u(cobj,radio)]=@attach %!/INC`VALID`RADIONAME=%0;@select/inline isdbref(u(setr,freq,u(FUN`FINDFREQ,%0,%#)))=0,{@stop gt(words(u(setr,freq,namegraball(u(filter,CANSEE,children(u(cobj,freq)),%b,%b,%:),%0))),1)=@attach %!/INC`MSG=ERROR: That matched [u(itemize,iter(%q<freq>,name(%i0),%b,|),|,and,\,)]. Please be more specific.;@check words(%q<freq>)=@attach %!/INC`MSG=ERROR: Radio channel '%0' not found.};th u(setq,freq,objid(%q<freq>));th u(setq,freqname,name(%q<freq>))
&FIL`PUBLIC [u(Cobj,radio)]=strmatch(#TRUE,get(%0/SEE_LOCK))
&FIL`PRIVATE [u(cobj,radio)]=not(u(FIL`PUBLIC,%0))
&FIL`CANSEE [u(Cobj,radio)]=u(FUN`PERMISSION,%0,SEE,%1)
&INC`RADIO`JOIN [u(cobj,radio)]=@stop u(isguest,%#)=@attach %!/INC`MSG=ERROR: Permission denied for guests.;@attach %!/INC`FINDFREQ=trim(before(%0,/));@attach %!/INC`JOIN`DO=%:,%q<freq>,after(%0,/);
@@ This is split off, because of the group system.
&INC`JOIN`DO [u(cobj,radio)]=@check isdbref(%1)=@attach %!/INC`MSG=ERROR: Could not find frequency %1!,%0;th u(setq,slotname,u(strfirstof,%2,name(%1)));@check u(FUN`PERMISSION,u(setr,freq,%1),JOIN,%0)=@attach %!/INC`MSG=ERROR: Permission denied.,%0;@stop hasattr(%0/D`RADIO`%q<slotname>)=@attach %!/INC`MSG=ERROR: That SlotName '%q<slotname>' is already in use. You must choose an alias that is not yet used.,%0;th u(attrib_set,%0,u(setr,slot,D`RADIO`%q<slotname>),objid(%1));&%q<slot>`NAME %#=%q<slotname>;@attach %!/INC`MSG=Slot '%q<slotname>' initialized and tuned to Radio Channel '[u(getmoniker,%1)]'.,%0;th u(setq,mem,match(get(%1/MEMBERS),objid(%0)));@attach %!/INC`CONNECT=objid(%0),%1;@attach %!/INC`UPDATESLOTS=%0,%1;@select/inline nor(u(isadmin,%0),%q<mem>)=1,{@attach %!/INC`SYSRADIO=[ansi(hw,name(%0))] has joined the Radio Channel.,num(%0)}
@@ ARGS: %0 - Person to join. %1 - Frequency DBREF/OBJID. %2 - Alias, if any.
&INC`UPDATESLOTS [u(cobj,radio)]=th u(attrib_set,%0,D`RADIO_META`[num(%1)],u(wildgrepi,%0,D`RADIO`*,%1))
&INC`LOCKSTART [u(cobj,radio)]=@attach %!/INC`FINDFREQ=trim(before(%0,/));@check u(FUN`PERMISSION,%q<freq>,ADMIN,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(after(%0,/))=@attach %!/INC`MSG=ERROR: Must enter a /lock type. SEE JOIN SPEAK MODERATE or ADMIN.;@attach %!/INC`PARTIAL=after(%0,/),SEE|JOIN|SPEAK|MODERATE|ADMIN,|,lock;
&INC`RADMIN`RAWLOCK [u(cobj,radio)]=@attach %!/INC`LOCKSTART=%0,%1,,1
&INC`RADMIN`LOCK [u(cobj,radio)]=@attach %!/INC`LOCKSTART;@select/inline cor(t(%3),not(isdbref(u(cobj,group))))=1,{@attach %!/INC`VALID`LOCK=%2},0,{@attach %!/INC`VALID`GROUPLOCK=%1,1};th u(attrib_set,%q<freq>,%q<lock>_LOCK,%q<value>);@attach %!/INC`MSG=Locked the Radio/%q<lock> to %q<lockstr>!;@attach %!/INC`SYSRADIO=[ansi(hw,%n)] Set the %q<lock>_LOCK To: %q<value>;@attach %!/INC`MSG`CHAN=%q<lock> Locked Radio '%q<freqname>' to: %q<value> (MEANING: %q<valueformat>)
&INC`RADMIN`UNLOCK [u(cobj,radio)]=@attach %!/INC`LOCKSTART;@attach %!/WIPE=%q<freq>,%q<lock>_LOCK;@attach %!/INC`MSG=Unlocked the Radio/%q<lock>!;@attach %!/INC`SYSRADIO=[ansi(hw,%n)] Unlocked the %q<lock>_LOCK back to defaults;@attach %!/INC`MSG`CHAN=%q<lock> Released Radio '%q<freqname>' to defaults.
&INC`CHECKSLOT [u(cobj,radio)]=@select/inline %2=TUNE,{@attach %!/INC`FINDFREQ},{@check strlen(%0)=@attach %!/INC`MSG=ERROR: No Slot entered to use.;@attach %!/INC`PARTIAL=%0,iter(lattr(%#/D`RADIO`*),last(%i0,`),%b,|),|,found,Radio Slot;@check hasattr(%#/D`RADIO`%q<found>)=@attach %!/INC`MSG=ERROR: No slot by that name.;th u(setq,slot,D`RADIO`%q<found>);th u(setq,slotname,default(%#/D`RADIO`%q<found>`NAME,ucstr(%q<found>)));th u(setq,freq,get(%#/%q<slot>))}
&INC`RADIO`LEAVE [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`LEAVE`DO=%#,%q<slot>,%q<freq>;
&INC`LEAVE`DO [u(cobj,radio)]=@attach %!/WIPE=%0,[u(setr,slot,%1)];@attach %!/WIPE=%0,RADIO_%1;@attach %!/INC`UPDATESLOTS=%0,u(setr,freq,%2);@attach %!/INC`MSG=You have left Radio Channel '[u(getmoniker,%2)]'.,%0;@select/inline words(get(%0/D`RADIO_META`[num(%2)]))=0,{@attach %!/INC`DISCONNECT=objid(%0),%2;@select/inline u(isadmin,%0)=0,{@attach %!/INC`SYSRADIO=[ansi(hw,u(getmoniker,%0))] has left the Radio Channel.}}
&INC`SYSRADIO [u(cobj,radio)]=@attach %!/INC`BROADCAST=,%0,,1,%1
&INC`CONNECT [u(cobj,radio)]=&MEMBERS %1=u(filter,ISOBJID,setunion(get(%1/MEMBERS),%0));&GAGGED %1=u(filter,ISOBJID,setdiff(get(%1/GAGGED),%0));&ENABLED %1=u(filter,ISOBJID,setunion(get(%1/ENABLED),%0))
&INC`DISCONNECT [u(cobj,radio)]=&MEMBERS %1=u(filter,ISOBJID,setdiff(get(%1/MEMBERS),%0));&GAGGED %1=u(filter,ISOBJID,setdiff(get(%1/GAGGED),%0));&ENABLED %1=u(filter,ISOBJID,setdiff(get(%1/ENABLED),%0))
&INC`RADIO`ON [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`CONNECT=%:,%q<freq>;@attach %!/INC`MSG=Radio Slot enabled.
&INC`RADIO`OFF [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;&ENABLED %q<freq>=setdiff(get(%q<freq>/ENABLED),%:);@attach %!/INC`MSG=Radio Slot disabled.
&INC`RADIO`MAIN [u(cobj,radio)]=@select/inline strlen(%0)=0,{@attach %!/INC`LIST},{@attach %!/INC`JAILCHECK;@attach %!/INC`CHECKSLOT;@check isobjid(%q<freq>)=@attach %!/INC`MSG=ERROR: Slot is no longer valid. Delete it!;@check match(get(%q<freq>/ENABLED),%:)=@attach %!/INC`MSG=That Slot is turned off.;@stop match(u(getstat,%#,D`RADIO,GAG),%q<freq>)=@attach %!/INC`MSG=ERROR: Slot is gagged.;@attach %!/INC`BROADCAST=%0,%1}
&INC`RADMIN`MAIN [u(cobj,radio)]=@attach %!/INC`RADIO`DIRECTORY
&INC`LIST [u(cobj,radio)]=@pemit %#=u(header,Your Radio Config);@pemit %#=ansi(u(color,%#,RADIO,COLUMN_NAMES),align(3 12 15 22 22,Sta,Alias,FreqName,Codename,Title));@pemit %#=u(separator);@dolist/inline u(sortattr,u(lattr,%#/D`RADIO`*))={th u(setq,freq,get(%#/##));@pemit %#=align(3 12 15 22 22,if(match(get(%q<freq>/GAGGED),%:),Gag,if(match(get(%q<freq>/ENABLED),%:),ansi(hg,On),ansi(hx,Off))),default(%#/##`NAME,last(##,`)),if(u(FIL`PRIVATE,%q<freq>),ansi(hx,name(%q<freq>)),u(getmoniker,%q<freq>)),get(%#/##`CODENAME),get(%#/##`TITLE))};@pemit %#=u(footer)
&INC`RADIO`DIRECTORY [u(cobj,radio)]=@pemit %#=u(header,Radio Directory);@pemit %#=ansi(u(color,%#,RADIO,COLUMN_NAMES),align(3 15 18 41,Sta,Name,Owner,Description));@pemit %#=u(Public Frequencies);@dolist/inline u(setr,public,u(sortname,u(filter,NOTGROUP,u(filter,PUBLIC,u(setr,freqs,children(u(cobj,freq)))))))={@pemit %#=u(FUN`RADIOLINE,##)};@pemit %#=u(separator,Hidden Frequencies);@dolist/inline u(sortname,u(setr,hidden,u(filter,NOTGROUP,u(setr,pregroup,setdiff(u(filter,CANSEE,%q<freqs>,%b,%b,%:),%q<public>)))))={@pemit %#=u(FUN`RADIOLINE,##)};@select/inline isobjid(u(cobj,group))=1,{@pemit %#=u(separator,Group Frequencies);@dolist/inline u(sortname,setdiff(%q<pregroup>,%q<hidden>))={@pemit %#=u(FUN`RADIOLINE,##)}};@pemit %#=u(footer)
&INC`RADMIN`DIRECTORY [u(cobj,radio)]=@attach %!/INC`RADIO`DIRECTORY
&FIL`NOTGROUP [u(Cobj,radio)]=not(isobjid(get(%0/GROUP)))
&FUN`RADIOLINE [u(cobj,radio)]=align(3 15 18 41,if(match(get(%0/GAGGED),%:),Gag,if(match(get(%0/MEMBERS),%:),if(match(get(%0/ENABLED),%:),ansi(hg,On),ansi(hx,Off)),ansi(hx,N/A))),if(u(FIL`PRIVATE,%0),ansi(hx,name(%0)),u(getmoniker,%0)),if(isobjid(u(setr,owner,get(%0/OWNER))),u(getmoniker,%q<owner>),ansi(hx,N/A)),left(get(%0/SUMMARY),41))
&INC`RADMIN`INFO [u(Cobj,radio)]=@attach %!/INC`FINDFREQ;@attach %!/INC`INFO
&INC`RADIO`INFO [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`INFO
&INC`INFO [u(cobj,radio)]=@check u(FUN`PERMISSION,%q<freq>,USE)=@attach %!/INC`MSG=ERROR: Permission denied.;@pemit %#=u(header,Radio Frequency: [u(getmoniker,%q<freq>)]);@pemit %#=get(%q<freq>/DESCRIBE);@pemit %#=u(separator);@pemit %#=[ansi(hw,OWNER:)] [if(get(%q<freq>/OWNER),u(getmoniker,get(%q<freq>/OWNER)),N/A)];@pemit %#=[ansi(hw,MODERATORS:)] [iter(u(sortname,u(filter,ISOBJID,get(%q<freq>/MODERATE))),name(%i0),%B,\,%b)];@pemit %#=[ansi(hw,MEMBERS:)] [iter(u(sortname,u(filter,ISOBJID,get(%q<freq>/MEMBERS))),name(%i0),%B,\,%b)];@pemit %#=u(footer)
&INC`RADIO`CUSTCOLOR [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@select/inline t(strlen(%1))=1,{@attach %!/INC`VALID`COLOR=%1;@attach %!/INC`MSG=You color Radio Slot [ucstr(%0)] to [ansi(%q<value>,ucstr(%0))];&%q<slot>`COLOR %#=%q<value>},0,{@attach %!/INC`MSG=You clear Radio Slot [ucstr(%0)]'s Color setting.;&%q<slot>`COLOR %#}
&INC`RADIO`ALIAS [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`NAMECHECK=%1;@select/inline strmatch(%0,%1)=0,{@stop hasattr(%#/D`RADIO`%1)=@attach %!/INC`MSG=ERROR: That alias is already in use.;@attach %!/INC`MVTREE=%#,%q<slot>,%#,D`RADIO`%1};&D`RADIO`%1`NAME %#=%1;@attach %!/INC`MSG=You rename Slot '%0' to '%1';@mvattr %#/RADIO_%0=%#/RADIO_%1;@attach %!/INC`UPDATESLOTS=%#,%q<freq>
&INC`RADIO`CODENAME [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@select/inline strlen(%1)=0,{@attach %!/INC`MSG=Radio Slot %q<slotname>'s Codename has been Cleared!;&%q<slot>`CODENAME %#},{th u(setq,codename,trim(%1));@stop u(charsearch,%q<codename>,%r %t)=@attach %!/INC`MSG=ERROR: Codenames may not contain linebreaks or tabs.;@stop gt(strlen(%q<codename>),u(PLAYER_NAME_LEN))=@attach %!/INC`MSG=ERROR: Codename is beyond the allowed [u(PLAYER_NAME_LEN)] characters.;@stop cand(not(u(isadmin,%#)),words(setdiff(u(choosegame,lsearch(all,eplayer,\[strlen(wildgrepi(##,D`RADIO`*`CODENAME,%q<codename>))\]),EPLAYER=\[strlen(u(wildgrepi,##,D`RADIO`*`CODENAME,%q<codename>))\]),%#)))=@attach %!/INC`MSG=ERROR: Another player is already using that Codename.;@check cor(valid(playername,%q<codename>),u(isadmin,%#))=@attach %!/INC`MSG=ERROR: Codenames may not match any player's name or alias.;@attach %!/INC`MSG=Your Codename on Radio Slot %q<slotname> is now: %q<codename>;&%q<slot>`CODENAME %#=%q<codename>}
&INC`RADIO`TITLE [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@select/inline strlen(%1)=0,{@attach %!/INC`MSG=Radio Slot %q<slotname>'s Title has been Cleared!;@attach %!/WIPE=%#,%q<slot>`TITLE},{@stop u(charsearch,%1,%r %t)=@attach %!/INC`MSG=ERROR: Titles may not contain linebreaks or tabs.;@stop gt(strlen(%1),u(PLAYER_NAME_LEN))=@attach %!/INC`MSG=That radio title is too long!;@attach %!/INC`MSG=Your Title on Radio Slot %q<slotname> is now: %1;&%q<slot>`TITLE %#=%1}
&INC`RADMIN`MONITOR [u(cobj,radio)]=@select/inline t(u(getstat,%#,D`RADIO,Monitor))=1,{@attach %!/INC`MSG=You switch off Monitoring.;th u(setstat,%#,D`RADIO,Monitor,0)},0,{@attach %!/INC`MSG=You switch on Monitoring.;th u(setstat,%#,D`RADIO,Monitor,1)}
&INC`RADIO`NOSPOOF [u(cobj,radio)]=@select/inline t(u(getstat,%#,D`RADIO,Nospoof))=1,{@attach %!/INC`MSG=You switch off Nospoof mode.;th u(setstat,%#,D`RADIO,Nospoof,0)},0,{@attach %!/INC`MSG=You switch on Nospoof.;th u(setstat,%#,D`RADIO,Nospoof,1)}
&INC`RADIO`EMIT [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`BROADCAST=%0,%1,1
&INC`RADMIN`EMIT [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@attach %!/INC`BROADCAST=%0,%1,1
&INC`RADIO`GAG [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@stop match(u(getstat,%#,D`RADIO,GAG),%q<freq>)=@attach %!/INC`MSG=Already gagging %q<slotname>.;@attach %!/INC`MSG=Frequency gagged.;@attach %!/INC`ENABLE`GAG=%:,%q<freq>
&INC`RADIO`UNGAG [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@check match(u(getstat,%#,D`RADIO,GAG),%q<freq>)=@attach %!/INC`MSG=Not gagging %q<slotname>.;@attach %!/INC`MSG=Frequency ungagged.;@attach %!/INC`DISABLE`GAG=%:,%q<freq>
&INC`DISABLE`GAG [u(cobj,radio)]=&GAGGED %1=setdiff(get(%1/GAGGED),%0);th u(setstat,%0,D`RADIO,GAG,setdiff(u(getstat,%0,D`RADIO,Gag),%1))
&INC`ENABLE`GAG [u(cobj,radio)]=&GAGGED %1=setunion(get(%1/GAGGED),%0);th u(setstat,%0,D`RADIO,GAG,setunion(u(getstat,%0,D`RADIO,Gag),%1))
&INC`RADMIN`CHOWN [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,OWNER)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%1,1;@attach %!/INC`VERIFY={WARNING: This will change ownership of Frequency %q<slotname>. Are you sure? Enter command again in ten seconds to confirm.},RADIO CHOWN %q<freq> %q<t1>;&OWNER %q<freq>=%q<t1objid>;@attach %!/INC`MSG=Radio [u(getmoniker,%q<freq>)] ownership changed to: %q<t1name>\, by %n.,setunion(%# %q<t1>,);@attach %!/INC`MSG`CHAN=Radio [u(getmoniker,%q<freq>)] ownership changed to: %q<t1name>.
&INC`RADMIN`DELETE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,OWNER)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`VERIFY={WARNING: This will delete Frequency %q<freqname>. Are you sure? Enter command again in ten seconds to confirm.},RADIO DELETE %q<freq>;@attach %!/INC`MSG=Radio [u(getmoniker,%q<freq>)] deleted.;@attach %!/INC`SYSRADIO=Frequency has been [ansi(hr,DELETED!)];@dolist/inline u(filter,ISOBJID,get(%q<freq>/MEMBERS))={@dolist/inline get(%i0/D`RADIO_META`[num(%q<freq>)])=@attach %!/WIPE=%i1,%i0;@attach %!/WIPE=%i0,D`RADIO_META`[num(%q<freq>)]};@attach %!/INC`DOSQL=DELETE`MESSAGES,objid(%q<freq>);@attach %!/DELETE=%q<freq>;
&Q`DELETE`MESSAGES [u(cobj,radio)]=DELETE from vol_messages WHERE source_objid=?
&INC`RADMIN`DESCRIBE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,ADMIN)=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(%1)=@attach %!/INC`MSG=ERROR: Nothing entered to describe the radio as!;@DESCRIBE %q<freq>=%1;@attach %!/INC`MSG=Description set!
&INC`RADMIN`SUMMARY [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,ADMIN)=@attach %!/INC`MSG=ERROR: Permission denied.;@check strlen(%1)=@attach %!/INC`MSG=ERROR: Nothing entered to describe the radio as!;&SUMMARY %q<freq>=%1;@attach %!/INC`MSG=Summary set!
&INC`RADMIN`RENAME [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,OWNER)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`NAMECHECK=%1;@break cand(isdbref(u(setr,found,u(FUN`FINDFREQ,%1))),not(strmatch(%q<freq>,%q<found>)))=@attach %!/INC`MSG=ERROR: Name conflict.;@attach %!/INC`MSG=Radio channel renamed!;@attach %!/INC`MSG`CHAN=Radio Channel '[u(getmoniker,%q<freq>)]' renamed to: %1;@name %q<freq>=%1
&INC`RADMIN`CONFIG [u(cobj,radio)]=@attach %!/INC`FINDFREQ=before(%0,/);@check u(FUN`PERMISSION,%q<freq>,ADMIN)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`PARTIAL=after(%0,/),CODENAME|TITLE|BANNER,|,config,Config Option;@attach %!/INC`VALID`BOOL=%1;&CONFIG`%q<config> %q<freq>=%q<value>;@attach %!/INC`MSG=Radio Config option %q<Config> set to %q<value>;@attach %!/INC`MSG`CHAN=Radio Channel '[u(getmoniker,%q<freq>)]' Config option %q<config> set to: %q<value>
&FUN`CONFIG [u(cobj,radio)]=default(%0/CONFIG`%1,switch(%1,CODENAME,1,TITLE,1,BANNER,0))
&FUN`PERMISSION [u(cobj,radio)]=localize(if(cor(u(isadmin,u(setr,target,objid(u(strfirstof,%2,%#)))),match(get(%0/OWNER),%q<target>)),1,switch(%1,OWNER,match(get(%0/OWNER),%q<target>),MODERATE,cor(match(get(%0/MODERATE),%q<target>),testlock(get(%0/MODERATE_LOCK),%q<target>)),SEE,testlock(get(%0/SEE_LOCK),%q<target>),JOIN,testlock(get(%0/JOIN_LOCK),%q<target>),SPEAK,cand(testlock(get(%0/SPEAK_LOCK),%q<target>),not(match(get(%0/BANNED),%q<target>))),0)))
@@ %0 - freq object, %1 - permission type, %2 - target if not enactor.
&INC`RADMIN`ADDMOD [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,ADMIN,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%1,1;@stop match(get(%q<freq>/MODERATE),%q<t1objid>)=@attach %!/INC`MSG=ERROR: %q<t1name> is already a moderator.;&MODERATE %q<freq>=setunion(get(%q<freq>/MODERATE),%q<t1objid>);@attach %!/INC`MSG=%q<t1name> is now a moderator for [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You are now a moderator for [u(getmoniker,%q<freq>)].,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> added to [u(getmoniker,%q<freq>)] moderators.
&INC`RADMIN`DELMOD [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,ADMIN,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%1,1;@check match(get(%q<freq>/MODERATE),%q<t1objid>)=@attach %!/INC`MSG=ERROR: %q<t1name> is not a moderator.;&MODERATE %q<freq>=setdiff(get(%q<freq>/MODERATE),%q<t1objid>);@attach %!/INC`MSG=%q<t1name> is no longer a moderator for [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You are no longer a moderator for [u(getmoniker,%q<freq>)].,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> removed from [u(getmoniker,%q<freq>)] moderators.
&INC`RADMIN`BAN [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%1,1;@stop u(FUN`PERMISSION,%q<freq>,MODERATE,%q<t1>)=@attach %!/INC`MSG=ERROR: Cannot ban privileged players.;@stop match(get(%q<freq>/BANNED),%q<t1objid>)=@attach %!/INC`MSG=ERROR: %q<t1name> is already banned.;@attach %!/INC`MSG=You have banned %q<t1objid> from Radio Channel [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You were banned from Radio Channel [u(getmoniker,%q<freq>)],%q<t1>.;@attach %!/INC`MSG`CHAN=%q<t1name> was banned from Radio Channel [u(getmoniker,%q<freq>)].;&BANNED %q<freq>=u(filter,ISOBJID,setunion(get(%q<freq>/BANNED),%q<t1objid>))
&INC`RADMIN`UNBAN [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=%1,1;@stop u(FUN`PERMISSION,%q<freq>,MODERATE,%q<t1>)=@attach %!/INC`MSG=ERROR: Cannot ban privileged players.;@check match(get(%q<freq>/BANNED),%q<t1objid>)=@attach %!/INC`MSG=ERROR: %q<t1name> is not banned.;@attach %!/INC`MSG=You have unbanned %q<t1objid> from Radio Channel [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You were unbanned from Radio Channel [u(getmoniker,%q<freq>)],%q<t1>.;@attach %!/INC`MSG`CHAN=%q<t1name> was unbanned from Radio Channel [u(getmoniker,%q<freq>)].;&BANNED %q<freq>=u(filter,ISOBJID,setdiff(get(%q<freq>/BANNED),%q<t1objid>))
&INC`RADMIN`MUZZLE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=before(%1,/),1;@stop u(FUN`PERMISSION,%q<freq>,MODERATE,%q<t1>)=@attach %!/INC`MSG=ERROR: Cannot muzzle privileged players.;@stop gt(get(%q<freq>/MUZZLE`%q<t1>),secs())=@attach %!/INC`MSG=%q<t1name> is already muzzled.;@check strlen(after(%1,/))=@attach %!/INC`MSG=ERROR: Muzzle duration empty.;@check gt(u(setr,duration,u(stringsecs,after(%1,/))),0)=@attach %!/INC`MSG=ERROR: Duration was not accepted by stringsecs. Please see [u(pueblize,help stringsecs(),help stringsecs())].;th u(attrib_set,%q<freq>,MUZZLE`%q<t1>,u(setr,until,add(secs(),%q<duration>)));&MUZZLE`%q<t1>`BY %q<freq>=%:;&MUZZLE`%q<t1>`ON %q<freq>=secs();@attach %!/INC`MSG=Muzzled %q<t1name> from Radio Channel [u(getmoniker,%q<freq>)] until [u(fancytime,%q<until>)].;@attach %!/INC`MSG`NOTICE=You were Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<duration>,%q<t1>)].,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<duration>,,UTC)].
&INC`RADMIN`UNMUZZLE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=before(%1,/),1;@stop u(FUN`PERMISSION,%q<freq>,MODERATE,%q<t1>)=@attach %!/INC`MSG=ERROR: Cannot muzzle privileged players.;@check gt(get(%q<freq>/MUZZLE`%q<t1>),secs())=@attach %!/INC`MSG=%q<t1name> is not muzzled.;@attach %!/WIPE=%q<freq>,MUZZLE`%q<t1>;@attach %!/INC`MSG=un-Muzzled %q<t1name> from Radio Channel [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You were un-Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]'.,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> un-Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]'.
&INC`RADMIN`ACCMUZZLE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=before(%1,/),1;@check isdbref(u(setr,accid,u(accid,%q<t1>,1)))=@attach %!/INC`MSG=ERROR: %q<t1name> does not have an Account.;@stop gt(get(%q<freq>/ACCMUZZLE`%q<accid>),secs())=@attach %!/INC`MSG=%q<t1name> is already Account Muzzled.;@check strlen(after(%1,/))=@attach %!/INC`MSG=ERROR: Muzzle duration empty.;@check gt(u(setr,duration,u(stringsecs,after(%1,/))),0)=@attach %!/INC`MSG=ERROR: Duration was not accepted by stringsecs. Please see [u(pueblize,help stringsecs(),help stringsecs())].;th u(attrib_set,%q<freq>,ACCMUZZLE`%q<accid>,u(setr,until,add(secs(),%q<duration>)));&ACCMUZZLE`%q<accid>`BY %q<freq>=%:;&ACCMUZZLE`%q<accid>`ON %q<freq>=secs();@attach %!/INC`MSG=Account Muzzled %q<t1name> from Radio Channel [u(getmoniker,%q<freq>)] until [u(fancytime,%q<until>)].;@attach %!/INC`MSG`NOTICE=You were Account Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<duration>,%q<t1>)].,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> Account Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<duration>,,UTC)].
&INC`RADMIN`UNACCMUZZLE [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@check u(FUN`PERMISSION,%q<freq>,MODERATE,%#)=@attach %!/INC`MSG=ERROR: Permission denied.;@attach %!/INC`CHECKPC=before(%1,/),1;@check isdbref(u(setr,accid,u(accid,%q<t1>,1)))=@attach %!/INC`MSG=ERROR: %q<t1name> does not have an Account.;@check gt(get(%q<freq>/ACCMUZZLE`%q<accid>),secs())=@attach %!/INC`MSG=%q<t1name> is not Account Muzzled.;@attach %!/WIPE=%q<freq>,ACCMUZZLE`%q<accid>;@attach %!/INC`MSG=Account un-Muzzled %q<t1name> from Radio Channel [u(getmoniker,%q<freq>)].;@attach %!/INC`MSG`NOTICE=You were Account un-Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]'.,%q<t1>;@attach %!/INC`MSG`CHAN=%q<t1name> Account un-Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]'.
&INC`BROADCAST [u(cobj,radio)]=th u(setq,src,u(strfirstof,%4,%#));@select/inline t(%3)=0,{@check strlen(%1)=@attach %!/INC`MSG=ERROR: Nothing entered to say!;@@ @stop strmatch(left(%1,1),|)=@attach %!/INC`MSG=ERROR: The Emit feature is disabled.;@stop match(get(%q<freq>/BANNED),%:)=@attach %!/INC`MSG=ERROR: You are banned from Radio Channel '[u(getmoniker,%q<freq>)]'.;@check u(FUN`PERMISSION,%q<freq>,SPEAK,%q<src>)=@attach %!/INC`MSG=ERROR: Permission denied.;@stop gt(u(setr,muz,get(%q<freq>/MUZZLE`%q<src>)),secs())=@attach %!/INC`MSG=ERROR: You are Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<muz>)].;@select/inline isdbref(u(setr,accid,num(u(accid,%q<src>,1))))=1,{@stop gt(u(setr,muz,get(%q<freq>/ACCMUZZLE`%q<accid>)),secs())=@attach %!/INC`MSG=ERROR: You are Account Muzzled from Radio Channel '[u(getmoniker,%q<freq>)]' until [u(fancytime,%q<muz>)].}};th u(setq,targets,setdiff(setinter(u(setr,who,u(lwhoid)),setdiff(get(%q<freq>/ENABLED),get(%q<freq>/GAGGED))),u(setr,monitor,u(filter,MONITOR,%q<who>))));th u(setq,markup,u(markup,%1,setunion(u(lwhoid),get(%q<freq>/ENABLED))));th u(setq,banner,u(FUN`CONFIG,%q<freq>,BANNER));@attach %!/INC`BROADCAST`%va;@attach %!/INC`LOGRADIO=%q<src>,%q<freq>,%q<markup>,%3,get(%q<src>/%q<slot>`CODENAME),get(%q<src>/%q<slot>`TITLE),%2;@select/inline cand(%2,not(match(%q<monitor>,%:)))=1,{@attach %!/INC`MSG=WARNING: Your Emit was sent to %q<freq>, but you must either set a slot to that frequency or toggle [u(pueblize,+radio/monitor,+radio/monitor)] to hear replies!}
@@ %0 - Enactor, %1 - recipient, %2 - frequency, %3 - message, %4 - System msg mode, %5 - codename, %6 - title, %7 - emit mode. %8 - Banner.
&INC`BROADCAST`PENNMUSH [u(cobj,radio)]=@message %q<targets>=<unset>,%!/FUN`FORMATBROADCAST,%q<src>,##,%q<freq>,%q<markup>,%3,get(%q<src>/%q<slot>`CODENAME),get(%q<src>/%q<slot>`TITLE),%2,%q<banner>;@message setunion(%q<monitor>,if(%2,%q<src>))=<unset>,%!/FUN`FORMATMONITOR,%q<src>,##,%q<freq>,%q<markup>,%3,get(%q<src>/%q<slot>`CODENAME),get(%q<src>/%q<slot>`TITLE),%2,%q<banner>
&INC`BROADCAST`RHOSTMUSH [u(cobj,radio)]=@pemit/list %q<targets>=udefault(%!/FUN`FORMATBROADCAST,<unset>,%q<src>,##,%q<freq>,%q<markup>,,get(%q<src>/%q<slot>`CODENAME),get(%q<src>/%q<slot>`TITLE),%2);@pemit/list setunion(%q<monitor>,if(%2,%q<src>))=udefault(%!/FUN`FORMATBROADCAST,<unset>,%q<src>,##,%q<freq>,%q<markup>,,get(%q<src>/%q<slot>`CODENAME),get(%q<src>/%q<slot>`TITLE),%2)
&FIL`MONITOR [u(cobj,radio)]=u(getstat,%0,D`RADIO,Monitor)
&INC`RADIO`WHO [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`WHO
&INC`RADMIN`WHO [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@attach %!/INC`WHO
&INC`WHO [u(cobj,radio)]=@check words(u(setr,listen,u(sortname,setdiff(setinter(u(setr,who,u(lwhoid,%#)),get(%q<freq>/ENABLED)),u(setr,monitor,u(filter,MONITOR,%q<who>)),))))=@attach %!/INC`MSG=Nobody is listening to %q<freq>.;@attach %!/INC`MSG=Listeners for %q<slotname> are: [u(itemize,iter(%q<listen>,u(getmoniker,%i0),,|),|,and,\,)]
&FUN`FORMATBROADCAST [u(cobj,radio)]=u(setq,recpslot,first(get(%1/D`RADIO_META`[num(%2)])))[u(setq,default,ansi(u(opother,%1,RADIO,EDGE),-<)[ansi(u(opother,%1,RADIO,PREFIX),RADIO:)] [ansi(u(strfirstof,get(%1/%q<recpslot>`COLOR),u(opother,%1,RADIO,FREQNAME)),u(%!/FUN`FREQNAME,%1,%2))][if(%4,ansi(c,-SYS))][ansi(u(opother,%1,RADIO,EDGE),>-)]%B[u(setr,fullmsg,[if(cor(%7,%4),u(colormarkup,%1,%3,%0),if(strlen(%6),trim(%6)%B)[u(speech,%0,u(setr,mesg,u(colormarkup,%1,%3,%0)),%1,if(cand(strlen(%5),cor(u(getstat,%1,D`RADIO,NoSpoof),%8)),\([u(getmoniker,%0,%1)]\) %5,if(strlen(%5),%5)),RADIO,lwho(),%8)])])])][u(strfirstof,ulocal(%1/RADIO_[last(%q<recpslot>,`)],switch(1,t(%7),|,strmatch(%3,:*),:,strmatch(%3,;*),;,"),u(%!/FUN`FREQNAME,%1,%2),switch(1,strmatch(%q<mesg>,:*),after(%q<mesg>,:),strmatch(%q<mesg>,;*),after(%q<mesg>,;),%q<mesg>),if(%7,Someone,u(getmoniker,%0,%1)),%6,%q<default>,%q<fullmsg>,%5,%2),%q<default>)]
@@ [if(%q<banner>,u(getproperty,%0,banner),u(getmoniker,%0,%1))]
&FUN`FORMATMONITOR [u(cobj,radio)]=ansi(u(opother,%1,RADIO,EDGE),-<)[ansi(hw,RADIO MONITOR: [u(getmoniker,%2)])][if(%4,ansi(c,-SYS))][ansi(u(opother,%1,RADIO,EDGE),>-)]%B[if(cor(%4,%7),ansi(h,name(%0))[if(%7,%BEMIT:%b)] [u(colormarkup,%1,%3,%0)],if(strlen(%6),trim(%6)%B)[u(speech,%0,u(colormarkup,%1,%3,%0),%1,if(strlen(%5),\([u(getmoniker,%0,%1)]\) %5,u(getmoniker,%0,%1)),RADIO,lwho(),%8)])]
&STARTUP [u(cobj,radio)]=@trigger %!/LOOP`CLEANUPRADIO
&LOOP`CLEANUPRADIO [u(Cobj,radio)]=@dolist children(u(cobj,freq))={@attach %!/INC`DOSQL=CLEANUp`RADIO,objid(##),objid(##)};@wait mul(60,60,2)=@trigger %!/LOOP`CLEANUPRADIO
&Q`CLEANUP`RADIO [u(Cobj,radio)]=DELETE m FROM vol_messages AS m LEFT JOIN (SELECT message_id FROM vol_messages as msg WHERE msg.source_objid=? ORDER BY msg.message_date_created DESC LIMIT 100) AS m2 ON m.message_id=m2.message_id WHERE m.source_objid=? AND m2.message_id IS NULL
&OPTION`OPTIONS [u(cobj,radio)]=EDGE|PREFIX|FREQNAME|QUOTES|SPEECH
&OPTION`EDGE [u(Cobj,radio)]=Color for the Radio header edges. -<>-.
&OPTION`EDGE`DEFAULT [u(Cobj,radio)]=hr
&OPTION`EDGE`VALID [u(cobj,radio)]=COLOR
&OPTION`PREFIX [u(Cobj,radio)]=Color for the RADIO: section in headers.
&OPTION`PREFIX`DEFAULT [u(Cobj,radio)]=hw
&OPTION`PREFIX`VALID [u(cobj,radio)]=COLOR
&OPTION`FREQNAME [u(Cobj,radio)]=Color for the Radio Frequency name. You can specify per-channel with +radio/custcolor. This is the fallback.
&OPTION`FREQNAME`DEFAULT [u(Cobj,radio)]=hw
&OPTION`FREQNAME`VALID [u(cobj,radio)]=COLOR
&OPTION`QUOTES [u(Cobj,radio)]=Color the quotations of speech with this. "Blah"
&OPTION`QUOTES`DEFAULT [u(Cobj,radio)]=
&OPTION`QUOTES`VALID [u(cobj,radio)]=COLOR
&OPTION`SPEECH [u(Cobj,radio)]=Color text in quotations. "Blah"
&OPTION`SPEECH`DEFAULT [u(Cobj,radio)]=
&OPTION`SPEECH`VALID [u(cobj,radio)]=COLOR
&INC`LOGRADIO [u(cobj,radio)]=&LASTMSG %1=secs();@attach %!/INC`DOSQL=INSERT`RADIO_LOG/log_id,cor(%3,%6),objid(%1),name(%1),objid(%0),name(%0),%5,%4,%2;@attach %!/INC`DOSQL=RENDER`RADIO_LOG,u(render,%2),%q<log_id>;@attach %!/INC`DOSQL=DELETE`OLD_RADIO;
&Q`INSERT`RADIO_LOG [u(cobj,radio)]=INSERT INTO vol_messages (message_date_created,message_type,message_emit,source_objid,source_name,speaker_objid,speaker_name,speaker_title,speaker_codename,message_contents) VALUES (UTC_TIMESTAMP(),3,?,?,?,?,?,?,?,?)
&Q`RENDER`RADIO_LOG [u(Cobj,radio)]=UPDATE vol_messages SET message_contents_render=? WHERE message_id=?
&Q`DELETE`OLD_RADIO [u(cobj,radio)]=DELETE FROM vol_messages WHERE message_type=3 AND message_date_created<UTC_TIMESTAMP() - INTERVAL 3 DAY
&FIL`LASTRADIO [u(cobj,radio)]=lt(sub(secs(),get(%0/LASTMSG)),u(stringsecs,20d))
&SORTLAST [u(cobj,ccp)]=u(SORTLAST`%va,%0,if(strlen(%1),%1,%B),if(strlen(%2),%2,%B))
&SORTLAST`PENNMUSH [u(cobj,ccp)]=sortkey(#lambda/get(\%0/LASTMSG),%0,n,if(strlen(%1),%1,%B),if(strlen(%2),%2,%B),)
&SORTLAST`RHOSTMUSH [u(cobj,ccp)]=sortby(#lambda/[lit([ncomp(get(%0/LASTMSG),get(%1/LASTMSG))])],%0,if(strlen(%1),%1,%B),if(strlen(%2),%2,%B))
&FUN`FREQNAME [u(cobj,radio)]=u(strfirstof,get(%0/[first(u(wildgrepi,%0,D`RADIO`*,%1))]`NAME),name(%1))
&INC`NSRECALL [u(cobj,radio)]=@attach %!/INC`RECALL=%0,%1,1
&INC`RADMIN`RECALL [u(cobj,radio)]=@attach %!/INC`FINDFREQ;@attach %!/INC`RECALL`DO;
&INC`RADIO`RECALL [u(cobj,radio)]=@attach %!/INC`CHECKSLOT;@attach %!/INC`RECALL`DO;
&INC`RECALL`DO [u(cobj,radio)]=@check strlen(%q<freq>)=@attach %!/INC`MSG=ERROR: That Radio Slot has no Frequency set.;@select/inline %1=0,{th u(setq,max,u(mysql,COUNT`RADIO,objid(%q<freq>)))},{@select/inline strlen(%1)=0,{th u(setq,max,10)},{@check cand(gt(%1,-1),isint(u(setr,max,%1)))=@attach %!/INC`MSG=ERROR: Line Recall must be an integer 0 or greater.}};th u(setq,banner,u(FUN`CONFIG,%q<freq>,BANNER));@check words(u(setr,list,u(mysql,RECALL`RADIO_IDS,objid(%q<freq>),%q<max>)))=@attach %!/INC`MSG=ERROR: Nothing to recall!;@pemit %#=u(header,Frequency: %q<slotname>);@dolist %q<list>={th u(setq,row,u(mysql3,RECALL`RADIO,##));@pemit %#=(On [u(fancytime,u(elements,%q<row>,4,u(fsep)),%#)])%B[u(FUN`FORMAT[if(u(getstat,%#,D`RADIO,Monitor),MONITOR,BROADCAST)],u(elements,%q<row>,1,u(fsep)),%#,%q<freq>,u(elements,%q<row>,5,u(fsep)),u(elements,%q<row>,6,u(fsep)),u(elements,%q<row>,3,u(fsep)),u(elements,%q<row>,2,u(fsep)),u(elements,%q<row>,6,u(fsep)),%2)];@select/inline #@=words(%q<list>),{@pemit %#=u(footer)}}
@@ %0 - Enactor, %1 - recipient, %2 - frequency, %3 - message, %4 - System msg mode, %5 - codename, %6 - title, %7 - emit mode. %8 - Banner.
&Q`COUNT`RADIO [u(cobj,radio)]=SELECT COUNT(*) FROM vol_messages WHERE source_objid=?
&Q`RECALL`RADIO_IDS [u(cobj,radio)]=SELECT r.message_id FROM (SELECT * FROM vol_messages WHERE message_type=3 AND source_objid=? ORDER BY message_date_created DESC LIMIT ?) AS r ORDER BY r.message_date_created ASC
&Q`RECALL`RADIO [u(cobj,radio)]=SELECT speaker_objid,speaker_title,speaker_codename,UNIX_TIMESTAMP(message_date_created),message_contents,message_emit FROM vol_messages WHERE message_id=?
&PLAYER`DISCONNECT [u(cobj,radio)]=@stop %1;@dolist/inline u(getstat,%0,D`RADIO,GAG)={@attach %!/INC`DISABLE`GAG=objid(%0),objid(%i0)};th u(delstat,%0,D`RADIO,GAG)
@@ COMMUNICATIONS - +RADIO
&HLP`RADIO [u(cobj,radio)]=The Radio System is a customizable series of soft-channels meant to represent in-character radio frequencies, IC chat rooms, and other venues of instant communication.%R[ansi(hc,Aliases:)] radio%R%R%R[ansi(hc,Concepts)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,Channel)] - A Radio Channel behaves like a hardcoded channel\, distributing messages to connected players.%R[ansi(h,Alias)] - Players link/connect to channels by making ALIASES\. You configure the alias and send messages over it.%R[ansi(h,Names)] - Channel/Alias names obey the following rules: no spaces\, no / characters\, no ` characters\, must be a valid attribute name and object name. The simpler the better. Recommend only alphanumeric characters\, - and _.%R[ansi(h,codename)] - An alternate name you appear as. Codenames must be unique and can't match player names.%R[ansi(h,Hidden Channels)] - Frequencies SEE-locked do not appear on the public directory. They're listed in [ansi(hx,dark text)] in listings. For more information see +help +radio/Locks)]%R%R[ansi(hc,Listing Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radmin/create <name>\[/<alias>\])] - Create a new Radio Channel owned by you. Also joins you to it. Alternate alias name is optional. See +help +radio/Administration for configuration details.%R[ansi(h,+radio/directory)] - Lists the directory of Radio channels.%R[ansi(h,+radmin/info <name>)] - View details about a specific Radio Channel.)]%R%R[ansi(hc,Alias Configuration)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radio)] - Display your configured channels.%R[ansi(h,+radio/join <name>\[/<alias>\])] - Creates a new Radio Alias and sets it to <name>\, or an optional included alternate name. This is the only +radio command that targets Channel directly!%R[ansi(h,+radio/leave <alias>)] - Erase the alias and leave the channel if it was your only one.%R[ansi(h,+radio/title <alias>=<title>)] - Set a title to appear before your name. Keep it short and sweet!%R[ansi(h,+radio/codename <alias>=<new codename>)] - Sets your Codename on an Alias. Set to nothing to clear it.%R[ansi(h,+radio/alias <alias>=<new alias>)] - Renames a slot/alias.%R[ansi(h,+radio/custcolor <slot>=<colorcode>)] - Set a color for a radio frequency. Enter nothing to clear color settings.%R[ansi(h,+radio/nospoof)] - Toggle whether real names are shown next to codenames if a codename's in use.%R[ansi(h,.<slot>/<switch> <entry>)] - Equivalent to +radio/<switch> <slot>=<entry> - useful for .<slot>/gag\, etc.%R[ansi(h,+radio/options)] - Works just like +options but specific to +radio. +help +options)]%R%R[ansi(hc,Messaging Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radio <slot>=<speech>)] - Send a message over <slot>'s Frequency.%R[ansi(h,.<slot> <speech>)] - Shortcut for sending messages. Inspired by hardcoded channels. Example: [ansi(h,.broadband hello!)]%R[ansi(h,+radio/off <alias>)] - Turns a slot off. Disabled slots can't send or receive messages. The opposite is /on.%R[ansi(h,+radio/gag <alias>)] - Temporarily stop receiving messages from a given channel. Cleared upon logoff or use of /ungag.%R[ansi(h,+radio/emit <alias>=<message>)] - Send an unformatted message if you have Moderate permission.)]%R%R[ansi(hc,Misc)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radio/recall <alias>=<#>)] - recalls <#> of lines from <slot>'s frequency. If <#> is blank\, defaults to 10 lines. If 0\, shows ALL recorded messages.%R[ansi(h,+radio/nsrecall <alias>=<#>)] - Like /recall\, but as though nospoof were turned on.%R\(You may also use +radmin/recall and +radmin/nsrecall to recall by targeting Channels instead of Aliases\)[ansi(h,+radio/who <alias>)] - See who's listening to a frequency.)]
+help/add Communications/+radio=[u(cobj,radio)]/HLP`RADIO
&HLP`FORMATTER [u(cobj,radio)]=[ansi(hc,Formatters)]%R%TJust like @chatformat, @pageformat, and similar hardcoded commands, +radio supports the ability to set custom formatters to change how you receive the message. This is an advanced topic and should not be used unless you're familiar with setting and clearing attributes.%R%TEach Radio slot will check your character for a corresponding RADIO_<slotname> attribute. If you created a slot called Police with +radio/init Police=11.17, you'd need to set an attribute called RADIO_POLICE. example: &RADIO_POLICE me=\%5.%R%TThis attribute is called via a ulocal(). It is passed the following arguments for substitution purposes, just like @chatformat:%R\%0 - The type of the message. " for say, : for pose, ; for semipose, | for an emit.%R\%1 - The frequency name.%R\%2 - The message contents.%R\%3 - The name of the speaker. Will be 'Someone' if it's an Emit.%R\%4 - The speaker's title.%R\%5 - The default message as if no formatter was set.%R\%6 - like \%5 but minus the default header.%R\%7 - The speaker's codename.%R\%8 - The frequency number.%R%TThis attribute WILL be moved if you rename a slot.%R%RTO DELETE A FORMATTER, SIMPLY CLEAR THE ATTRIBUTE. Example:%R%T&RADIO_POLICE me%R%T@wipe me/RADIO_POLICE%R(either will work.)%R%RDeleting the +radio slot will also delete the associated formatter.
+help/addsub +radio/Formatter=[u(cobj,hlp)]/HLP`FORMATTER
&HLP`ADMINISTRATION [u(Cobj,radio)]=[ansi(hc,Concepts)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,Owner)] - The person who created a Radio Channel 'owns' it. They implicitly have all privileges.%R[ansi(h,Moderator)] - Moderators are players chosen by the Owner/Admin to have the power to restrict access to a Radio Channel for rules infractions.%R[ansi(h,Admin)] - Anyone with Admin status can make sweeping changes to the channel such as renaming it or appointing moderators. Anything but /chown'ing it.)]%R%R[ansi(hc,Locks)]%RNote: MODERATORS and ADMIN bypass the SEE\, JOIN\, and SPEAK locks!%R[align(5 [sub(u(width,%#),6)],,[ansi(h,SEE)] - #TRUE by default. Who can SEE the channel in Directory. It will also not be checked in partial matches unless the viewer can SEE it. This alone does not prevent people from stumbling over it using its Exact Name. JOIN will though!%R[ansi(h,JOIN)] - #TRUE by default. Who can JOIN the Channel.%R[ansi(h,SPEAK)] - #TRUE by default. Controls who can send messages over the Frequency.%R[ansi(h,MODERATE)] - #FALSE by default. Grants the same powers as /addmod.%R[ansi(h,ADMIN)] - #FALSE by default. Grants Admin privileges.)]%R%R[ansi(hc,Admin Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radmin/create <name>\[/<alias>\])] - Create a new Radio Channel owned by you. Also joins you to it. Alternate alias name is optional.%R[ansi(h,+radmin/chown <name>=<new owner>)] - Transfer ownership of a Channel. Owner only.%R[ansi(h,+radmin/rename <name>=<new name>)] - Change the Radio Channel's global name.%R[ansi(h,+radmin/lock <name>/<lock>=<lockstring>)] - Locks the Radio. Uses the LockGen system if Groups system is available\, else uses ordinary MUSH @lock keys. Use /rawlock to specify MUSH @lock keys anyways.%R[ansi(h,+radio/unlock <alias>/<lock>)] - Release a lock back to its default.%R[ansi(h,+radmin/addmod <name>=<player>)] - Assign a moderator to a Radio Channel. Can be revoked with /delmod.%R[ansi(h,+radmin/config <name>/<option>=<value>)] - Change settings. Value must be BOOL: 1 or 0 for Enable or Disable.%R%T[ansi(h,codename)] - channel allows codenames.%R%T[ansi(h,title)] - channel allows titles.%R[ansi(h,+radmin/describe <name>=<description>)] - Set the radio's description. This is visible in +radio/info. Useful for rules and guidelines\, etc.%R[ansi(h,+radmin/summary <name>=<text>)] - Use up to 41 characters to describe the channel for +radio/directory.)]%R%R[ansi(hc,Moderator Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radmin/ban <name>=<player>)] - Prevent <player> from speaking on a channel.%R[ansi(h,+radmin/muzzle <name>=<player>/<duration>)] - Muzzle a player until <duration> has passed. They cannot speak on the channel. Use /unmuzzle to undo. Check +help Validators for <duration> info.%R[ansi(h,+radmin/emit <alias>=<message>)] - Send an anonymous message over a Radio Channel.)]
+help/addsub +radio/Administration=[u(cobj,radio)]/HLP`ADMINISTRATION
&SHLP`RADIO [u(cobj,radio)]=Staff count as owners and moderators of all Radio Channels.%R[ansi(hc,Staff Commands)]%R[align(5 [sub(u(width,%#),6)],,[ansi(h,+radmin/monitor)] - toggles Monitor mode. While in Monitor mode\, you will receive ALL messages from ALL frequencies.%R[ansi(h,+radmin/ban <name>=<player>)] - Prevent <player> from speaking on a channel.%R[ansi(h,+radmin/muzzle <name>=<player>/<duration>)] - Muzzle a player until <duration> has passed. They cannot speak on the channel. Use /unmuzzle to undo.%R[ansi(h,+radmin/emit <name>=<message>)] - Send an anonymous message over a Radio Channel.%R[ansi(h,+radmin/accmuzzle <name>=<player>/<duration>)] - As with /muzzle but restricts whole account. undone with /unaccmuzzle.%R%RMonitor mode will apply when using +radmin/recall%R%R/muzzle reprinted here for simplicity. Moderators have it too.)]
+shelp/add Communications/+radio=[u(cobj,radio)]/SHLP`RADIO