@program path2exit.muf 1 1000 d i $include $lib/alynna $def EXITOWNER "*Avatar" match $def STEPPING 1000 : exitishere? ( d s -- i ) var target var cmp var result cmp ! 0 result ! exits_array foreach target ! pop target @ name cmp @ smatch if 1 result ! then repeat result @ ; : main var param var start var cend var target var exitname var exittarget var newtarget var newexitname var newexitvalue param ! param @ toint 0 > if #0 "path2exit" param @ toint setprop then #0 "path2exit" getprop toint todbref dup target ! start ! start @ int STEPPING + dbref cend ! cend @ dbtop > if dbtop cend ! then str "Making exits out of paths, starting at " target @ unparseobj cat "Path2Exit" pretty tellme begin ( If this is a room .. ) target @ room? if ( For each path in this room ) target @ "@u/d/" array_get_propvals foreach exittarget ! exitname ! exittarget @ room? if target @ exitname @ exitishere? not if ( Make a new exit and attach it here ) target @ exitname @ newexit newtarget ! newtarget @ EXITOWNER setown ( Make sure its not linked ) newtarget @ #-1 setlink ( Link it to the new target ) newtarget @ exittarget @ setlink ( And copy all its props over ) ( For each prop on this path ) target @ str "@u/d/" exitname @ "/" cat array_get_propvals foreach newexitvalue ! newexitname ! ( Write it to _ on the target exit ) newtarget @ str "/_/" newexitname @ cat newexitvalue @ setprop ( Until all done ) repeat str "Created exit " newtarget @ unparseobj " linked to " exittarget @ unparseobj " in " target @ unparseobj "." cat "Path2Exit" pretty tellhere then else str "Couldn't create exit " newtarget @ unparseobj " linked to " exittarget @ unparseobj " in " target @ unparseobj ", target is not a ROOM." cat "Path2Exit" pretty tellhere then ( Go onto the next path until done ) repeat then ( Go onto the next room ) target @ toint 1 + todbref target ! ( store current ref ) #0 "path2exit" target @ toint setprop ( Until all done ) target @ cend @ >= until "Done." tellme ; . c q