From 5ec921a98112b8971747d0c84bdb4a35bdf0688d Mon Sep 17 00:00:00 2001 From: Matthew Vernon Date: Wed, 20 Apr 2011 11:32:31 +0100 Subject: [PATCH] remove the losing-the-game code --- Servus-chiark.py | 17 ----------------- commands.py | 18 ------------------ 2 files changed, 35 deletions(-) diff --git a/Servus-chiark.py b/Servus-chiark.py index c1157f6..81f8076 100644 --- a/Servus-chiark.py +++ b/Servus-chiark.py @@ -134,14 +134,6 @@ def quit(bot,cmd,nick,conn,public): def reload(bot,cmd,nick,conn,public): c.reloadq(bot,cmd,nick,conn,public) -#The game... -class game: - trigger="Servus" - grace=time.time() - minlose=24*60*60 #1 day - maxlose=14*minlose #2 weeks - losetime=time.time()+300000 - # initialise the urldb on startup urldb={} lastexp=time.time() @@ -178,7 +170,6 @@ commands = {"karma": (c.karmaq,karmadb), "nws": (c.nsfwq,urldb), "units": c.unitq, "help": c.helpq, -# "game": (c.gameq,game), "say": c.sayq, "do": c.doq, "twit": (c.twitterq,twitapi) } @@ -225,11 +216,3 @@ def command(bot, cmd, nick, conn, public): e(bot,cmd,nick,conn,public) else: e[0](bot,cmd,nick,conn,public,*e[1:]) -# elif public: -# if cmd.find("GAME")!=-1: #someone else lost -# grace.grace=time.time()+60*20 -# elif cmd.find(game.trigger)!=-1 and len(game.trigger)>2: #we lost! -# c.gameq(bot,"pad "+game.trigger,bot.owner,conn,False,game) -# elif time.time()>game.losetime: #we randomly lost, take new trigger -# c.gameq(bot,cmd,bot.owner,conn,False,game) -# diff --git a/commands.py b/commands.py index b63836a..e7a0de3 100644 --- a/commands.py +++ b/commands.py @@ -187,24 +187,6 @@ def reloadq(bot, cmd, nick, conn, public): bot.automsg(public,nick, "Configuration can only be reloaded by my owner, by /msg.") -# lose the game and/or install a new trigger word -def gameq(bot, cmd, nick, conn, public, game): - #only install a new trigger if it's not too short. - if len(' '.join(cmd.split()[1:]))>2: - game.trigger=' '.join(cmd.split()[1:]) - if (time.time()> game.grace): - if not public: - if irc_lower(nick) == irc_lower(bot.owner): - conn.action(bot.channel,"loses the game!") - else: - conn.privmsg(bot.channel,nick+" just lost the game!") - else: - if not public: - conn.notice(nick, "It's a grace period!") - game.grace=time.time()+60*20 #20 minutes' grace - game.losetime=time.time()+random.randrange(game.minlose,game.maxlose) - conn.notice(bot.owner, str(game.losetime-time.time())+" "+game.trigger) - # quit irc def quitq(bot, cmd, nick, conn, public): if irc_lower(nick) == irc_lower(bot.owner): -- 2.30.2