@verb #3512:"@inv*ite invite" any any any rxdo #9780 @program #3512:"@inv*ite invite" any any any "Programmed by Quadir (#9780)" " Original verb by Lancer (#5999)" " Improvements on original by Raptor (#6319)" "Syntax:" " @invite [player] [,extra args]" "--" "Invites a person to join you in your room." 1 && 1 "Programmer's note:" " Calls [player's room]:invited([player] [,extra args]);" " :invited() return output and @invite bahaviour:" " E_PERM => Permishion denied" " {[,invite] [,oinvite] [,einvite] [,iinvite] [,value]} =>" " invite (told to invitee, 0 default)" " oinvite (told to room, 0 default)" " einvite (permission denied told to player, 0 default)" " iinvite (told to the inviter, 0 default)" " value (default is 0 is not owner of room, 1 otherwise)" " E_PERM => msg_einvite told" " 0 => invite and oinvite told" " 1 => invite told" "" "Note: The :invited() verb is not caught in error checking," " ensure that it is not returning any errors other then" " E_PERM." this:update_usage("invite", player) if (!args) return player:tell(@$help_utils:fetch(tostr(this, ":", verb))[6..7]) endif dobj = `$command_utils:player_match_result($string_utils:match_local_player(args[1]), args[1])[2] ! ANY => #-1' args = `args[2..$] ! E_RANGE => {}' if (!valid(dobj)) return elseif (dobj in player.location:contents()) player:sub_tell("%d is already here!") endif try info = player.location:invited(dobj, $su:from_list(args, " ")) except (E_PERM) info = E_PERM except (E_VERBNF) info = 0 endtry "Default values" {invite, oinvite, einvite, iinvite, value} = {0, 0, 0, 0, 0} dinvite = "You have been invited by %n to @join %n~o in %n~l%1" doinvite = "%n invites %d." deinvite = E_PERM diinvite = "You invite %d to @join you%1." dvalue = 2 "--" "Omigod. Enough confusingly-similar and ambiguous-meaning variable names? --Cecil" "This is a lazy hack to make @invite work. Someone should write this to have a saner flow of operation." {?invite = dinvite, ?oinvite = doinvite, ?einvite = deinvite, ?iinvite = diinvite, ?value = dvalue} = {} if (info == E_PERM) value = info elseif (typeof(info) == $ERR) return player:tell(info) elseif (typeof(info) == $LIST) {?invite = dinvite, ?oinvite = doinvite, ?einvite = deinvite, ?iinvite = diinvite, ?value = dvalue} = info elseif (info == 0) "Do nothing, verb returned no info" else raise(E_TYPE, " :invite() returned bogus info") endif if (value == E_PERM) return player:sub_Tell(einvite) elseif (!(value in {1, 0})) value = player:controls(player.location) endif if (value == 0) player.location:sub_announce(oinvite ? oinvite | doinvite, dobj) endif dobj:sub_tell(invite ? invite | dinvite, invite ? "" | $su:from_list(args, " ")) player:sub_tell(iinvite ? iinvite | diinvite, iinvite ? "" | $su:from_list(args, " ")) "Last modified by Dax (#789) on Tue May 3 13:45:59 2005 MDT." .