[Turn off line numbering]1: arg name, @who; 2: var msg; 3: 4: // .object_match("name"[, who]) 5: // -> 0 name was the empty string 6: // -> ~objnf nothing matched name 7: // -> ~ambig more than one object matched name 8: // Attempt to match an object name with who.match_environment(). If one 9: // is found, return it. Else, print a message and return one of the above 10: // false values. 11: // 'who' defaults to sender(). 12: who = who ? who[1] : sender(); 13: if (!name) { 14: (| who.tell("You must give the name of something.") |); 15: return 0; 16: } 17: catch ~objnf, ~ambig { 18: return who.match_environment(name); 19: } with { 20: switch (error()) { 21: case ~objnf: 22: msg = "I don't see any \"" + name + "\" here."; 23: case ~ambig: 24: msg = "I don't know which \"" + name + "\" you mean."; 25: } 26: (| who.tell(msg) |); 27: return error(); 28: }
// Created 27-Mar-1995 as a part of ColdCore, see: @help Credit