I am not exactly sure what you are wanting to do, but maybe a plugin can help simplify things a bit for you. I haven't tested this at all, but it may work for what you are wanting. Just add following plugin to one of your plugin files in your plugins folder.
Code:
#Usage: plugin::EventSay("ExpectedText", "Response");
# Example: plugin::EventSay("Hail", "It Worked!");
sub EventSay {
my $text = plugin::val('$text');
my $CheckText = $_[0];
my $Response = $_[1];
if ($text =~ /$CheckText/i)
{
quest::say("$Response");
}
}
Then, you should be able to test it using this:
Usage Example:
Code:
sub EVENT_SAY {
my $cookie = quest::saylink("Cookie");
my $cookieid = quest::varlink("19732");
plugin::EventSay("Hail", "Would you like a [$cookie]?");
plugin::EventSay("cookie", "Yes, a Cookie! Here is what it looks like [$cookieid]");
plugin::EventSay("no", "Okay, I will eat it!");
}