From bb42660c41465b356a2d53559fc2cf268c0c4289 Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Sun, 27 May 2012 17:33:20 +0200 Subject: [PATCH] =?utf8?q?"c'est=20le=20bon=20si=C3=A8cle"=20on=20ne=20le?= =?utf8?q?=20dit=20qu'une=20fois?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- historien.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/historien.py b/historien.py index 06bdae9..5bee725 100755 --- a/historien.py +++ b/historien.py @@ -176,7 +176,8 @@ class Historien(ircbot.SingleServerIRCBot): log(self.serveur,channel,u"$Date$".encode("utf8"),("%s : %s"%(date, evenement)).encode("utf8")) serv.privmsg(channel,evenement.encode("utf8")) token=time.time() - self.play_status[channel]=[1,date,evenement,token] + # le 0 est le flag "bon siècle" n' pas encore été dit + self.play_status[channel]=[1,date,evenement,0,token] serv.execute_delayed(random.randrange(ttrig*3,ttrig*5),self.give_indice,(serv,channel,token)) elif ok=="refuse": raise RefuseError @@ -562,10 +563,13 @@ class Historien(ircbot.SingleServerIRCBot): if tryother: if self.play_status.get(canal,[-1])[0] in [1,2]: answer=self.play_status[canal][1] + flag_century=self.play_status[canal][3] try: score_obtenu=reussi(message.decode("utf8"),answer,auteur) except GoodCentury: - serv.privmsg(canal,"%s: C'est le bon siècle, mais pas la bonne année, cherche encore ;)"%(auteur)) + if not flag_century: + serv.privmsg(canal,"%s: C'est le bon siècle, mais pas la bonne année, cherche encore ;)"%(auteur)) + self.play_status[canal][3]=1 return if score_obtenu: if self.play_status[canal][0]==1: -- 2.39.2