X-Git-Url: http://gitweb.pimeys.fr/?p=bots%2Fhung.git;a=blobdiff_plain;f=hung.py;h=e4c4615dd0f604b4edff0937fd1f2cf85688aa42;hp=7f25389af3c85e6605bbcd487435b6c857599bae;hb=489fe8b655472c42154b7bef9b7b26c11043c529;hpb=5ffa82df2494fa37b81390f0d31f4d36b600e40a diff --git a/hung.py b/hung.py index 7f25389..e4c4615 100755 --- a/hung.py +++ b/hung.py @@ -312,6 +312,19 @@ class Hung(ircbot.SingleServerIRCBot): self.start_partie(serv, canal) elif not canal in self.play_channels: serv.privmsg(canal,"%s: pas ici…"%(auteur)) + elif (cmd in list("azertyuiopqsdfghjklmwxcvbn") and canal in self.play_channels + and self.play_status.has_key(canal) and self.play_status[canal]!=[None]): + giv_let=cmd.upper() + liste=self.play_status[canal] + listeapres=[(lettre[0],lettre[1] or lettre[0]==giv_let) for lettre in liste] + if liste!=listeapres: + self.play_status[canal]=listeapres + self.affiche_mot(serv, canal, begin="%s trouvé"%(giv_let)) + if all([lettre[1] for lettre in listeapres]): + serv.privmsg(canal,"Bravo ! C'était %s"%("".join([lettre[0] for lettre in listeapres]))) + self.play_status[canal]=[None] + + if cmd in ["meur", "meurt","meurre","meurres"] and not canal in self.quiet_channels: serv.privmsg(canal,'%s: Mourir, impératif, 2ème personne du singulier : "meurs" (de rien)'%(auteur)) else: