@verb #849:"parse_say" this none this rxdo #833 @program #849:"parse_say" this none this "parse_say(\"Foo says, \\\"bar.\\\"\", where) => {\"Foo\", \"bar.\"}" "Ugh. This is a complete kludge. Try to figure out if the player is saying something by seeing if we can match the incoming string against msg_osay (or some common equivalents!) If they are, return {speaker, speech}; if not, return {}." {text, @where} = args where = where || {$eroom} templates = {} for r in (where) for m in ({"msg_osay", "msg_oexclaim", "msg_question"}) `templates = setadd(templates, r:(m)()) ! ANY' endfor endfor templates = setadd(templates, $room:msg_osay()) for t in (setremove(templates, "")) "Turn the msg_osay into a reguar expression matching itself(!):" re = "^" + $string_utils:regexp_quote(t) + "$" re = strsub(re, "%%n", "%(.*%)") re = strsub(re, "%%1", "%(.*%)") "(This isn't perfect, but hard to improve...)" "Match it against t, to get a list like {\"%%n\", \"%%1\"} ..." (tags = $max_utils:matchlist(match(t, re))) || #833:inspect(t) strings = $max_utils:matchlist(match(text, re)) if (strings) speech = `strings["%1" in tags] ! E_RANGE => ""' speaker = `strings["%n" in tags] ! E_RANGE => ""' return {speaker, speech} endif endfor return {} .