TriviaBot on #scobowl: Rules and help

Thank you for playing on #scobowl. Here are the rules:

  • To start the bot, type in !start, and then type in !join Home or !join Away. See the commands list for a more powerful version of the !start command.

  • TriviaBot will give you toss-up questions sentence by sentence. After it finishes the question you have 15 seconds to answer. If no one answers within 15 seconds, the bot gives out the answer, and nobody scores for that round.

  • To answer a question, post "buzz". After TriviaBot prompts you, answer the question. You will have 20 seconds to type out your answer. Answers are not case-sensitive.

  • If the score is tied by the time the game finishes its final round, the game will go into sudden death until one team gets a question.

  • It is now possible to play with bonuses. To turn on bonsuses, type in !set bonuses on. When a question is answered successfully, the team is given a bonus. To answer the bonus, buzz in. There are usually 3 bonus parts per bonus question.

  • If there is an error, please use !comment to report it. If it is a problem with the question, please include the question ID.

  • Flooding, trolling, and the like will result in a ban. Don't try it.

  • If you need any additional help, ask one of the ops, or email ncscobowl at

  • You can download the zipped source for TriviaBot here.

    List of user commands:

    !start Starts a regular 30 round game with a maximum of five people per teams. Default team names are Home and Away. If a game has already been played, !start uses the same parameters as before.
    !start (String team1, String team2, int rounds, int maxNumberofPlayersPerTeam, Pattern allowedQuestions, Pattern unallowedQuestions, Pattern set) Starts a game. All of the parameters are optional; however, if you only want to modify one parameter (for exapmle, rounds), then you must still put in commas.

    Examples: !start Alpha, Beta, 20, 1, .*, Biology, acffall|acfreg - Starts a 20-round game with teams Alpha and Beta. 1 person can play on each team, and all questions except Biology ones are allowed. This game uses the acffall and acfreg sets.

    !start ,,,,Literature - Starts a regular game with only Literature questions.

    !join (String teamname) Joins the team. During the joining period, you can switch teams. If you haven't played in the game yet, you can also join a team.
    !random Joins a random team. It has the same restrictions as !join.
    !remove (String player) Removes the player from the game. Regular players can only remove themselves, while gamemasters and ops can remove anyone.
    !pause Pauses the game.
    !unpause Unpauses the game.
    !score Returns the score of the current game.
    !help Gives you some basic information. Useless if you're reading this.
    !teams Displays the list of teams available to join, and the players on each team.
    !size Returns the size of the question set.
    !size (String category) Returns the size of the question set for that category. Example: !size Art
    !comment (String comment) Comment an error or suggestion. If you are commenting on a question error, please include the question ID in the comment.
    !team (String player) Shows what team a player is on.
    !stats (String player) Shows the overall stats for that particular player. The command is case-sensitive.
    !curstats (String player) Shows the stats for that particular player in the current game. The command is case-sensitive.
    !get (String variableName) Retrieves one of the following variables:
    comment (or com)
    freq (String search_term)

    Operator/Gamemaster only commands

    !stop Ends the game without saving any stats.
    !reload Reloads the question set.
    !loadset (Pattern theSet) Loads the set theSet. For example, "!loadset acf" will load the acf set. Note that theSet is a regular expression, so it will load all sets that contain theSet in itself.
    It's also important to know that !loadset appends ".*" to the end of the line, which is why typing in just acf matches all acf sets. To load all of the sets of a certain type (i.e., all acf and pace sets), you can use something like "!loadset acf.*|pace" to load them.
    !loadbonuses (Pattern theBonusSet) Loads the bonus set theSet. Similar rules apply for !loadbonuses as for !loadset. For example, to load all acfreg bonuses, do "!loadbonuses bonus-acfreg".
    !correct (String player) (int score) Gives the player and the team points. Add 10 if they did not neg, 15 if they did neg when negs are turned on. If bonuses are on, it will stop the tossup and go to a bonus.
    !incorrect (String teamname) (int score) Takes away points from the player and the team. Subtract 10 if they would not have negged, and 15 if they would have negged when negs are turned on.
    !bcorrect (String team) (int score) Gives the team the specified number of points. Bonuses must be turned on.
    !bincorrect (String team) (int score) Takes away the specified number of points from the team. The score given should be positive, and bonuses must be turned on.
    !givebonus (String team) Gives the specified team a bonus, interrupting the current tossup.
    !kill Ends the question currently being asked, while showing what the answer was. Used to prevent vulturing when someone got an answer correct, but was not recognized as such by the bot.
    !clearcom Clears the !comment list. (op-only)
    !default Restores all of the bot's options and parameters to its default setting specified in settings.txt.
    !get q (int ID) or !get question (int ID) Retrieves the question in the set with the given ID.
    !next Moves to the next tossup when force mode is on.
    !set (value) Sets the variable to the new value. If the variable does not represent a number, player, or team, then the values that the variable will accept are on and off.
    The variables that can be changed with !set are:
    messageDelay (op-only)
    loadqset (op-only)
    !exit Forces the bot to quit. Do not use unless it's necessary. (op-only)

    Variable Descriptions

    negs (on/off) Determines if the player can neg (get -5 if they're the first one to buzz in and miss the question).
    rounds (integer) The number of rounds in a match.
    teams The name of the teams playing.
    delay (integer) How long the bot waits for each character to be read. Is measured in milliseconds. A normal delay value is between 40 and 80 ms.
    minMVP (integer) The minimum number of players needed to give out MVP/LVP awards.
    gameswoReload (integer) The number of games that have been played without reloading the set.
    limwoReload (integer) The maximum number of games that can be played before reloading the set.
    comment/com Returns the comments made by players using the !comment command.
    players The players playing the current game.
    allPlayers Returns every player who has played on the bot since it has been connected.
    allowedQ (Pattern) The categories the bot can ask from.
    unallowedQ (Pattern) The categories the bot cannot ask from.
    version The current version of the bot.
    breakBtwQ (integer) The length of time between ending a tossup/bonus and starting a new tossup. Measured in milliseconds.
    breakBtwBonuses (integer) The length of time between each bonus part. Measured in milliseconds.
    showCategory (on/off) Determines if the bot shows the category of the question being read.
    answerDelay (integer) The amount of time the player has to answer a question. Measured in seconds. A normal value is around 20 seconds.
    messageDelay (integer) The amount of time allowed for the bot to send two messages in a row. Measured in milliseconds. Should be in the 100s.
    gamemaster The gamemaster has access to additional commands which can change the score, change gameplay values, and stop the bot. The gamemaster variable holds the player who is currently the gamemaster.
    playersPerTeam (integer) The maximum number of players allowed on a team.
    askBySent (on/off) Determines whether questions are posted sentence by sentence (on) or by a specified number of words per line (off).
    numWorsPerLine (integer) Determines the number of words per line to use when askBySent is off.
    freq (String answer) Determines how often the answer shows up in tossups.
    timeToJoin (integer) The length of the joining period.
    paused (on/off) Determines if the game is currently paused.
    set The current set(s) being played.
    sets All the playable sets of tossups.
    bonusSets All the playable sets of bonuses.
    forceMode (on/off) Determines if the bot stops after each tossup/bonus cycle so that people can apply corrections if needed.
    inOrder (on/off) Determines if questions in the set are picked in order (on) or randomly (off).
    startIndex (integer) The first question when inOrder is on.
    halftimeLength (integer) The length of time taken up for halftime. Time is in milliseconds.

    Version history:

    -Fixed the buzzing at the same time bug (use answerDelay)
    -Brought bag MATHRND
    -Trimmed the text for spaces
    -Added response strings to !comment and !request
    -Shows stats at end of game
    -Made an upper boundary for number of questions
    -The "10 seconds left" only happens if answerDelay == 0
    -addToTeam(),deVoiceTeam(), and giveVoice() added
    -Keeps track of nick changes
    -Doesn't give hints right after a person answers
    -deVoiceTeam() method fixed
    -Added getPlayerFromAllPlayers() and HashSet allPlayers
    -Changed !stats to use allPlayers instead of players
    -Fixed !dummy code
    -Increased answerDelay to 11
    -Added "Parsing error" if the question cannot be parsed correctly
    -Voicing stopped
    -Allow people to switch between teams during joining period
    -Fixed questionNum bug
    -Fixed joining bug
    -Allow people to join game during gameplay if they have not played in that game yet
    -Used regular expressions to store answers
    -Got rid of the seconds variable in Question
    -Changed URL in !help
    -Fixed !stats bug
    -Tells players when there are 5 seconds left.
    -2nd Team doesn't get renamed with !start Team1, Team2 fixed
    -Only shows score when there's a game going on
    -Added !teams/!team commands
    -Fixed bug where you could buzz in after the round was over if nobody answered.
    -Question automatically adds period to end of question if there is no period/question mark at the end of it.
    -!comment and !request attach the sender to the message.
    -Added !correct (team) to list of commands.  Somewhat buggy.
    -Fixed "only 1 team can guess" bug in round 1
    -Filename bug gone - abc and ABC will no longer share the same stats file
    -Added MVP/LVP stats
    -Changed Team.setGuessed() so that !correct could work
    -Saves LVP/MVP stats
    -Clears player stats when they use !stop
    -!teams shows the players on the team
    -Replaced the way the bot calculates MVP/LVP
    -Add !mvp command
    -Fixed !correct
    -Added !remove command, but it does not seem to work in this version.
    -The bot now trims any whitespace before it displays a sentence
    -!delay and !reload now send messages confirming that the desired action occurred.
    -Replaced the Player toString() method: it now only shows the name.
    -Shows size of set after a reload
    -Fixed exploit in !get (using !get with any number lower than 0 would cause an error)
    -Fixed LVP code
    -Changed MVP/LVP formula to 15 * correct - 5 * guessed
    1.10 & 1.11
    -Fixes "still playing if !start fails" bug
    -You can now answer with decimals
    -Questions can now have decimals in them
    -Dummy automatically joins a game if there's only one player playing
    -Changed !dummy code so that it would be more efficient
    -Changed the askQuestion() code so that it could support decimals
    -Added !random command
    -Added !load command
    -Got rid of "double game" bug
    -!correct code fixed
    -!nummvp added.
    -Changed !load to !loadset, added !loadplayer
    -Buzzing in after question finishes bug should be fixed.
    -!correct fixed some more
    -!incorrect command added?
    -!start updated (now !start Team1,Team2,numRounds,numPlayersPerRound,allowedQ,unallowedQ )
    -Added !negs and !setnegs command
    -Added negs
    -The set no longer reloads itself after every game; it is now variable.  Default is set to 3.
    -Added code to handle ties (when there are no more questions left in the set)
    -Changed onDisconnect() code; TriviaBot should now properly reconnect if it's nick still exists on the channel.
    -Made various code changes, such as
    	-Adding write() method so that TriviaBot could log errors disconnect errors (Added Date class to make error-logging easier)
    	-Restructuring code so that it would use for-each loops instead of iterators
    	-Eliminating the Arrays and Iterator import
    	-Making the ArrayList questions only accept questions in the ArrayList
    	-Changed hashCode() method in Player so that players could be added and retrieved more quickly
    	-Various other code-restructuring changes
    -Eliminated !topic, !add, !getreq, !clearreq, and !request commands because it's never used,
    -Eliminated !delay, !mvp, !minMVP, !get, !negs, and !getcom --> now replaced by !get (variable) and !set (variable)
    -Changed !correct and !incorrect to make it much more lenient and flexible
    -Neg bug fixed
    -Added Gamemaster
    -Ability to hide category title
    -Add answerDelay to !get/!set  [old answerDelay renamed to answerTime to clarify the variables]
    -Add an option file for the default values
    -Got rid of loading the topic at startup
    -No ID on timed-out question fixed.
    -Break between questions now a variable (breakBtwQ)
    -Add a set parameter to !start (so it's now !start Team1, Team2, numRounds, numPlayersPerRound, allowedQ, unallowedQ, set)
    -Fixed bug where set would keep reloading a set that didn't contain a category in allowedQ
    -Fixed "no neg after time runs out" bug
    -Fixed major bug where the last letter of a word was optional (thanks to ikillkenny)
    -Fixed bug where you could make two teams with the same name?
    -Changed code in Question so that you only needed to put things in parantheses to make parts optional (instead of needing ?? at times)
    -Added simple prompts
    -Loading sets now very different; each set is built up of smaller sets
    -Added several variables to !get/!set
    -Made apostrophes optional
    -Changed gamemaster so that it's a variable in tbot, not in Player
    -Used toLoweCase() before calling loadSet()
    -Made bot list correct answers, negs, and total questions answered for stats
    -Changed halftime variable when using !set rounds
    -Fixed problem caused by doing !get (number)
    -Made it give only one neg per question
    -Got rid of Dummy, since it was no longer needed
    -Added a !set gamemaster command
    -Redid MVP/LVP code to take (actual) points into account
    -Got rid of !setreload because it was redundant
    -Add a !kill function that kills the question
    -Fix bug where you can set rounds to be more than the number of questions
    -Fix div by 0 error for when a player who hasn't played yet asks for stats
    -Made it so !set rounds can't set it below 0
    -Made !kill show the correct answer and question ID
    -Make sets loadable via regular expressions
    -Fixed NullPointerException that would occur when people left the room
    -Made it so !set gamemaster could only be done on current players in the room.
    -Changed it so it now says "Joining Period! " (timeToJoin) " seconds!"
    -Fixed !loadset error that would cause an IndexOutofBounds error
    -Fixed bug where !set (number) causes an error when done by an op
    -Make commands based on players case insensitive
    -Prevented a bug where it would sleep a negative time for halftime.
    -Got rid of adding a hash to player's names (really unnecessary because stats don't matter and since IRC is case-insensitive about duplicate names)
    -Changed RunThread class to GameThread (since it's more descriptive).
    -Added a pause feature.
    -Made maingame static, which should theoretically make it faster.
    -Fixed "person has infinite amount of time to answer question" bug.
    - Bonuses! (thanks to Mike Bentley)
    - !stop is now a gamemaster-only command
    - Made an "update qSets" function
    - Change the ask by sentence code to use split instead of indexOf's.
    - Fixed bug where the answer and score would not be displayed at the end of the game.
    - Fixed bug where halftime wouldn't be updated if rounds was an improper value (in start())
    - !remove now works.  Furthermore, players can now remove themselves.
    - Fixed bug where !stop would show the next question's category
    - Fixed bug where first question would always run down the countdown timer.
    - Fixed force mode.
    - Fixed bug where the game could be started with more rounds than bonus questions
    - Fixed bug where !remove didn't work properly for the gamemaster.
    - loadSet now ignores case
    - added additional checks for some set options.
    - !get sets and !get bonussets now break up the list into separate lines
    - bot now exits if settings.txt file is incomplete
    - Added !default flag to revert settings back to default ones.
    - loadSet catches invalid regular expressions [does not handle them completely correctly]
    - If !correct, !incorrect, or !bcorrect fails, the name used is now shown.
    - Made !set gamemaster case insensitive
    - ???? Gamemaster is no longer removed automatically if they leave
    - Using !remove now saves the players stats
    - Stats directory now determined by settings.txt
    - Fixed bug where game ended immediately after the last question was read if a player negged
    - Added a halftimeLength variable that determines how long halftime runs for in seconds
    - Modified seed to be a little less predictable
    - Made MVP/LVP code more efficient
    - Fixed force mode pausing issues.
    - Timer now counts down correctly after !bcorrect is used
    - Merged !bcorrect with !correct; !bcorrect now add points to teams (used for bonuses).
    - Added !bincorrect
    - Made !correct/!incorrect print more detailed information.
    - Fixed bug where people could get unlimited prompts by adding spaces
    - !loadqset now works without having to supply arguments
    - ???? !stop can no longer display the next question?
    - Time between bonuses can now be set with breakBtwBonuses
    - Nickname, channel, password, and server are now determined by the settings file
    - Bot now only takes "buzz" (or buzz surrounded with whitespace characters) for buzzing in.
    - !start by itself now uses the same settings as the previous game
    - if allowedQ/unallowedQ is different and changed as a !start parameter, the set is reloaded.
    - Possibly fixed ghosting code?
    - Name changed to "QBBot" in !get version.