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

    murdrums

    I get told in game that the lottery will be drawn in 244 days, yet in the settings it is set to 24 hours.
    I had a few friends played a joke on me and changed my system clock to November 2011, maybe that is what has caused the problem.
    I also get this on another plugin that is meant to check every 6 hours - CraftBukkitUpToDate

    15:21:03 [INFO] The automatic update-Check only work every 6 hours, the last check was -211761 minutes ago.

    Anyway to change the server time to the CURRENT time and fix both of these plugins that are time based?
     
  3. Offline

    Erbros

    Restart your server and use /lottery draw
     
  4. Offline

    EMOberger

    suggestion:

    if a player is offline when the lottery is over there should be an announcement when that player gets on saying who won the lottery.

    other than that love this plugin!
     
  5. Offline

    DBZfan2000

    when you win do you actually get the material/
    cuz when i won it didnt give methe material and i was using gold ingots as the material.

    wait dont worry i foundthe problem :)

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

    KarnEdge

    Is there anyway to add support for being able to format the messages and coloring?
     
  7. Offline

    Jessicadawn

  8. Offline

    RG_PankO

    Actually @Erbros you got it wrong.
    Lottery is saving for itself part of the money, not to:
    "/lottery addtopot : Adds extra money/items to the pot. Op only if not permission plugin."
    I would like an option to let the winner get only 50-70% of the money, not all of the ticket's price :/
    This is how lotarry works..

    Everyone goes for his luck, but actually in the ned less money go out then went in. Like casinos, you know :)
     
  9. Offline

    spunkiie

    REQ: Please add custom messages
     
  10. Offline

    Erbros

    Did you have anything wrong with your iConomy setup? I see iConomy were throwing errors. I will check it out if you think everything was correct with your iConomy setup.

    Adding it now.
     
  11. Offline

    crohakon

    How about making it so the player that wins only gets x% of the money in the pot. That way over time the pot size grows?
     
  12. Offline

    Wakz

    How do i set the lottery time to less than 23 hours?
     
  13. Offline

    indoorman

    can you add a sign were stand how much is in the pot?
     
  14. Offline

    Chasingu

    Will this work with EssentialsEco? If so, this looks like an awesome plugin and I can see potential for it on my private server with friends.
     
  15. Offline

    Erbros

    It only works with iConomy at the moment.

    Change the config in plugins/Lottery/config.yml

    Change the variable hours to whatever amount of hours you wish. :)

    Perhaps later, thanks for the suggestion.
     
  16. Offline

    KarnEdge

    I'd like to request to be able to change the message formats and coloring if possible! Great plugin btw!
     
  17. Offline

    thestriker095

    how much time is left when it says "Draw will occur soon" ?
     
  18. Offline

    RG_PankO

    @Erbros still no update for the 60% of all bed to the winner?
     
  19. Offline

    Bronski

    A user claims it's been saying that for 4 hours. 935 here.
     
  20. Offline

    jesus_christ115

    I just had a quick question I every time I try to type /lottery addtopot it tells me there is an internal error.. I was just wondering how to fix that
     
  21. Offline

    Erbros

    Depends how much lag is on your server. I'll make it better in next release tho! :)
    Sorry, I'll do it straight away :p

    Bukkit version + Lottery version + Server error msg would help me a lot! :)

    It should be better with the new release! :)

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

    jesus_christ115

    uhm Im not sure which bukkit I have it should be the most uptodate. I use TCAdmin and update it all the time I have to lottery version. 0.4.3 I believe and the message is "An internal error occoured while trying to perform this command"

    sorry I wasnt much help with that
     
  23. Offline

    aykutmania

    Hey, config extraInPot will be overwritten after drawing :( pleeaaase fix
     
  24. Offline

    alfskan

    config extraInPot will be overwritten after drawing ! Please fix lol
     
  25. Offline

    aykutmania

    bad english? xD sooorry
     
  26. Offline

    alfskan

    no I didnt mean it.

    I wanna fix it too..lol
     
  27. Offline

    CAria

    Nice plugin, I'll have to try it out!
     
  28. Offline

    yourock129

    I set the hours for the drawing to 1 and then restart my server. When i log back on, it says "Drawing in 23 hours, 50 minutes, and 9 seconds" How do I update it?
    EDIT: Works now.
     
  29. Offline

    aykutmania

    Typo xD
    ;-)
     
  30. Offline

    Erbros

    Thank you :) I implemented the netPayout in WinningAmount() instead :)

    Also I'm releasing 0.4.5 which will let you configure the plugin not to clear extraInPot (/lottery addtopot) after draw.

    @CAria : Thank you :)

    @alfskan : Check 0.4.5 :)
     
  31. Offline

    alfskan

    Wow! THANK YOU!! now this is the best lottery plugin!
     

Share This Page