diff --git a/Frotz/plugin.py b/Frotz/plugin.py index 50b6d2c..f0b6c52 100644 --- a/Frotz/plugin.py +++ b/Frotz/plugin.py @@ -51,29 +51,18 @@ class Frotz(callbacks.Plugin): irc.reply("Starting {0} on {1}. Please wait...".format(game_name, channel)) game_file= "{0}{1}".format(self.game_path, game_name) self.game[channel] = pexpect.spawn("{0} -S 0 {1}".format(self.binary, game_file)) - score, response = self.output(self.game[channel]) - if score: - irc.reply(score, prefixNick=False) - irc.reply(response, prefixNick=False) + response = self.output(self.game[channel]) + for line in response: + if line.strip() and line.strip() != ".": + irc.reply(line, prefixNick=False) load = wrap(load, ['text']) def output(self, output): response = [] - prompts = ["\n>", "\n> >", "to begin]", "\n\*\*\*MORE\*\*\*", pexpect.TIMEOUT] + prompts = ["\n>", "\n> >", "to begin]", "\n\*\*\*MORE\*\*\*", "to continue.]", pexpect.TIMEOUT] output.expect(prompts, timeout=2) - response = re.sub('(?