-
Notifications
You must be signed in to change notification settings - Fork 0
/
Port System.txt
24 lines (14 loc) · 2.37 KB
/
Port 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
@skip isdbref(tag(setr(1,port)))={@assert/inline isdbref(globalroom())=@pemit %#=ERROR: No master room set!;@assert/inline isdbref(setr(0,create(Port System,,t)))=@pemit %#=ERROR: Could not create code object %q1: %q0;@set %q0=INDESTRUCTIBLE !NO_COMMAND;@tag/add %q1=%q0;@tel %q0=globalroom()}
&CMD.PORT #port=$^(?s)(?\:\+)(port)(?\:/(\\S+)?)?(?\: +(.+?))?(?\:=(.*))?$:@attach #inc/GET_SWITCH=%2;@attach %!/SW.[strfirstof(%q<switch>,MAIN)]=%3,%4
@set #port/CMD.PORT=regexp
&SWITCHES.0 #port=LIST
&SW.MAIN #port=@assert/inline strlen(%0)=@pemit %#=+port where? +port/list to search.;@assert/inline cand(isdbref(%0),hastype(%0,ROOM),isdbref(upzone(%0)))=@pemit %#=That's not a good target.;@assert/inline elock(%0/TportLock,%#)=@pemit %#=Permission denied. You don't pass the TportLock.;@remit %l=%k vanishes in a flash using +port.;@tel %#=%0;@remit %l=%k appears in a flash using +port.
&FN.LIST_ROOMS #port=iter(%0,filter(FIL.ROOM,lzone(%i0)),%B,%B)
&FIL.ACCESSIBLE #port=elock(%0/TportLock,%1)
&FIL.SEARCH #port=cand(u(FIL.ACCESSIBLE,%0,%1),strmatch(name(%0),*%2*))
&LIST_REGION #port=@if words(setr(!,sortname(filter(FIL.[if(strlen(%1),SEARCH,ACCESSIBLE)],u(#reg/FN.ROOMS,%0),%b,%b,%#,%1)),rooms))={@pemit %#=separator([iter(revwords(upzones(%0)) %0,cname(%i0),%b,%b-%b)]);@pemit %#=columns(iter(%q<rooms>,ljust(%i0,7) [cname(%i0)],%b,|),37,2,l,,1,,,,1,|,,1)};@if words(setr(!,u(#reg/FN.BRANCHES,%0),sub))={@dolist/inline %q<sub>=@attach %!/LIST_REGION=%d0,%1}
&SW.LIST #port=@if strlen(%0)=@pemit %#=header(if(strlen(%0),Rooms Matching: *%0*,Room List));@if words(setr(!,u(#reg/FN.ROOTS),roots))={@dolist/inline %q<roots>={@attach %!/LIST_REGION=%d0,%0}};@pemit %#=footer()
&HLP.PORT #port=A handy tool for quickly teleporting around the game grid to publically accessible locations.%R%R[ansi(hc,Commands)]%R%R[ansi(hw,+port/list \[<name>\])]%R%TDisplays (and optionally filters by name) candidate rooms.%R%R[ansi(hw,+port <target>)]%R%TTeleport to a specific room. <target> must be the room's dbref.
+help/add Navigation/+port=#port/HLP.PORT
+shelp/add Navigation/+port=#port/SHLP.PORT
&SHLP.PORT #port=+port controls access to destinations by the TportLock on Rooms. The default TportLock on Rooms in this codesuite is to check the TportLock on the Upzones in sequence and, if any allow it, the lock passes. This means it's most effective to control access to root @regions while sub-regions offer finer control.