@program NewBuild.MUF 1 10000 d i ( [C] 2000-2004 Loxorion Trypnotk - loxorion@lostweyr.org Release terms: GNU GPL v2 http://www.gnu.org/copyleft/gpl.html Just tell me where you got me, where your using this program [host/port] and distribute your changes under the same terms as you got them [GNU GPL v2] ) ( NewBuild.muf first built for ToyKinMUCK 2004 Mar 19 ) $include $lib/loxorion $iflib $lib/case $include $lib/case $endif lvar param lvar cmd lvar args : build.defpublic me @ "_prefs/build/public" getprop not if me @ "_prefs/build/public" 1 setprop { "^GREEN^You are now building publically expandable rooms." }tell else me @ "_prefs/build/public" 0 setprop { "^RED^You are no longer building publically expandable rooms." }tell then ; : build.public ( Can I build here? ) me @ "W" flag? me @ me @ location controls or not if { "^RED^You cannot change the setting for this room.^NORMAL^" }tell exit then me @ location "_prefs/build/public" getprop not if me @ location "_prefs/build/public" 1 setprop { "^GREEN^This room is now set publically expandable." }tell else me @ location "_prefs/build/public" 0 setprop { "^RED^This room is longer set publically expandable." }tell then ; : build.succ args @ if me @ "_prefs/build/succ" args @ setprop { "^CYAN^You set your default @succ message to: ^GREEN^" args @ }tell else me @ "_prefs/build/succ" 0 setprop { "^RED^You cleared your default @succ message." }tell then ; : build.check { "@build information for " me @ unparseobj }cat header tellme { "^CYAN^Default @succ message: ^GREEN^" me @ "_prefs/build/succ" getprop dup not if pop "^RED^[Unset]" then }tell { "^CYAN^Make publically buildable rooms: " me @ "_prefs/build/public" getprop if "^GREEN^Yes" else "^RED^No" then }tell { "@build information for " me @ location unparseobj }cat header tellme { "^CYAN^Room is publically buildable: " me @ location "_prefs/build/public" getprop if "^GREEN^Yes" else "^RED^No" then }tell "@Build Advance 4.5 -- Loxorion" footer tellme me @ location ; : build.do var tname var texit var treturn var tparent var tdesc var rroom var rexit var rreturn var rparent ( Can I build here? ) me @ "W" flag? me @ me @ location controls me @ location "_prefs/build/public" getprop or or not if { "^RED^You cannot build here.^NORMAL^" }tell exit then ( parse parameters ) param @ "=" split swap tname ! "=" split swap texit ! "=" split swap treturn ! "=" split swap tparent ! "=" split swap tdesc ! ( find out which parent to use ) tparent @ if tparent @ resolve rparent ! rparent @ int 0 < if { "Warning: Specified parent could not be found, using default parent." }tell me @ "_prefs/build/parent" getprop rparent ! rparent @ not if me @ location location rparent ! then then else me @ "_prefs/build/parent" getprop rparent ! rparent @ not if me @ location location rparent ! then then ( Make room ) rparent @ tname @ newroom rroom ! { "Room ^GREEN^" rroom @ unparseobj "^NORMAL^ created and parented to ^CYAN^" rparent @ unparseobj "^NORMAL^." }cat tellme ( Make exit there ) texit @ if me @ location texit @ newexit rexit ! rexit @ rroom @ setlink { "Exit ^GREEN^" rexit @ unparseobj "^NORMAL^ created, attached to ^YELLOW^" me @ location unparseobj "^NORMAL^, and linked to ^CYAN^" rroom @ unparseobj "^NORMAL^." }cat tellme then ( Make exit back ) treturn @ if rroom @ treturn @ newexit rreturn ! rreturn @ me @ location setlink { "Return exit ^GREEN^" rreturn @ unparseobj "^NORMAL^ created, attached to ^YELLOW^" rroom @ unparseobj "^NORMAL^, and linked to ^CYAN^" me @ location unparseobj "^NORMAL^." }cat tellme then ( Set description ) tdesc @ if rroom @ tdesc @ setdesc { "The description you gave for ^GREEN^" rroom @ unparseobj "^NORMAL^ was applied." }cat tellme then ( Set default succ ) me @ "_prefs/build/succ" getprop var! tsucc tsucc @ if rroom @ tsucc @ setdesc { "The default @succ message you gave for ^GREEN^" rroom @ unparseobj "^NORMAL^ was applied." }cat tellme then ( Set default succ ) me @ "_prefs/build/public" getprop var! tpublic tpublic @ if rroom @ "_prefs/build/public" 1 setprop { "The room ^GREEN^" rroom @ unparseobj "^NORMAL^ was made publically buildable." }cat tellme then ; : build.help { "@Build Advance 4.5 - (C) 1998-2004 Loxorion Trypnotk - Release terms GNU GPL V2" "Syntax:" " " " @build [====]" " Build a room. Any parameter besides may be omitted or skipped." " @build #succ " " Set a default @succ to apply to new rooms" " @build #public" " Toggle whether this room is publically buildable." " @build #defpublic" " Toggle default building of publically buildable rooms." " @build #check" " Check your settings and the public settings of the room you're in." " @build #help" " This stuff." }array atellme ; : build dup param ! " " split args ! cmd ! param @ not if build.help exit then ( Initial parameters ) cmd @ case "#help" smatch when build.help end "#succ" smatch when build.succ end "#public" smatch when build.public end "#defpublic" smatch when build.defpublic end "#check" smatch when build.check end default pop build.do end endcase ; . c q