rawsonj / triviabot Goto Github PK
View Code? Open in Web Editor NEWA simple IRC trivia bot written in python using twisted.
License: GNU General Public License v3.0
A simple IRC trivia bot written in python using twisted.
License: GNU General Public License v3.0
Hi there, im using a new python3.6 , its support?
From #76.
I don't think maintaining backward compatibility is required. The python universe has moved on, so should I.
The questions came from somewhere out there. They are horrible and need fixing.
Fix command parsing.
The current skip vote system is a hardcoded number, 3. This really kind of sucks--I play on FCN, and there still are never enough people voting to skip. It ranges from 0-1 players at night, to maybe 5 during peak hours.
Perhaps you can count the unique people guessing in say, the last 10 minutes, and set the number of skips needed to MIN(guessers, 3)
**
Answering a question in channel returns the response in the title.
Why am I getting this when trying to load trivia.py as a plugin in HexChat?:
File "/home/lvr/Downloads/triviabot-master/trivia.py", line 450
sorted_scores = sorted(self._scores.iteritems(), key=lambda (k, v): (v, k), reverse=True)
^
SyntaxError: invalid syntax
Please help
If you'd like this feature added, I'll take care of it.
The masses wish to be able to skip questions they don't like.
It should want 3 peoples votes before it skips, then resets state. Also should reset state on a change in quesiton regardless of if it was skipped or not.
I suggest adding an option so the time between clues can be set differently than the time between questions. This would give admins some flexibility on what kind of "atmosphere" they'd like in their channels.
I'll write this code if you agree.
Is there any reason the question data is in multiple files? Is this to reduce RAM usage or something?
Was considering doing a Python3 port (to fix #78) and saw some unrelated stuff that might be worth cleaning up.
14:56 <@trivia> Useless Trivia: Lee Harvey
Oswald's body tag was auctioned
off for---------- .
14:56 <@trivia> Clue: $6,6**
14:56 < edunham> $6,600
14:56 <@trivia> Question:
14:56 <@trivia> Useless Trivia: Lee Harvey
Oswald's body tag was auctioned
off for---------- .
14:56 <@trivia> Clue: $6,6*0
14:57 <@trivia> No one got it. The answer was:
$6,600
I'm not sure how much this would help, and don't necessarily think it's the best idea, but wanted to open up a discussion about it.
Would using a database make it easier to edit, organize, and manage the questions?
If a database were used, should it only be used for organization and editing, but then exported back to text files? (thereby avoiding having to add database support to trivia.py)
Due to #46 being resolved, users can now see the standings the bot is keeping track of.
The issue here is that maybe we've recorded a few hundred users playing the game, and if the rate-limiting is set to a large-ish number (say 1 second) we may wait for several minutes as the standings are queued instantly in the bot but sent to the server at the configured rate.
Several trivia questions can then be queued up and go by while the standings are still being printed out.
This can be fixed in one of two ways:
1: Limit the standings to the top ten, or maybe just the ten people around where the user is, or some variation on this. This would put an upper bound on the time required to print out the standings.
Pros:
Cons:
2: Implement a priority queue or multiple queues. This may be preferable because if a user wants to see the complete standings they don't care about getting them as fast as possible, but the game should keep running as normal and be just as responsive as it normally would be.
Pros:
Cons:
I registered an unofficial #triviabot-dev channel on Quakenet.
If @rawsonj wants to make it official, please let me know and I will op you and grant you ownership privileges.
If you'd like it deleted because of any conflicts with existing channels, I can do that too. :)
As far as I know, there's no existing dev IRC channel for triviabot. Is that right?
First of all, my apologies that I'm unable to figure out how to fix this myself. It is quite likely a configuration issue on my end.
FreeBSD 10.0 & Python 2.7.12 installed via ports.
only changes I made to config.py were:
GAME_CHANNEL = '#triviatesting'
ADMINS = ['mynick']
DEFAULT_NICK = 'dantriviabot'
SERVER_PORT = 6697
The bot seems to work OK, and it is keeping track of scores (the ?score command reports the correct points total, even if the bot is killed and re-started) but whenever it spits out standings (or if I issue the ?standings command) it just says:
dantriviabot: The current trivia standings are:
and that's it (ETA: it doesn't crash, it just doesn't provide any list of names). I barely know anything about python so I'm sort of unsure as to whether I have something misconfigured or if there's some other package I need to install. Any ideas? Thanks!
Someone suggested recently that tb should die more gracefully
Update: This example catches a ctrl-c, and no errors are reported. But I haven't figured out how yet.
Received SIGINT, shutting down.
2016-09-02 13:44:14-0500 [-] Main loop terminated.
Some questions inspire guessing, and if someone guess several answers in quick succession, one of which is right, it's not obvious what the correct answer is.
I'm tired of running it in a screen. We don't have to stay attached to the thing while its running, and it makes sense to daemonise it unless we pass it a --debug, where it will not daemonise and will interact with whoever is attached to it.
~/triviabot$ ./trivia.py
Save directory doesn't exist.
Lost connection ([Failure instance: Traceback (failure with no frames): <class 'twisted.internet.error.ConnectionDone'>: Connection was closed cleanly.
])
With regard to #50, is it a feature you're interested in?
If so, I thought what would be more effective is a user being able to report the question number.
I could write a program in C that would write a string at the start of each line, numbering them, so each line would start with a string such as
Q [ 000001 ]
Q [ 005929 ]
Using a string of the same length, each line could be renumbered in the future.
What are your thoughts on this?
The current system is to give one clue for short words, and 3 clues for long words. Please give MAX(3, N-1) clues for all words, and just make it easier. One common problem is years: "1---" is a very bad clue for "birth of albert einstein".
When someone gets an answer correct, show both how many points were added (as is done now) and their total points.
Clues give away answers that are 3 characters or less.
Some answers are only one letter, and it's shown after the first hint.
And years can be pretty easy to guess, too.
_691
Hmm.. probably 1. ;)
Maybe only give 1 clue if string length is less than 3, and no clues on answers that are only 1 character? Something along those lines?
Request from #76.
May not be that hard to implement. Keep a structure around holding aliases for a nick.
The msg code is really ugly. Write a wrapper function that does formatting for the message.
@rawsonj How does this patch look?
os_path_patch.1.diff.txt
It also addresses one of the issues mentioned in #42, where a user gets a repeated message about the save directory not being created.
in questions_08, line 465. Category:Science He transmitted radio signals across the Atlantic in 1901.`Enrico Marconi That's the wrong Marconi. It was Guglielmo Marconi.
I suggest that version info should be added to the help option.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.