@prog guest-connect.muf 1 999 d 1 i : addprop-or-remove dup "" strcmp if 0 addprop else pop remove_prop then ; : splitfirst (s1 s2 -- s3 s4) ( splits s1 at first occurrence of s2 ) ( if s1 contains s2, s3 s2 s4 strcat strcat == s1 ) ( if not, s3 == s1, s4 == "" ) over over instr dup if rot swap 1 - strcut rot strlen strcut swap pop else pop pop "" then ; : find-free-guest 1 begin "*Guest" over intostr strcat match dup if dup awake? else 0 then while pop 1 + loop swap pop ; : bootme connections 1 swap 1 for pop dup condbref me @ dbcmp if conboot else pop then loop ; : setup-moveto pop atoi dbref me @ location over dbcmp if pop else me @ swap moveto then ; : setup-prop pop ":" splitfirst me @ rot rot addprop-or-remove ; : setup-flag pop begin 1 strcut over while over "!" strcmp not if strcat 2 strcut then me @ rot set loop pop pop ; : setup-home pop atoi dbref me @ swap addlink ; : setup-desc pop me @ swap setdesc ; : setup-succ pop me @ swap setsucc ; : setup-fail pop me @ swap setfail ; : setup-drop pop me @ swap setdrop ; : setup-osucc pop me @ swap setosucc ; : setup-ofail pop me @ swap setofail ; : setup-odrop pop me @ swap setodrop ; : setup-lock pop me @ swap lock ; : setup-$ pop atoi me @ swap over pennies - addpennies ; : setup-cmd dup "moveto" strcmp not if setup-moveto exit then dup "prop" strcmp not if setup-prop exit then dup "home" strcmp not if setup-home exit then dup "flag" strcmp not if setup-flag exit then dup "desc" strcmp not if setup-desc exit then dup "succ" strcmp not if setup-succ exit then dup "fail" strcmp not if setup-fail exit then dup "drop" strcmp not if setup-drop exit then dup "osucc" strcmp not if setup-osucc exit then dup "ofail" strcmp not if setup-ofail exit then dup "odrop" strcmp not if setup-odrop exit then dup "$" strcmp not if setup-$ exit then dup "lock" strcmp not if setup-lock exit then pop pop ; : myhost connections 0 swap begin dup 0 > while 1 - rot dup condbref me @ dbcmp if conhost rot pop swap else pop then loop pop ; : main me @ name 5 strcut pop "Guest" strcmp if exit then me @ name "Guest" strcmp if me @ "You must connect to Guest; do not try to connect" notify me @ "directly to one of the specific guest characters." notify bootme exit then prog "@ban-" myhost strcat prop-exists? if bootme exit then find-free-guest dup not if pop me @ "All guest characters are busy, please try later" notify bootme exit then dup name swap dup "Guest-" setname swap me @ swap setname "Guest" setname prog "@pages" getpropstr dup if atoi dbref "page" me @ int intostr strcat remove_prop else pop then begin me @ exits while me @ exits dup prog owner chown recycle loop begin me @ propfirst while me @ swap remove_prop pop loop begin me @ begin nextowned dup daemon? while loop dup while dup prog owner chown recycle loop pop me @ dup "" setdesc dup "" setsucc dup "" setfail dup "" setdrop dup "" setosucc dup "" setofail dup "" setodrop pop 1 begin prog "@guest-exit-" 3 pick intostr strcat "-name" strcat getpropstr dup while me @ open prog "@guest-exit-" 4 pick intostr strcat "-dest" strcat getpropstr atoi dbref addlink 1 + loop pop pop 1 begin prog "@guest-setup-" 3 pick intostr strcat getpropstr dup while ":" splitfirst swap setup-cmd 1 + loop pop pop ; . c q