Inactive [FUN] Lottery 0.6.3 - Let your users buy tickets to a lottery - [superPerms] [1060]

Discussion in 'Inactive/Unsupported Plugins' started by Erbros, Mar 14, 2011.

  1. Offline

    Erbros

    Lottery - The Lottery Plugin:

    I will only be using the BukkitDev website from now on. Please ask for help, submit bugs or enchantments and download the plugin from my page there (LINK).

    This thread is no longer updated - check my page on BukkitDev.


    Beware: Now only supporting superPerms from 0.6.2 and onwards!

    Version: v 0.6.2

    This plugin lets your users buy tickets for a price you decide to a lottery drawing.

    Features:
    • Users buy a ticket and can win the money of everyone that have bought a ticket.
    • Configurable price, material (including money/coins) and hours between lottery drawings.
    • Supports iConomy v4, iConomy v5, iConomy v6, BOSEconomy v6, BOSEconomy v7, Eco Essentials and MultiCurrency. Thanks to @KHobbits
    • Permission nodes supporting superPerms (Bukkits default permission system)
    Download:

    The Lottery Plugin v. 0.6.2

    Old releases:
    Source Code (This is my first project ever in java, so I would appreciate any advice in

    how to improve my coding very much)

    Configuration:

    In the configuration that is made when the plugin is run the first time, you don't get comments about the different options. Here you do!


    Code:
    #How many hours between every lottery drawing? Only whole numbers above 0 (like 1 or 2 or 3.... 24 or 25...)
    hours: '24'
    # The next execution option is really not to be touched. Its time in millisecs since 1. January 1970.
    nextexec: 1300368259883
    # Cost is the amount the buyer got to pay to buy a ticket. This applies both to iConomy coins and material. Only whole numbers. Negative numbers will probably work, but I don't see the point.
    cost: '5'
    #The material setting lets you choose which Material Value your users got to pay with, and get if they win. (its the "dec(imal)", value)
    material: '266'
    # If you want to use iConomy coins, set it to "true". If you want to choose your own material (block or item), set it to false.
    useiConomy: 'false'
    # If broadcastBuying is set to false, there will not be sent a message to every player when somebody buys a ticket.
    broadcastBuying: 'true'
    # welcomeMessage decides if there should be sent a message to the player on join about time until draw.
    welcomeMessage: 'true'
    #extraInPot just holds the amount of extra winnings in the pot has been added with /lottery addtopot
    extraInPot: 0
    #clearExtraInPot decides whether the plugin set extraInPot=0 after lottery draw, or if the same amount will stay until somebody changes it with /lottery addtopot <+/-> <amount>
    clearExtraInPot: true
    #netPayout is the percentage of the total pot that is being paid out to the winner. This can be as large as you wish, but not lower than 1 (one). 100 = 100%, which means the winner will get exactly as much as the players have paid in while buying tickets.
    netPayout: 100
    #maxTicketsEachUser sets the max amount of tickets each player can buy
    maxTicketsEachUser: 1
    #debug - This won't show up by itself, and there is really no reason for you to have this unless there is something wrong with your install of the plugin.
    debug: false
    Commands:
    /lottery : Basic information
    /lottery buy <number> : Buy one or <number> of tickets.
    /lottery help : Help pages
    /lottery winners : List over 10 last winners
    /lottery draw : Force the drawing to happen. Op only if not permission plugin.
    /lottery addtopot : Adds extra money/items to the pot. Op only if not permission plugin.
    /lottery config <cost/hours/max/maxTicketsEachUser/reload> : Change/reload the config ingame.

    Permissions:
    If you have Permission plugin installed you must add the nodes you need to the config.

    lottery.buy : Gives you all the basic rights /lottery (buy, help, winners).
    Given to all players by default, remove from users/groups if you want to deny them.
    lottery.admin.draw : Gives the group/user access to the /lottery draw command.
    Given to OP's.
    lottery.admin.addtopot : Gives the group/user access to the /lottery addtopot command
    Given to OP's.
    lottery.admin.editconfig : Grant access to edit/reload the lottery config ingame NEW
    Given to OP's.

    Changelog:
    Version 0.6.3:
    • Fixed ClassCastException when using commands from console.
    Version 0.6.2:
    • Supporting superPerms.
    • Removed support for any other permission system.
    • Fixing plugin.yml, so even those not using superperms will have basic lottery.buy given to all users by default, and all OP's will get admin commands.
    Version 0.6.1:
    • Removed showing days in time until draw.
    Version 0.6.0:
    • Adding ability to reload config ingame.
    • Edit the config variables cost, hours and maxTicketsEachUser ingame.
    • Debugging information.
    Old Changelogs (open)


    Version 0.5.6:
    • Hopefully fixed lottery not drawing when it should..
    Version 0.5.5:

    • Fixing users able to buy negative amount of tickets (and again... very stupid mistake by me....)
    Version 0.5.4:

    • Fixing users able to buy negative amount of tickets (again since I forgot to re-add it after merge).
    • Giving users the remaining tickets they can buy if they try to buy too many.
    Version 0.5.3:

    • Max number of tickets a user can buy.
    • Typos
    Version 0.5.2:

    • Implemented a lot of changes by @KHobbits
      • Now supporting iConomy4, iConomy5, iConomy6, BOSEconomy6, BOSEconomy6, MultiCurrency, EcoEssentials
      • Code cleanup
    Version 0.5.1:

    • Don't let players buy a negative amount of tickets... Stupid error...
    Version 0.5.0:

    • Users can buy more than one ticket each now.
    Version 0.4.5:
    • Fixed so correct lottery amount is shown everywhere, WinningAmount() implementing netPayout;
    • Ability to let the plugin remember the money that is added to extraInPot.
    • Fixed NPE when "/lottery addtopot" wasn't followed by a number.
    Version 0.4.4:

    • Added payout percentage configuration.
    • Attempt to fix some of the "waiting for draw to occur" on servers with slight lag.
    Version 0.4.3:

    • Updated for iConomy v5. Not working with v4 anymore.
    • Fixed a new system for timers, it shouldn't take that much time to do a draw even on a laggy server.
    • If time is set to lower in config than is remaining on countdown, set to new value.
    Version 0.4.2:

    • Not setting extraInPot to 0 after draw, only saving it to config.
    • Draw in: -51 seconds no longer occur, now its "Draw in: Draw will occur soon"
    Version 0.4.1:

    • Fixed: Not saving config after updating extraInPot.
    Version 0.4:

    • Permission support
    • Command to add extra money in pot.
    Version 0.3.1:

    • Fixed timers not closing properly. Possible memory leak! Important update!
    Version 0.3:

    • Info about pot size in /lottery
    • Choose if you want players to get time until draw message on join.
    Version 0.2.4:

    • Fixed the same problem as in last release, just properly this time.
    Version 0.2.3:

    • Changed from onPluginEnable to PluginEnableEvent.
    Version 0.2.2:

    • Option to broadcast public to the whole server when somebody buys a ticket.
    • Added colors to the lottery chat messages.
    Version 0.2.1:

    • Formatting material names. GOLD_INGOT -> Gold ingot
    Version 0.2

    • Added commands: /lottery (help, winners, claim, draw)
    • Added material support.
    • List over 10 last winners with /lottery winners
    Version 0.1

    • Lottery plugin is released.



    Tutorial:


    Video by @ValBGaming

    PS: The /lottery claim command is used when you are using material and you win, since blocks/items can only be given to online players :)

    Todo:

    • A set number of tickets available, and let the user choose which one to buy. If nobody had the right ticket, add money to jackpot for next drawing. (low)
    • Using configurable array of prize items instead of getting whats in the pot. (low)
    • Show time left when it's 2 hours left, 1 hour left etc. Configurable. (low)
    • Let admins give out free tickets. (normal)
     
  2. Offline

    Erbros

    Lottery 0.7.2 released.
     
  3. Offline

    np98765

    Please support Yeti Permissions 3.0!
     
  4. Offline

    Tanite

    Minor typo :D

    "There is 37 tickets left." should be "There are 37 tickets left."
     
  5. Offline

    Erbros

    I am only supporting bukkit superPerms. The default values should be good enough tho, so I doubt you will have any problems.

    Thank you, I'll fix it :D
     
  6. Offline

    Cocktailsauce

    whats wrong?
    [​IMG]
     
  7. Offline

    Erbros

    You are not using the new permission system (pex, bpermissions?)? What command are you trying to access?

    This problems comes when the built in bukkit permission system can't find the required permission node. Look up superPerms on the forums.
     
  8. Offline

    nickbouwhuis

    Can I set the time for the draw? I want it to be 15.00 so I can send automatic messages to people. Now It just counts from the time the plugin was loaded?
     
  9. Offline

    Erbros

    Make a ticket about it in the BukkitDev page and I'll think about it :)
     
  10. Offline

    erdrickk

    For some reason when I make changes to the config file and reboot the config file gets reset. Any reason for this? Mainly trying to get the Login lottery message turned off...but as I said - I edit the config, upload it start the server and it resets back to true...
     
  11. Offline

    Ltcheesecracker

    Hmm, well I was wondering why it stopped working... This is quite a bummer that you've only continued it with superPerms. I really like this plugin, it was very popular among my players, but in all honesty, Permissions 3 just works better. :p Still no chance you'd update it for Perms 3?
     
  12. Offline

    Shaybio

    i got an error when i buy tickets: an internal error occured while attempting to perform this command
    please help me
     
  13. Offline

    Erbros

    I need some more info.

    I'm really sorry, but my spare time is very limited at the moment, and I see superPerms as the future.

    It don't work well enough with just the default permissions?

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

    Ltcheesecracker

    No it's not that there is something wrong with SuperPerms, and I'm sure your plugin works perfectly well with it, it is jsut that not many of my plugins are compatible with SuperPerms. :p
     
  15. Offline

    Mr. Hollywood

    i have a problem...
    the lottery works well but there is one problem
    the only one that wins is the admin (me)
    please say me how to fix it.
     
  16. Offline

    Erbros

    No, what I ment to ask is if the plugin don't work well enough with the default values the plugin set if no superPerm plugin is found. :)

    I'm pretty sure this isn't caused by the plugin, but if you have any detailed information about this and have a way for me to reproduce the error, then please tell me :D

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 12, 2016
  17. Offline

    Mr. Hollywood

    The strange thing is that no error emerges
     
  18. Offline

    np98765

    SUPPORT PERMISSIONS!!!


     
  19. Offline

    Erbros

    Last edited by a moderator: May 12, 2016
  20. Offline

    Technerd255

    Can you please add EssentialsEco support?
     
  21. Offline

    Kylefraser

    PLEASE update this because this is an awesome plugin that i want to use in my 1.0.0 server
     
  22. Offline

    Pwnagedude10

    Is there anyway to disable the Jackpot winning?
     
  23. Offline

    Erbros

    Set numberOfTickets: 0

    I am using it on my 1.0 server. Any errors?

    I support everything supported by Register plugin, and thus should EssentialsEco be supported.
     
  24. Offline

    Kylefraser

    No its working perfectly but it be really cool if like somehow u can make it into a sign and people cant just punch it and they buy a lottery.
     
  25. Offline

    Erbros

    This should be pretty easy to implement. If you add it as a ticket to the Lottery dev.bukkit.org site I'll add it when I have time (est 1-2 weeks).
     
  26. Offline

    GimmeCookie

    Code:
    2012-01-29 10:14:38 [SEVERE] Error occurred while enabling Lottery v0.7.4 (Is it up to date?): For input string: "50,00"
    java.lang.NumberFormatException: For input string: "50,00"
        at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source)
        at java.lang.Double.parseDouble(Unknown Source)
        at net.erbros.Lottery.Etc.formatAmount(Etc.java:298)
        at net.erbros.Lottery.Etc.loadConfig(Etc.java:120)
        at net.erbros.Lottery.Lottery.onEnable(Lottery.java:81)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:231)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:379)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:191)
        at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:174)
        at net.minecraft.server.MinecraftServer.t(MinecraftServer.java:356)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:343)
        at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:175)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:407)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
     
  27. Offline

    Erbros

    Thats the problem. Change from "50,00" to "50.00"
     
  28. Offline

    ScubaXsniper

    I am somewhat a noob to Bukkit, just keep that in mind lol.

    Anyways, the Jackpot keeps winning.

    Here is the config file:
    Code:
    config:
      cost: 100
      hours: 3
      nextexec: 1329176155729
      material: 266
      useiConomy: true
      broadcastBuying: true
      welcomeMessage: true
      extraInPot: 0
      clearExtraInPot: true
      netPayout: 100
      maxTicketsEachUser: 1
      numberOfTicketsAvailable: 0
      jackpot: 2300
      debug: false
      lastwinner: Jackpot
      lastwinneramount: 2300
    message:
      welcome: '&6[LOTTERY] &fDraw in: &c%drawLong%'
    What am I doing wrong? I changed the numberoftickets to 0, like you mentioned in a post above me. Please help!
     
  29. Offline

    kukelekuuk00

    Im curious if this plugin is updated to the new events system as the old one was removed starting CB 1944.
    Just a headsup before the coming RB which will cause quite the mess :p
     
  30. Offline

    Erbros

    KHobbits will be updating it :D Please check out dev.bukkit.org/server-mods/Lottery
     
  31. Offline

    tomtiger333

    please update soon!
     

Share This Page