: say me @ swap notify ; : usage "Usage: @dig [ = [ | , ] ]" say ; : control? dup owner me @ dbcmp over "L" flag? rot "A" flag? me @ wizard? or or or ; : main me @ builder? not if pop "That command is restricted to authorized builders." say exit then dup not if pop usage exit then me @ pennies 25 < me @ wizard? not and if pop "Digging a room costs $25." say exit then dup "|" instr if dup "|" instr 1 - strcut 1 strcut swap pop .sstrip swap else "" swap then dup "=" instr not if loc @ location dup control? not if pop #0 then dig me @ wizard? not if me @ -25 addpennies then over name " created with room number " strcat 3 pick intostr strcat ", parent " strcat over intostr strcat "." strcat say else dup "=" instr 1 - strcut 1 strcut swap pop .sstrip swap .sstrip swap dup "#" 1 strncmp not if 1 strcut swap pop then atoi dbref dup room? not if pop loc @ location then dup #0 dbcmp me @ wizard? not and if pop loc @ location then dup control? not if pop loc @ location then dup control? not if pop #0 then dig me @ wizard? not if me @ -25 addpennies then over name " created with room number " strcat 3 pick intostr strcat ", parent " strcat over intostr strcat "." strcat say then 3 pick not if pop pop pop exit then 3 pick "," instr not if pop pop pop exit then me @ pennies 4 < me @ wizard? not and if pop pop pop "You have less than $4. Please make exits manually." say exit then pop over dup "," instr 1 - strcut 1 strcut swap pop .sstrip swap .sstrip dup if loc @ open dup "Exit opened with number " swap intostr strcat "." strcat say "Trying to link..." say "Linked to " 4 pick name strcat "(#" strcat 4 pick intostr strcat ")." strcat say 3 pick addlink me @ wizard? not if me @ -2 addpennies then else pop then dup if over open dup "Exit opened with number " swap intostr strcat "." strcat say "Trying to link..." say "Linked to " loc @ name strcat "(#" strcat loc @ intostr strcat ")." strcat say loc @ addlink me @ wizard? not if me @ -2 addpennies then then pop pop ;