Airlock/Hatch/Port/Pad System v1.1 Commands: list ports (*) - allows you to see the status of all ports where you are docked list pads (*) - allows you to see the status of all pads where you are landed port list - lists ports on the base/planet/ship you are on pad list - list pads on the base/planet/ship you are on clamp - clamps given pad/port so a ship can either a) not disconnect from that pad/port (if a ship is there), or b) not connect to that pad/port (if no ship is there) unclamp - reverse of clamp connect/pad (*) - connects your landed vessel's hatch/airhatch to supplied pad connect/port (*) - connects your docked vessel's airlock/airhatch to supplied port disconnect (*) - disconnects your ship from a pad/port All commands marked (*) can be executed from the room of the airlock/hatch/airhatch. Builder commands: @space/install [hatch|airlock|port|pad]= @space/uninstall [hatch|airlock|port|pad]= Both these commands are restricted to WIZ/ROY/Builders. Remember, if you install an airlock (or a hatch) on a ship that can dock/land, it can automatically be connected to ports and pads. Installing it... The following commands need to be added to the Fighter/Shuttle, Operations, Helm, Security, Monitor modes of the consoles. You will need to find and replace #252 (24 occcurences) with the DBREF of your $resource object (the one that has the fn_all_console_cmd attribute). Your space builder should have the @name space or at least have the alias space. If this is not possible, change =space to = (four occurences). You will also need to login and use your 'Space' character to install this stuff with. &HATCH_STAT Fighter/Shuttle=$hatch stat:th [setq(0,[zone(here)])][setq(1,[get(%q0/SPACE_AIRLOCKHATCH)])][pemit(%#,[ifelse([or([not([extract([get(%q0/STRUCTURE)],9,1)])],[switch(%q1,,1,0)])],[ansi(r,[name(%q0)] has no hatch.)],[ansi(b,\[)][ansi(yh,[name(%q1)])][ansi(b,\]--\[)][ansi(c,Currently [switch([loc(%q1)],#-*,not connected,connected to '[name([get(%q0/SPACE_AHCONNECT)])]' on [name([zone([loc(%q1)])])])][switch([get([get(%q0/SPACE_AHCONNECT)]/CLAMP)],1,%band is clamped)])][ansi(b,\])])])] &AIRLOCK_STAT Fighter/Shuttle=$airlock stat:th [setq(0,[zone(here)])][setq(1,[get(%q0/SPACE_AIRLOCKHATCH)])][pemit(%#,[ifelse([or([not([extract([get(%q0/STRUCTURE)],10,1)])],[switch(%q1,,1,0)])],[ansi(r,[name(%q0)] has no airlock.)],[ansi(b,\[)][ansi(yh,[name(%q1)])][ansi(b,\]--\[)][ansi(c,Currently [switch([loc(%q1)],#-*,not connected,connected to '[name([get(%q0/SPACE_AHCONNECT)])]' on [name([zone([loc(%q1)])])])][switch([get([get(%q0/SPACE_AHCONNECT)]/CLAMP)],1,%band is clamped)])][ansi(b,\])])])] &LIST_PADS Fighter/Shuttle=$list pads:th [setq(0,[sdb(get,[get([zone(here)]/SDB)],status,landed)])][setq(1,[sdb(get,%q0,object)])][setq(2,[get(%q1/SPACE_PADS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[ifelse([not(%q0)],[ansi(r,[name([zone(here)])] is not landed.)],[header_l(Pads on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no pads.,79)])],[ansi(wh,[space(6)][ljust(Pad,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])])] &LIST_PORTS Fighter/Shuttle=$list ports:th [setq(0,[sdb(get,[get([zone(here)]/SDB)],status,docked)])][setq(1,[sdb(get,%q0,object)])][setq(2,[get(%q1/SPACE_PORTS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[ifelse([not(%q0)],[ansi(r,[name([zone(here)])] is not docked.)],[header_l(Ports on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no ports.,79)])],[ansi(wh,[space(6)][ljust(Port,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])])] &PORT_LIST Fighter/Shuttle=$port list:th [setq(1,[zone(here)])][setq(2,[get(%q1/SPACE_PORTS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[header_l(Ports on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no ports.,79)])],[ansi(wh,[space(6)][ljust(Port,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])] &PAD_LIST Fighter/Shuttle=$pad list:th [setq(1,[zone(here)])][setq(2,[get(%q1/SPACE_PADS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[header_l(Pads on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no pads.,79)])],[ansi(wh,[space(6)][ljust(Pad,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])] &CONNECT_PAD Fighter/Shuttle=$connect/pad *:th [setq(1,[get([zone(here)]/SDB)])][setq(2,[sdb(get,%q1,status,landed)])][setq(0,[sdb(get,%q2,object)])][setq(3,[name([zone(here)])])][setq(4,[get([zone(here)]/SPACE_AIRLOCKHATCH)])][setq(5,[get(%q0/SPACE_PADS)])][setq(6,[member([iter(%q5,[strmatch([name(##)],*%0*)])],1)])][setq(7,[extract(%q5,%q6,1)])][pemit(%#,[ifelse([or([not([hasattr([zone(here)],SPACE_AIRLOCKHATCH)])],[not([extract([get([zone(here)]/STRUCTURE)],9,1)])])],[ansi(r,%q3 has no hatch.)],[ifelse([not(%q2)],[ansi(r,%q3 is not landed.)],[ifelse([switch([loc(%q4)],#-*,0,1)],[ansi(r,[name(%q4)] is already opened.)],[ifelse([not(%q6)],[ansi(r,'%0' is not a valid pad.)],[ifelse([switch([loc(%q7)],#-*,0,1)],[ansi(r,'[name(%q7)]' is already in use.)],[ifelse([get(%q7/clamp)],[ansi(r,'[name(%q7)]' is clamped.)],[setq(9,[link(%q7,[home(%q4)])][link(%q4,[home(%q7)])][remit([home(%q7)],[u(#252/msg_connect_pp,[name(%q4)],[name([zone(here)])],[name(%q7)],[name(%q0)])])][remit([home(%q4)],[u(#252/msg_connect_ah,[name(%q4)],[name([zone(here)])],[name(%q7)],[name(%q0)])])][sdb(put,%q1,1,status,connected)][set([zone(here)],SPACE_AHCONNECT:%q7)][u(#252/fn_all_console_cmd,[zone(here)],[name(%q4)] connected with '[name(%q7)]' on [name(%q0)])])])])])])])])])] &CONNECT_PORT Fighter/Shuttle=$connect/port *:th [setq(1,[get([zone(here)]/SDB)])][setq(2,[sdb(get,%q1,status,docked)])][setq(0,[sdb(get,%q2,object)])][setq(3,[name([zone(here)])])][setq(4,[get([zone(here)]/SPACE_AIRLOCKHATCH)])][setq(5,[get(%q0/SPACE_PORTS)])][setq(6,[member([iter(%q5,[strmatch([name(##)],*%0*)])],1)])][setq(7,[extract(%q5,%q6,1)])][pemit(%#,[ifelse([or([not([hasattr([zone(here)],SPACE_AIRLOCKHATCH)])],[not([extract([get([zone(here)]/STRUCTURE)],10,1)])])],[ansi(r,%q3 has no airlock.)],[ifelse([not(%q2)],[ansi(r,%q3 is not docked.)],[ifelse([switch([loc(%q4)],#-*,0,1)],[ansi(r,[name(%q4)] is already opened.)],[ifelse([not(%q6)],[ansi(r,'%0' is not a valid port.)],[ifelse([switch([loc(%q7)],#-*,0,1)],[ansi(r,'[name(%q7)]' is already in use.)],[ifelse([get(%q7/clamp)],[ansi(r,'[name(%q7)]' is clamped.)],[setq(9,[link(%q7,[home(%q4)])][link(%q4,[home(%q7)])][remit([home(%q7)],[u(#252/msg_connect_pp,[name(%q4)],[name([zone(here)])],[name(%q7)],[name(%q0)])])][remit([home(%q4)],[u(#252/msg_connect_ah,[name(%q4)],[name([zone(here)])],[name(%q7)],[name(%q0)])])][sdb(put,%q1,1,status,connected)][set([zone(here)],SPACE_AHCONNECT:%q7)][u(#252/fn_all_console_cmd,[zone(here)],[name(%q4)] connected with '[name(%q7)]' on [name(%q0)])])])])])])])])])] &DISCONNECT Fighter/Shuttle=$disconnect:th [pemit(%#,[setq(0,[get([zone(here)]/SDB)])][setq(1,[name([zone(here)])])][setq(2,[get([zone(here)]/SPACE_AIRLOCKHATCH)])][setq(3,[get([zone(here)]/SPACE_AHCONNECT)])][ifelse([not([hasattr([zone(here)],SPACE_AIRLOCKHATCH)])],[ansi(r,There is no airlock or hatch on this vessel.)],[ifelse([not([sdb(get,%q0,status,connected)])],[ansi(r,%q1 is not connected.)],[ifelse([not([or([sdb(get,%q0,status,docked)],[sdb(get,%q0,status,landed)])])],[ansi(r,%q1 is not docked or landed.)],[ifelse([get(%q3/clamp)],[ansi(r,%q1 is clamped to '[name(%q3)]'.)],[set([zone(here)],SPACE_AHCONNECT:)][remit([home(%q2)],[u(#252/msg_disconnect_ah,[name(%q2)],%q1,[name(%q3)],[name([zone([home(%q3)])])])])][remit([loc(%q2)],[u(#252/msg_disconnect_pp,[name(%q2)],%q1,[name(%q3)],[name([zone([home(%q3)])])])])][setq(9,[sdb(put,%q0,0,status,connected)])][u(#252/fn_all_console_cmd,[zone(here)],[name(%q2)] disconnects from '[name(%q3)]' on [name([zone([home(%q3)])])])][link(%q3,)][link(%q2,)])])])])])] &CLAMP Fighter/Shuttle=$clamp *:th [pemit(%#,[setq(0,[squish([get([zone(here)]/SPACE_PORTS)]%b[get([zone(here)]/SPACE_PADS)])])][setq(1,[member([iter(%q0,[strmatch([name(##)],*%0*)])],1)])][switch(%q1,0,[ansi(r,'%0' is not a valid port/pad.)],[ifelse([get([extract(%q0,%q1,1)]/CLAMP)],[ansi(r,'[name([extract(%q0,%q1,1)])]' clamps already engaged.)],[setq(2,[set([extract(%q0,%q1,1)],CLAMP:1)][remit([loc([extract(%q0,%q1,1)])],[u(#252/msg_clamp_ah,[name([get([zone([loc([extract(%q0,%q1,1)])])]/SPACE_AIRLOCKHATCH)])],[name([zone([loc([extract(%q0,%q1,1)])])])],[name([extract(%q0,%q1,1)])],[name([zone(here)])])])][remit([home([extract(%q0,%q1,1)])],[u(#252/msg_clamp_pp,[name([get([zone([loc([extract(%q0,%q1,1)])])]/SPACE_AIRLOCKHATCH)])],[name([zone([loc([extract(%q0,%q1,1)])])])],[name([extract(%q0,%q1,1)])],[name([zone(here)])])])])][u(#252/fn_all_console_cmd,[zone(here)],Clamps engaged on '[name([extract(%q0,%q1,1)])]')])])])] &UNCLAMP Fighter/Shuttle=$unclamp *:th [pemit(%#,[setq(0,[squish([get([zone(here)]/SPACE_PORTS)]%b[get([zone(here)]/SPACE_PADS)])])][setq(1,[member([iter(%q0,[strmatch([name(##)],*%0*)])],1)])][switch(%q1,0,[ansi(r,'%0' is not a valid port/pad.)],[ifelse([not([get([extract(%q0,%q1,1)]/CLAMP)])],[ansi(r,'[name([extract(%q0,%q1,1)])]' clamps already disengaged.)],[setq(2,[set([extract(%q0,%q1,1)],CLAMP:0)][remit([loc([extract(%q0,%q1,1)])],[u(#252/msg_unclamp_ah,[name([get([zone([loc([extract(%q0,%q1,1)])])]/SPACE_AIRLOCKHATCH)])],[name([zone([loc([extract(%q0,%q1,1)])])])],[name([extract(%q0,%q1,1)])],[name([zone(here)])])])][remit([home([extract(%q0,%q1,1)])],[u(#252/msg_unclamp_pp,[name([get([zone([loc([extract(%q0,%q1,1)])])]/SPACE_AIRLOCKHATCH)])],[name([zone([loc([extract(%q0,%q1,1)])])])],[name([extract(%q0,%q1,1)])],[name([zone(here)])])])])][u(#252/fn_all_console_cmd,[zone(here)],Clamps released from '[name([extract(%q0,%q1,1)])]')])])])] These commands are for wiz/roy/builders to install port/pads/airlock/hatches. Whatever object they go on, it must be set WIZARD. &CMD_@SPACE-UNINSTALL $@space commands=$@space/uninstall *=*:@switch [or([or([hasflag(%#,wizard)],[hasflag(%#,royalty)])],[haspower(%#,builder)])]=1,{@switch/first [ucstr(%0)]=HATCH,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [get([zone([home(%q0)])]/SPACE_AIRLOCKHATCH)]=%q0,{@chown %q0=[owner([home(%q0)])];@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&SPACE_AIRLOCKHATCH [zone([home(%q0)])]=;@pemit %#='[name(%q0)]' is no longer a hatch.},{@pemit %#='[name(%q0)]' is not a hatch.}}},AIRLOCK,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [get([zone([home(%q0)])]/SPACE_AIRLOCKHATCH)]=%q0,{@chown %q0=[owner([home(%q0)])];@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&SPACE_AIRLOCKHATCH [zone([home(%q0)])]=;@pemit %#='[name(%q0)]' is no longer an airlock.},{@pemit %#='[name(%q0)]' is not an airlock.}}},PORT,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [member([get([zone([home(%q0)])]/SPACE_PORTS)],%q0)]=0,{@pemit %#='[name(%q0)]' is not a port.},{@pemit %#='[name(%q0)]' is no longer a port.;&SPACE_PORTS [zone([home(%q0)])]=[remove([get([zone([home(%q0)])]/SPACE_PORTS)],%q0)];@switch [not([member([get([zone([home(%q0)])]/SPACE_PADS)],%q0)])]=1,{@chown %q0=[owner([home(%q0)])];@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&clamp %q0}}}},PAD,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [member([get([zone([home(%q0)])]/SPACE_PADS)],%q0)]=0,{@pemit %#='[name(%q0)]' is not a pad.},{@pemit %#='[name(%q0)]' is no longer a pad.;&SPACE_PADS [zone([home(%q0)])]=[remove([get([zone([home(%q0)])]/SPACE_PADS)],%q0)];@switch [not([member([get([zone([home(%q0)])]/SPACE_PORTS)],%q0)])]=1,{@chown %q0=[owner([home(%q0)])];@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&clamp %q0}}}},{@pemit %#=You can only uninstall a HATCH, AIRLOCK, PORT or PAD.}},{@pemit %#=Permission denied.} &CMD_@SPACE-INSTALL $@space commands=$@space/install *=*:@switch [or([or([hasflag(%#,wizard)],[hasflag(%#,royalty)])],[haspower(%#,builder)])]=1,{@switch/first [ucstr(%0)]=HATCH,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [extract([get([zone([home(%q0)])]/STRUCTURE)],9,1)]=0,{@pemit %#=You can only install hatches on objects that can land.},{@switch [get([zone([home(%q0)])]/SPACE_AIRLOCKHATCH)]=%q0,{@pemit %#='[name(%q0)]' is already a hatch.},{@chown %q0=SPACE;@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&SPACE_AIRLOCKHATCH [zone([home(%q0)])]=%q0;@pemit %#='[name(%q0)]' converted to a hatch.}}}},AIRLOCK,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [extract([get([zone([home(%q0)])]/STRUCTURE)],10,1)]=0,{@pemit %#=You can only install airlocks on objects that can dock.},{@switch [get([zone([home(%q0)])]/SPACE_AIRLOCKHATCH)]=%q0,{@pemit %#='[name(%q0)]' is already an airlock.},{@chown %q0=SPACE;@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&SPACE_AIRLOCKHATCH [zone([home(%q0)])]=%q0;@pemit %#='[name(%q0)]' converted to an airlock.}}}},PORT,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [not([member([get([zone([home(%q0)])]/SPACE_PORTS)],%q0)])]=0,{@pemit %#='[name(%q0)]' is already a port.},{@chown %q0=SPACE;@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&clamp %q0=0;&SPACE_PORTS [zone([home(%q0)])]=[squish([get([zone([home(%q0)])]/SPACE_PORTS)]%b%q0)];@pemit %#='[name(%q0)]' converted to a port.}}},PAD,{@switch [switch([ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)],#-*,0,[setq(0,[ifelse([not([hastype(%1,EXIT)])],[locate([loc(%#)],%1,e)],%1)])]1)]=0,{@pemit %#=Invalid exit.},{@switch [not([member([get([zone([home(%q0)])]/SPACE_PADS)],%q0)])]=0,{@pemit %#='[name(%q0)]' is already a pad.},{@chown %q0=SPACE;@set %q0=!halt;@chzone %q0=[zone([home(%q0)])];&clamp %q0=0;&SPACE_PADS [zone([home(%q0)])]=[squish([get([zone([home(%q0)])]/SPACE_PADS)]%b%q0)];@pemit %#='[name(%q0)]' converted to a pad.}}},{@pemit %#=You can only install a HATCH, AIRLOCK, PORT or PAD.}},{@pemit %#=Permission denied.} &FUNC_HEADER_L $@space commands=[switch([lt(%1,[add([strlen(%0)],6)])],#-*,[switch(%1,,#-1 FUNCTION \(HEADER_L\) EXPECTS 2 ARGUMENTS,#-1 INVALID LENGTH)],1,#-1 INVALID LENGTH,[ansi(bh,--)][ansi(bh,\[)][ansi(yh,%0)][ansi(bh,\])][ansi(bh,--)][repeat([ansi(bh,-)],[sub([sub(%1,6)],[strlen(%0)])])])] &FUNC_HEADER_R $@space commands=[switch([lt(%1,[add([strlen(%0)],6)])],#-*,[switch(%1,,#-1 FUNCTION \(HEADER_R\) EXPECTS 2 ARGUMENTS,#-1 INVALID LENGTH)],1,#-1 INVALID LENGTH,[repeat([ansi(bh,-)],[sub([sub(%1,6)],[strlen(%0)])])][ansi(bh,--)][ansi(bh,\[)][ansi(yh,%0)][ansi(bh,\])][ansi(bh,--)])] &FUNC_HEADER_LR $@space commands=[switch([lt(%2,[add([strlen(%0)],[strlen(%1)],12)])],#-*,[switch(%2,,#-1 FUNCTION \(HEADER_LR\) EXPECTS 3 ARGUMENTS,#-1 INVALID LENGTH)],1,#-1 INVALID LENGTH,[ansi(bh,--)][ansi(bh,\[)][ansi(yh,%0)][ansi(bh,\])][ansi(bh,--)][repeat([ansi(bh,-)],[sub([sub([sub(%2,12)],[strlen(%0)])],[strlen(%1)])])][ansi(bh,--)][ansi(bh,\[)][ansi(yh,%1)][ansi(bh,\])][ansi(bh,--)])] @STARTUP $@space commands=@function header_l=me,func_header_l;@function header_r=me,func_header_r;@function header_lr=me,func_header_lr @trig $@space commands/startup These are the global commands that allows players to open/close an airlock whilst standing in the same rooms as the airlock/hatch. The object you put these on must be set WIZARD. &GLOBAL_LIST_PADS Airlock/Hatch Globals=$list pads:@switch [loc(%#)]=[home([get([zone(loc(%#))]/SPACE_AIRLOCKHATCH)])],{th [setq(0,[sdb(get,[get([zone([loc(%#)])]/SDB)],status,landed)])][setq(1,[sdb(get,%q0,object)])][setq(2,[get(%q1/SPACE_PADS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[ifelse([not(%q0)],[ansi(r,[name([zone([loc(%#)])])] is not landed.)],[header_l(Pads on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no pads.,79)])],[ansi(wh,[space(6)][ljust(Pad,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])])]},{@pemit %#=Huh?%b%b\(Type "help" for help.\)} &GLOBAL_LIST_PORTS Airlock/Hatch Globals=$list ports:@switch [loc(%#)]=[home([get([zone(loc(%#))]/SPACE_AIRLOCKHATCH)])],{th [setq(0,[sdb(get,[get([zone([loc(%#)])]/SDB)],status,docked)])][setq(1,[sdb(get,%q0,object)])][setq(2,[get(%q1/SPACE_PORTS)])][setq(9,[squish([iter(%q2,[switch([get(##/DARK)],1,,##)])])])][setq(2,[sort([iter(%q9,[edit([name(##)],%b,_)]|##)],a)])][setq(9,[iter(%q2,[last(##,|)])])][pemit(%#,[ifelse([not(%q0)],[ansi(r,[name([zone([loc(%#)])])] is not docked.)],[header_l(Ports on [name(%q1)],79)]%r%r[ifelse([not([words(%q9)])],[ansi(r,[center(There are no ports.,79)])],[ansi(wh,[space(6)][ljust(Port,21)][ljust(Location,26)]Status)]%r%b[iter(%q9,[setq(3,[get(##/CLAMP)])][setq(4,[switch([loc(##)],#-*,1,0)])][space(5)][ansi([switch(%q3,1,rh,[switch(%q4,0,yh,gh)])],[ljust([left([name(##)],20)],21)])][ansi(w,[ljust([left([name([home(##)])],25)],26)])][switch(%q4,1,[ansi(w,Not in use)],[ansi(w,[left([name([zone([loc(##)])])],25)])])]%r)]%r[center([ansi(rh,CLAMPED)][space(10)][ansi(yh,IN USE)][space(10)][ansi(gh,AVAILABLE)],79)])]%r%r[ansi(bh,[repeat(-,79)])])])]},{@pemit %#=Huh?%b%b\(Type "help" for help.\)} &GLOBAL_CONNECT_PAD Airlock/Hatch Globals=$connect/pad *:@switch [loc(%#)]=[home([get([zone(loc(%#))]/SPACE_AIRLOCKHATCH)])],{th [setq(1,[get([zone([loc(%#)])]/SDB)])][setq(2,[sdb(get,%q1,status,landed)])][setq(0,[sdb(get,%q2,object)])][setq(3,[name([zone([loc(%#)])])])][setq(4,[get([zone([loc(%#)])]/SPACE_AIRLOCKHATCH)])][setq(5,[get(%q0/SPACE_PADS)])][setq(6,[member([iter(%q5,[strmatch([name(##)],*%0*)])],1)])][setq(7,[extract(%q5,%q6,1)])][pemit(%#,[ifelse([or([not([hasattr([zone([loc(%#)])],SPACE_AIRLOCKHATCH)])],[not([extract([get([zone([loc(%#)])]/STRUCTURE)],9,1)])])],[ansi(r,%q3 has no hatch.)],[ifelse([not(%q2)],[ansi(r,%q3 is not landed.)],[ifelse([switch([loc(%q4)],#-*,0,1)],[ansi(r,[name(%q4)] is already opened.)],[ifelse([not(%q6)],[ansi(r,'%0' is not a valid pad.)],[ifelse([switch([loc(%q7)],#-*,0,1)],[ansi(r,'[name(%q7)]' is already in use.)],[ifelse([get(%q7/clamp)],[ansi(r,'[name(%q7)]' is clamped.)],[setq(9,[link(%q7,[home(%q4)])][link(%q4,[home(%q7)])][remit([home(%q7)],[u(#252/msg_connect_pp,[name(%q4)],[name([zone([loc(%#)])])],[name(%q7)],[name(%q0)])])][remit([home(%q4)],[u(#252/msg_connect_ah,[name(%q4)],[name([zone([loc(%#)])])],[name(%q7)],[name(%q0)])])][sdb(put,%q1,1,status,connected)][set([zone([loc(%#)])],SPACE_AHCONNECT:%q7)][u(#252/fn_all_console_cmd,[zone([loc(%#)])],[name(%q4)] connected with '[name(%q7)]' on [name(%q0)])])])])])])])])])]},{@pemit %#=Huh?%b%b\(Type "help" for help.\)} &GLOBAL_CONNECT_PORT Airlock/Hatch Globals=$connect/port *:@switch [loc(%#)]=[home([get([zone(loc(%#))]/SPACE_AIRLOCKHATCH)])],{th [setq(1,[get([zone([loc(%#)])]/SDB)])][setq(2,[sdb(get,%q1,status,docked)])][setq(0,[sdb(get,%q2,object)])][setq(3,[name([zone([loc(%#)])])])][setq(4,[get([zone([loc(%#)])]/SPACE_AIRLOCKHATCH)])][setq(5,[get(%q0/SPACE_PORTS)])][setq(6,[member([iter(%q5,[strmatch([name(##)],*%0*)])],1)])][setq(7,[extract(%q5,%q6,1)])][pemit(%#,[ifelse([or([not([hasattr([zone([loc(%#)])],SPACE_AIRLOCKHATCH)])],[not([extract([get([zone([loc(%#)])]/STRUCTURE)],10,1)])])],[ansi(r,%q3 has no airlock.)],[ifelse([not(%q2)],[ansi(r,%q3 is not docked.)],[ifelse([switch([loc(%q4)],#-*,0,1)],[ansi(r,[name(%q4)] is already opened.)],[ifelse([not(%q6)],[ansi(r,'%0' is not a valid port.)],[ifelse([switch([loc(%q7)],#-*,0,1)],[ansi(r,'[name(%q7)]' is already in use.)],[ifelse([get(%q7/clamp)],[ansi(r,'[name(%q7)]' is clamped.)],[setq(9,[link(%q7,[home(%q4)])][link(%q4,[home(%q7)])][remit([home(%q7)],[u(#252/msg_connect_pp,[name(%q4)],[name([zone([loc(%#)])])],[name(%q7)],[name(%q0)])])][remit([home(%q4)],[u(#252/msg_connect_ah,[name(%q4)],[name([zone([loc(%#)])])],[name(%q7)],[name(%q0)])])][sdb(put,%q1,1,status,connected)][set([zone([loc(%#)])],SPACE_AHCONNECT:%q7)][u(#252/fn_all_console_cmd,[zone([loc(%#)])],[name(%q4)] connected with '[name(%q7)]' on [name(%q0)])])])])])])])])])]},{@pemit %#=Huh?%b%b\(Type "help" for help.\)} &GLOBAL_DISCONNECT Airlock/Hatch Globals=$disconnect:@switch [loc(%#)]=[home([get([zone(loc(%#))]/SPACE_AIRLOCKHATCH)])],{th [pemit(%#,[setq(0,[get([zone([loc(%#)])]/SDB)])][setq(1,[name([zone([loc(%#)])])])][setq(2,[get([zone([loc(%#)])]/SPACE_AIRLOCKHATCH)])][setq(3,[get([zone([loc(%#)])]/SPACE_AHCONNECT)])][ifelse([not([hasattr([zone([loc(%#)])],SPACE_AIRLOCKHATCH)])],[ansi(r,There is no airlock or hatch on this vessel.)],[ifelse([not([sdb(get,%q0,status,connected)])],[ansi(r,%q1 is not connected.)],[ifelse([not([or([sdb(get,%q0,status,docked)],[sdb(get,%q0,status,landed)])])],[ansi(r,%q1 is not docked or landed.)],[ifelse([get(%q3/clamp)],[ansi(r,%q1 is clamped to '[name(%q3)]'.)],[set([zone([loc(%#)])],SPACE_AHCONNECT:)][remit([home(%q2)],[u(#252/msg_disconnect_ah,[name(%q2)],%q1,[name(%q3)],[name([zone([home(%q3)])])])])][remit([loc(%q2)],[u(#252/msg_disconnect_pp,[name(%q2)],%q1,[name(%q3)],[name([zone([home(%q3)])])])])][setq(9,[sdb(put,%q0,0,status,connected)])][u(#252/fn_all_console_cmd,[zone([loc(%#)])],[name(%q2)] disconnects from '[name(%q3)]' on [name([zone([home(%q3)])])])][link(%q3,)][link(%q2,)])])])])])]},{@pemit %#=Huh?%b%b\(Type "help" for help.\)} These need to be placed on the object $resource object. These can be changed at your discretion. &MSG_CLAMP_AH $resource=A noise is heard as the clamps of %3 are engaged around the %0. &MSG_CLAMP_PP $resource=A noise is heard as clamps are engaged around %1 on '%2'. &MSG_UNCLAMP_AH $resource=A noise is heard as %3's clamps are released from the %0. &MSG_UNCLAMP_PP $resource=A noise is heard as clamps are released from %1 on '%2'. &MSG_CONNECT_AH $resource=A noise is heard as the %0 connects with '%2' on %3. &MSG_CONNECT_PP $resource=A noise is heard as the %0 on %1 connects with '%2'. &MSG_DISCONNECT_AH $resource=A noise is heard as the %0 disconnects from '%2' on %3. &MSG_DISCONNECT_PP $resource=A noise is heard as the %0 on %1 disconnects from '%2'.