[INACTIVE][FUN] Trivia v1.5 [477]

Discussion in 'Inactive/Unsupported Plugins' started by blaatz0r, Jan 22, 2011.

  1. Offline

    blaatz0r

    Current release: 1.5

    Old releases: 1.3 | 1.21 | 1.2 | 1.11 | 1.1 | 1.0

    Description:
    This is my first plugin, I made it to get a basic understanding of Bukkit and to refresh my Java skills a bit.

    Trivia is quiz game where players can answer questions by typing in the answer to a question.
    The player receives points for each correct answer and/or optionally a random item.
    Every 15 seconds or so a hint is given to make it a bit easier, but the answer will be worth less points for each hint!

    Trivia.jpg

    Features:
    - Support for Permissions plugin.
    - Fully automatic question system. Trivia reads all questions from text files when the plugin is enabled and randomly selects a new question when needed. Easy to make new questions!
    - Award points or random items to players for answering questions.
    - Shows how fast a player answered the question.
    - A player ranking is stored in a SQLite database.
    - Allows players to ask hints and skip questions.
    - Players can enable or disable Trivia messages whenever they want.
    - Players can vote to skip the current question (majority vote)
    - Super sexy command handling
    - Ops can load question files in game
    - Everything is configurable through a config file.

    Installation:
    - Install the Permissions plugin.
    - Download Trivia here and put it in your /plugins/ directory.
    - Create a folder called 'lib' in your craftbukkit directory (so it looks like this) and put this file in it (this is the database driver).

    If you run Trivia now, the console will tell you that you don't have any questions yet.
    Put your questions files in the /plugins/Trivia/questions/ directory (by default) and from within Minecraft, use the commands /trivia load to load the questions and /trivia start to start playing (op status required).

    See the section below on how to make question files. Two example files can be found here:
    - questions.txt (5000 general questions)
    - scramble.txt (800 scramble words, see below)

    A configuration file was also generated at /plugins/Trivia/Trivia.yml. Edit the settings to your liking. See the section on configuration below for options.

    Commands:
    Code:
    /trivia - enables or disabled Trivia messages for you
    /trivia help - shows the Trivia help menu
    /trivia top - shows the top 5 player scores
    /trivia rank - shows your player rank and score
    /votenext - calls a vote to skip the current question, requires majority vote
    /next - skips to the next question (need permission or be op)
    /hint - shows another hint
    
    Ops only:
    /trivia admin - shows you all admin commands
    /trivia start - starts Trivia
    /trivia stop - stops Trivia
    /trivia restart - stops and then starts Trivia
    /trivia load - reloads all files in Trivia/questions directory
    /trivia add [file] - adds the file to the questions
    Configuration:
    Nearly everything can be configured in Trivia.yml:
    Code:
    timer - the amount of time between two hints
    time-out - the amount of time between two questions, if the answer was not given
    max-hints - the maximum number of hints for a question
    reward-points - (true|false) - specify whether you want players to receive points for correct answers
    reward-items - (true|false) - specify whether you want players to receive a random item for correct answers (see items)
    points - the number of points awarded for each correct answer
    decrease - the number of points deducted per hint from the points reward
    items - list of item ID's, one of these items is randomly given to the player for a correct answer (if reward-items is true)
    db-name - the name of the database file
    questions-dir - the directory that contains your Trivia questions
    letters-per-hint - one letter will be revealed per hint for this many letters in the answer
    
    Permission nodes:
    Add the following to your plugins/Permissions/config.yml:

    Default:
    Code:
    - 'Trivia.play'
    - 'Trivia.hint'
    - 'Trivia.top'
    - 'Trivia.rank'
    - 'Trivia.vote'
    - 'Trivia.startvote'
    Admin (no need to add this, only if you want to give admin rights to individual users):
    Code:
    - 'Trivia.next'
    - 'Trivia.admin.help'
    - 'Trivia.admin.add'
    - 'Trivia.admin.load'
    - 'Trivia.admin.start'
    - 'Trivia.admin.stop'
    - 'Trivia.admin.restart'
    Adding questions:
    You can manually add questions to Trivia by editing the text files in your plugins/Trivia/questions directory. Trivia will read all files in this directory on start-up.

    You should add one question per line, in the form of:

    Code:
    Question*Answer
    So for example:

    Code:
    What is the average air speed velocity of an unladen swallow?*9001
    Answers are not case sensitive.

    Get extra questions here: M1sT3rM4n

    Scramble questions:
    A special type of question is the Scramble question: the letters of a word a scrambled and the player has to figure out the original word. Trivia randomizes the answer for you, so you don't have to provide the question. Scramble question have a special syntax:

    Code:
    Scramble*Answer
    See scramble.txt for examples.

    Known bugs:
    - Sometimes gives an error 'String Index out Of Range 72' or something alike. Working on it..
    - Ranking is bugged if you are not in the database yet

    To do:
    - Fix index out of range bug
    - Add in game loading of questions
    - Add permissions
    - Integrate with iConomy

    Source:
    Github


    Changelog:
    01/03/11: v1.5
    • Working with latest Craftbukkit: updated package structure and commands execution.
    • Source now available on GitHub!
    27/01/11: v1.3
    • Permissions support - check section on Permissions above for configuration. Old Trivia.yml file should still work.
    26/01/11: v1.21
    • Changed messages a bit, now hopefully the client breaks less often.
    25/01/11: v1.2
    • Important for new installations: From now on, the downloadable versions of Trivia only include the JAR file. Question files should be downloaded and added manually when you 're doing a fresh installation. Old versions still work as they used to.
    • Trivia is now way more robust!
      • The console will show warnings and instructions when you try to start Trivia without questions available.
      • Recoded a lot of stuff internally, better handling of questions
    • Ops can use /trivia stop and /trivia stop from within Minecraft to pause Trivia. When Trivia is not running, players can still use all commands (help, rank, top) but not /next or /votenext
    24/01/11: v1.11
    • Tried fixing chat event monitors which caused Trivia to break because of other plugins.
    • You need to download this file and put it in a directory called 'lib' in your craftbukkit folder.
    23/01/11: v1.1
    • Super sexy command handling thx to Zenexer
    • Added vote to skip question
    • Added in game question file loading
    • Added commands /trivia load, /trivia add, /votenext
    • Added op permissions to /next, /load
    • Fixed questions.txt, now all questions have correct syntax
    22/01/11: v1.0
     
    Dutchy and M1sT3rM4n like this.
  2. Offline

    LarryDickman

    oh by the way, i noticed a question in the questions folder that had a quote instead of an asterisk. What was Al Bundy's nickname during the dream sequence with all of the women in his bedroom?"Al night long. By the way i like this plugin, it is really fun to do on my server. What I like is there are a ton of questions, with a diverse category, keep up the good work.
     
  3. Offline

    blaatz0r

    Right, forgot to check the questions. I'll do that for next version :)
     
  4. Offline

    LarryDickman

    Sorry to bug you again, I notice that when I use it for more than a few minutes, my minecraft crashes. It gives me 'String Index out Of Range 72'. I am still learning a lot about this kind of stuff, so I really dont know what that means, or if it is even your plugin doing it.
     
  5. Offline

    xZise

    Hello, can you implement, that you can load the question files while the server is running?

    Sincerely
    xZise
     
  6. Offline

    Cosmic Break

    once u get permissions so only admins can turn on or off the trivia this would be awesome
     
  7. Offline

    xZise

    I also get this error. I think its when the message is to long ... don't know, I got it several times in my xWarp plugin.

    Sincerely
    xZise
     
  8. Offline

    blaatz0r

    Hm, I got this a few times at the start, but couldn't figure out where it came from. I'll check what the problem is..

    Trivia just keeps running all the time! The /trivia command only stops Trivia from sending messages to yourself.
    You can disable Trivia by using a mod such as HotSwap and then use /plugin disable Trivia.

    I'll try that :) But you could also use Hotswap for this: /plugin reload Trivia

    Thx for the comments
     
  9. Offline

    TheBoganlge

    hey dude cool plugin but what would make it awesome is if it worked with iconomy
     
  10. Offline

    blaatz0r

    Yea :D next thing to figure out, I guess
     
  11. Offline

    Cosmic Break

    i meant that i want the trivia on for everyone at the same time, but only 1 person, the admin can enable or disable it in game without disabling the plugin, just stop the messages.

    also, there should be a timer between questions when theyre answered correct.
     
  12. Offline

    blaatz0r

    Version 1.1 released, lots of stuff added including some requests :)

    Next version :)

    Gotta check some threading stuff for that.
     
  13. Offline

    M1sT3rM4n

    The format for these questions is the same as the one Trivia script I wrote for mIRC!

    Therefore, I will share some question file (which has like 500k question) with you guys so you don't have to make everything.

    1. 500k Question bank: <Edit by Moderator: Redacted mediafire url>
    2. Sex questions (YES Sex questions): <Edit by Moderator: Redacted mediafire url>

    By the way, the command for viewing ranks and Top is not working.

    Bump! Please fix asap!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 15, 2016
  14. Offline

    Kattlan

    Cant get my points to either save or show.. When I answer the question I only get "Well done Kattlan" and when the round is over it says "No one guessed right".. I get this error when I answer:

    2011-jan-23 10:16:38 org.bukkit.plugin.SimplePluginManager callEvent
    ALLVARLIG: Could not pass event PLAYER_CHAT to Trivia
    java.lang.NullPointerException
     
  15. Offline

    blaatz0r

    I'll check that stuff tomorrow.

    Are you sure you have Trivia enabled for yourself? Type '/trivia' first.
    Do you have the latest CraftBukkit?
     
  16. Offline

    M1sT3rM4n

    I am on the latest version, and here's the bug I get:

    1. Answer pops up and we answer correction.
    2. Answer re-appears again. We try to answer but Trivia won't take it.
     
  17. Offline

    Racha

    It could be cool, if people get iConomy money with correct answers
    Hope you get the idea.. sorry for bad english..
     
  18. Offline

    M1sT3rM4n

    Bumpin.
     
  19. Offline

    PwNzA

    same error for me
     
  20. Offline

    blaatz0r

    What other plugins are you all runnings? Sounds like a plugin conflict, as I can't seem to reproduce this bug. :S
     
  21. Offline

    PwNzA

    Code:
    2011-01-24 23:05:29 [INFO] Starting minecraft server version Beta 1.2_01
    2011-01-24 23:05:29 [INFO] Loading properties
    2011-01-24 23:05:29 [INFO] Starting Minecraft server on *:25565
    2011-01-24 23:05:29 [INFO] Preparing level "world"
    2011-01-24 23:05:29 [INFO] Preparing start region
    Loaded: BiomeTerrain_BiomeMod
    Loaded: BiomeTerrain_UndergroundLakeMod
    Loaded: BiomeTerrain_TreeMod
    Loaded: BiomeTerrain_TerrainMod
    Loaded: BiomeTerrain_ReplaceBlockMod
    Loaded: BiomeTerrain_DepositMod
    Loaded: BiomeTerrain_CaveMod
    Preparing spawn area: 52%
    2011-01-24 23:05:31 [INFO] [Permissions] version [1.8] (Handler) loaded
    2011-01-24 23:05:31 [INFO] [WarpGate] version [1.4] (Polarized) loaded
    2011-01-24 23:05:31 [INFO] WorldEdit 2.14.2 loaded.
    2011-01-24 23:05:31 [INFO] WorldEdit: GroupUsers detected! Using GroupUsers for
    permissions.
    2011-01-24 23:05:31 [INFO] WorldGuard 3.0b2 loaded.
    2011-01-24 23:05:31 [INFO] WorldGuard: GroupUsers detected! Using GroupUsers for
     permissions.
    2011-01-24 23:05:31 [INFO] WorldGuard: Single session is enforced.
    2011-01-24 23:05:31 [INFO] WorldGuard: TNT ignition is PERMITTED.
    2011-01-24 23:05:31 [INFO] WorldGuard: Lighters are PERMITTED.
    2011-01-24 23:05:31 [INFO] WorldGuard: Lava fire is blocked.
    2011-01-24 23:05:31 [INFO] WorldGuard: Fire spread is UNRESTRICTED.
    BorderGuard version 2.0 is enabled!
    ScrapBukkit version 0.1 is enabled!
    Bukkit of Blocks version 1.0 is enabled!
    Loading CodeRedEconomy...
    Reading properties file...
    Reading Users File...
    Reading Groups File...
    Reading Stats File...
    Reading Shops File...
    Reading Bad Words File...
    CodeRedEconomy version 0.7.1 is enabled!
    Loaded Essentials version 69 by Zenexer.
    2011-01-24 23:05:32 [INFO] [GroupUsers] version [1.4.2] is loaded!
    2011-01-24 23:05:32 [INFO] LoginQueue 2 initialized
    MCDocs version 3.1 is enabled!
    MCDocs version 4.1 is enabled!
    2011-01-24 23:05:32 [INFO] Minecart Mania Autocart version 0.5 is enabled!
    2011-01-24 23:05:32 [INFO] Minecart Mania Core version 0.7 is enabled!
    2011-01-24 23:05:32 [INFO] Minecart Mania Station version 0.1 is enabled!
    2011-01-24 23:05:32 [INFO] [rTriggers] Loaded: Version 0.3_3
    java.lang.ClassNotFoundException: org.sqlite.JDBC
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:29)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at com.bukkit.blaatz0r.Trivia.Database.connect(Database.java:37)
            at com.bukkit.blaatz0r.Trivia.Trivia.onEnable(Trivia.java:69)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:285)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:60)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:45)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    java.sql.SQLException: No suitable driver found for jdbc:sqlite:plugins\Trivia\t
    rivia.db
            at java.sql.DriverManager.getConnection(Unknown Source)
            at java.sql.DriverManager.getConnection(Unknown Source)
            at com.bukkit.blaatz0r.Trivia.Database.connect(Database.java:43)
            at com.bukkit.blaatz0r.Trivia.Trivia.onEnable(Trivia.java:69)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:285)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:175)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:60)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:45)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
            at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
            at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:177)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
    2011-01-24 23:05:32 [INFO] Trivia 1.0 enabled
    2011-01-24 23:05:32 [INFO] Done! For help, type "help" or "?"
     
  22. Offline

    blaatz0r

    This error can easily be fixed:

    - Patch Trivia to v1.11
    - Create a directory called 'lib' in your craftbukkit folder like so:
    folder.jpg

    - Download this file
    - Put in the lib folder

    The sqlite error should now be gone.
     
  23. Offline

    EmVee

    Hey, I love this plugin! It's really entertaining! Any way you could add in the ability to control the chance of getting each reward item? Thanks. :)

    EDIT: Oh, being able to set the quantity of the received items would be incredible as well.
     
  24. Offline

    blaatz0r

    I'll think of something :)
     
  25. Offline

    PwNzA

    Thank you! All problems are fixed now and it's working great :)
     
  26. Offline

    blaatz0r

    Hurray :D nice to hear that
     
  27. Offline

    M1sT3rM4n

    Will be trying the new version in a bit later tonight when I get the chance :)
     
  28. Offline

    Phraggah

    When answering a question correctly, the mod continues to display the question that was answered. Not sure of the Bukkit & Craftbukken Build No.'s, but they were from yesterday.

    There was an error
    Code:
    Jan 24, 2011 7:34:27 PM org.bukkit.plugin.SimplePluginManager callEvent
    SEVERE: Could not pass event PLAYER_CHAT to Trivia
    java.lang.IllegalArgumentException: n must be positive
            at java.util.Random.nextInt(Unknown Source)
            at com.bukkit.blaatz0r.Trivia.TriviaPlayerListener.rewardItems(TriviaPla
    yerListener.java:83)
            at com.bukkit.blaatz0r.Trivia.TriviaPlayerListener.reward(TriviaPlayerLi
    stener.java:46)
            at com.bukkit.blaatz0r.Trivia.TriviaPlayerListener.onPlayerChat(TriviaPl
    ayerListener.java:219)
            at org.bukkit.plugin.java.JavaPluginLoader.callEvent(JavaPluginLoader.ja
    va:138)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:201)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:533)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:232)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:65)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:104)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:261)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:197)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)
     
  29. Offline

    M1sT3rM4n

    That was the error I was receiving prior to 1.11, but I am now testing it. Let's see if it replicates.
     
  30. Offline

    SeeD419

    This plugin is awesome!
     

Share This Page