From 36b9812610d0bb0f36ba725cd523ddc47950a58c Mon Sep 17 00:00:00 2001 From: rootcoma Date: Sun, 5 Jan 2014 00:01:24 -0800 Subject: [PATCH 1/9] remove voice on right answer --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 5884a3b..878bcef 100644 --- a/plugin.py +++ b/plugin.py @@ -1554,7 +1554,7 @@ class TriviaTime(callbacks.Plugin): log.error('waitTime was set too low (<2 seconds). Setting to 2 seconds') waitTime = time.time() + waitTime self.queueEvent(waitTime, self.nextQuestion) - self.base.handleVoice(self.irc, username, channel) + #self.base.handleVoice(self.irc, username, channel) def getHintString(self, hintNum=None): if hintNum == None: From 14932826bcb679d900001ccbeacd71f88ce0a75b Mon Sep 17 00:00:00 2001 From: rootcoma Date: Mon, 6 Jan 2014 01:46:27 -0800 Subject: [PATCH 2/9] Adding streakbonus to pointsAdded --- plugin.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin.py b/plugin.py index 878bcef..2d91b73 100644 --- a/plugin.py +++ b/plugin.py @@ -1479,6 +1479,7 @@ class TriviaTime(callbacks.Plugin): streakBonus = pointsAdded * .01 * (self.streak-1) if streakBonus > pointsAdded: streakBonus = pointsAdded + pointsAdded += streakBonus threadStorage.updateGameStreak(self.channel, self.lastWinner, self.streak) threadStorage.updateUserHighestStreak(self.lastWinner, self.streak) threadStorage.updateGameLongestStreak(self.channel, username, self.streak) From 875879b661fc505f48a55f9e8e26620092454a75 Mon Sep 17 00:00:00 2001 From: tannn Date: Mon, 6 Jan 2014 14:47:24 -0600 Subject: [PATCH 3/9] Update README.md --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7301c3b..3c106d0 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - Configuration +#Configuration ## Setting up plugin 1. Download [Supybot][] 2. Download TriviaTime and place it into the plugins folder @@ -11,7 +11,12 @@ 2. Configure config.php to point to your TriviaTime database in the plugin/TriviaTime/Storage/db folder ## How to update -Simply replace all files in the plugins/TriviaTime directory. Do not delete any files in TriviaTime/storage (aside from samplequestions, if you wish). If there were any changes to the database or config, they should be updated automatically. Otherwise, further instructions for updating that version will appear here. +1. Stop the game, if it is currently in progress. +2. Unload TriviaTime +3. Move files into plugins/TriviaTime directory. Do not delete any files in TriviaTime/storage (aside from samplequestions, if you wish). +4. If there were any changes to the database or config, they should be updated automatically. Otherwise, further instructions for updating that version will appear here. +5. Load TriviaTime +6. If everything went smoothly, you have now sucessfully updated the plugin to the latest version. ## Important - Setting up permissions for sqlite (website) If you do not plan on using the webpage you can ignore this. From 48aee817aedecd540f2fcba3cdcbf77763cc86b6 Mon Sep 17 00:00:00 2001 From: rootcoma Date: Mon, 6 Jan 2014 17:08:33 -0800 Subject: [PATCH 4/9] Add streak without adding to pointsAdded --- plugin.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 2d91b73..aaa22e4 100644 --- a/plugin.py +++ b/plugin.py @@ -1479,7 +1479,6 @@ class TriviaTime(callbacks.Plugin): streakBonus = pointsAdded * .01 * (self.streak-1) if streakBonus > pointsAdded: streakBonus = pointsAdded - pointsAdded += streakBonus threadStorage.updateGameStreak(self.channel, self.lastWinner, self.streak) threadStorage.updateUserHighestStreak(self.lastWinner, self.streak) threadStorage.updateGameLongestStreak(self.channel, username, self.streak) @@ -1487,7 +1486,7 @@ class TriviaTime(callbacks.Plugin): pointsAdded = int(pointsAdded) # report correct guess, and show players streak - threadStorage.updateUserLog(username, self.channel, pointsAdded,1, timeElapsed) + threadStorage.updateUserLog(username, self.channel, (pointsAdded+streakBonus), 1, timeElapsed) self.lastAnswer = time.time() self.sendMessage('DING DING DING, \x02%s\x02 got the correct answer, \x02%s\x02, in \x02%0.4f\x02 seconds for \x02%d(+%d)\x02 points!' % (username, correctAnswer, timeElapsed, pointsAdded, streakBonus)) From 463275315511b95368bfab08968f94eba0e9475f Mon Sep 17 00:00:00 2001 From: rootcoma Date: Mon, 6 Jan 2014 17:29:03 -0800 Subject: [PATCH 5/9] Fix #0 this month --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index aaa22e4..38b6488 100644 --- a/plugin.py +++ b/plugin.py @@ -2364,7 +2364,7 @@ class TriviaTime(callbacks.Plugin): from triviauserlog where month=? and year=? - and username=?''' % (query) + and username_canonical=?''' % (query) arguments.append(month) arguments.append(year) arguments.append(usernameCanonical) From 602a63c9327f436fd42680ea11f566fc4551a540 Mon Sep 17 00:00:00 2001 From: rootcoma Date: Mon, 13 Jan 2014 02:03:09 -0800 Subject: [PATCH 6/9] Show points for today in recap. Fix deletegames --- plugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index 38b6488..4ff30bc 100644 --- a/plugin.py +++ b/plugin.py @@ -257,6 +257,7 @@ class TriviaTime(callbacks.Plugin): threadStorage.insertActivity(activityType, activityText, channel, irc.network) def deleteGame(self, irc, channel): + channelCanonical = ircutils.toLower(channel) if irc.network in self.games: if channelCanonical in self.games[irc.network]: del self.games[irc.network][channelCanonical] @@ -1500,10 +1501,8 @@ class TriviaTime(callbacks.Plugin): weekScore = userInfo[8] monthScore = userInfo[6] recapMessageList = ['\x02%s\x02 has won \x02%d\x02 in a row!' % (username, self.streak)] - if todaysScore > pointsAdded or weekScore > pointsAdded or monthScore > pointsAdded: - recapMessageList.append(' Total Points') - if todaysScore > pointsAdded: - recapMessageList.append(' TODAY: \x02%d\x02' % (todaysScore)) + recapMessageList.append(' Total Points') + recapMessageList.append(' TODAY: \x02%d\x02' % (todaysScore)) if weekScore > pointsAdded: recapMessageList.append(' this WEEK \x02%d\x02' % (weekScore)) if weekScore > pointsAdded or todaysScore > pointsAdded: From 8e986df7093027f0fae4c517a603cd728eee6038 Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Wed, 12 Feb 2014 01:23:44 -0500 Subject: [PATCH 7/9] Fix for issue #261. Lets the normal extra hint command also work for KAOS questions. Adds a notice about this update to players who use the KAOS hint command. --- plugin.py | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/plugin.py b/plugin.py index 4ff30bc..7432460 100644 --- a/plugin.py +++ b/plugin.py @@ -143,17 +143,21 @@ class TriviaTime(callbacks.Plugin): return channelCanonical = ircutils.toLower(channel) - otherHintCommand = self.registryValue('commands.showHintCommandKAOS', channel) - kaosRemainingCommand = self.registryValue('commands.extraHint', channel) - - game = self.getGame(irc, channel) - - if game is not None: - # Look for command to list remaining KAOS - if msg.args[1] == otherHintCommand: - game.getRemainingKAOS() - elif msg.args[1] == kaosRemainingCommand: - game.getOtherHint() + kaosRemainingCommand= self.registryValue('commands.showHintCommandKAOS', channel) + otherHintCommand = self.registryValue('commands.extraHint', channel) + + game = self.getGame(irc, channel) + + if game is not None: + # Look for command to list remaining KAOS + if msg.args[1] == kaosRemainingCommand: + irc.sendMsg(ircmsgs.notice(username, "'{0}' now also works for KAOS hints! Please try it out!".format(otherHintCommand))) + game.getRemainingKAOS() + elif msg.args[1] == otherHintCommand: + if "KAOS" in game.question: + game.getRemainingKAOS() + else + game.getOtherHint() else: # check the answer game.checkAnswer(msg) From 78b974901567b7b45d25403b255644fcd54d7246 Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Thu, 13 Feb 2014 18:25:19 -0500 Subject: [PATCH 8/9] Minor change for hint command. Made the check for KAOS questions more robust. --- plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.py b/plugin.py index 7432460..aca5643 100644 --- a/plugin.py +++ b/plugin.py @@ -154,7 +154,7 @@ class TriviaTime(callbacks.Plugin): irc.sendMsg(ircmsgs.notice(username, "'{0}' now also works for KAOS hints! Please try it out!".format(otherHintCommand))) game.getRemainingKAOS() elif msg.args[1] == otherHintCommand: - if "KAOS" in game.question: + if game.question.find("KAOS:") == 0: game.getRemainingKAOS() else game.getOtherHint() From b8ea810d8f309c92b17f6d7aa7da3b2672cb80a9 Mon Sep 17 00:00:00 2001 From: Yizhe Shen Date: Tue, 3 Jun 2014 22:44:58 -0400 Subject: [PATCH 9/9] Added editor information to "showedit" and a couple of fixes. - "showedit" command now displays who edited the question - Fix for kaosRemainingCommand (syntax error) - Fixed a typo in TriviaTime.addfile() --- plugin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin.py b/plugin.py index aca5643..b0abad0 100644 --- a/plugin.py +++ b/plugin.py @@ -156,7 +156,7 @@ class TriviaTime(callbacks.Plugin): elif msg.args[1] == otherHintCommand: if game.question.find("KAOS:") == 0: game.getRemainingKAOS() - else + else: game.getOtherHint() else: # check the answer @@ -382,7 +382,7 @@ class TriviaTime(callbacks.Plugin): def addfile(self, irc, msg, arg, filename): """[] Add a file of questions to the question database, - filename defaults to configured quesiton file. + filename defaults to configured question file. """ if filename is None: filename = self.registryValue('admin.quizfile') @@ -1195,7 +1195,7 @@ class TriviaTime(callbacks.Plugin): if len(edit) > 0: edit = edit[0] question = threadStorage.getQuestion(edit[1]) - irc.reply('Edit #%d, Question#%d'%(edit[0], edit[1])) + irc.reply('Edit #%d by %s, Question#%d'%(edit[0], edit[4], edit[1])) irc.reply('NEW:%s' %(edit[2])) if len(question) > 0: question = question[0]