@verb #3512:"@knock knock" any none none rxdo #60 @program #3512:"@knock knock" any none none "Programmed by Lancer (#5999)" " Improvements by Raptor (#6319)" " Improvements (again) by Quadir (#9780)" "Syntax:" " @knock [player name]" " @knock [room number]" "--" "Announces to all players in the given [room] that you would like to @join." 1 && 1 "Programmer's note:" " Calls [player's room]:knocked([player], [dobj]);" " :knocked() return output and @knock bahaviour:" " E_PERM => Permishion denied" " {[,knock] [,oknock] [,eknock] [,value]} =>" " knock (told to knocker, 0 default)" " oknock (told to room, 0 default)" " eknock (permission denied told to player, 0 default)" " value (default is 0 is not owner of room, 1 otherwise)" " E_PERM => eknock told" " 0 => knock and oknock told" "" "Note: The :knocked() verb is not caught in error checking," " ensure that it is not returning any errors other then" " E_PERM." this:update_usage("knock", player) who = #-1 if (!args) return player:tell(@$help_utils:fetch(tostr(this, ":", verb))[6..7]) elseif (!valid(dest = dobj) && !valid(dest = $string_utils:match_player(argstr))) return player:tell("Not a valid player or room.") endif if (is_player(dest)) who = dest where = dest.location "elseif (dest:isa($room))" else where = dest endif if (`where:isa($editor) && who:isa($player) ! ANY') where = dest.original[who in dest.active] player:sub_tell("%1 is in the editor, so you knock on %2 (#%2~#) instead.", who, where) elseif (where:isa($editor)) return player:sub_tell("Why not use @edit to get into %1?", dest) elseif (`!who:isa($player) && !where:isa($room) ! ANY') return player:sub_tell("I can't knock on the walls of %1 (#%1~#)!!", dest) endif if (player in where:contents()) player:sub_tell("You're already there") else try info = where:knocked(player, who) except (E_PERM) info = E_PERM except (E_VERBNF) info = 0 endtry "Default variables" dknock = "You have knocked on the walls of %1. Please wait for a response before you @join." doknock = "%n knocks on the walls, wondering if %n~s could @join." deknock = "You are not permited to knock on the walls of %1." dvalue = 0 {knock, oknock, eknock, value} = {0, 0, 0, 0} "--" if (info == E_PERM) value = info elseif (typeof(info) == $ERR) return player:tell(info) elseif (typeof(info) == $LIST) {?knock = dknock, ?oknock = doknock, ?eknock = deknock, ?value = dvalue} = info elseif (info == 0) "Do nothing, verb returned nothing" else raise(E_TYPE, " :knocked returned bogus info") endif if (value == E_PERM) return player:sub_tell(eknock ? eknock | deknock, where) else where:sub_announce(oknock ? oknock | doknock) player:sub_tell(knock ? knock | dknock, where:title()) endif endif "Last modified by Dax (#789) on Tue May 3 13:45:59 2005 MDT." .