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

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    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.


    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)

    This post has been edited 19 times. It was last edited by Erbros Sep 13, 2011.
  2.  
  3. Offline

    _-DarkMinecrafter-_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I have edit the .java and i have try to compile it with javac, but there where 100 errors :( What have make I false ?
    Code:
    javac Etc.java
  4. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  5. Offline

    ValBGaming

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hey Erbros, I did a tutorial/review of this plugin. :)

  6. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thank you very much. I'll put it in my first post :)

    This post has been edited 1 time. It was last edited by Erbros Aug 1, 2011.
  7. Offline

    _-DarkMinecrafter-_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    can you please add costum messages it's realy important !!
    And what also important is the limit of the tickets!
    Many user a angry in my server about, because rich people buy so many tickets that the other have no chance

    This post has been edited 1 time. It was last edited by _-DarkMinecrafter-_ Aug 1, 2011.
  8. Offline

    FaeDine

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I just wanted to give my thanks for this plugin. I recently added it to my server and a lot of players are going lottery crazy. It's fun! Thank you very much!! :D
  9. Offline

    dm_studios

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Just a heads up the plugin still states 0.5.0 in the source (plugin.yml) even though its 0.5.1 :)
  10. Offline

    AS1LV3RN1NJA

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    The title of the thread still says 0.5.1.
  11. Offline

    jmcneely

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    When I start up the server it says "Lottery version 0.5.4 is enabled" yet when I enter the command /lottery it only shows me the remaining time till draw and "An internal error occurred while attempting to perform this command" with this error message on the console:
    Code:
    21:12:34 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'lott
    ery' in plugin Lottery v0.5.4
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:12
    9)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:3
    20)
            at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.
    java:713)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:677)
    
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:670)
            at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:33)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
            at net.erbros.Lottery.Lottery$1.onCommand(Lottery.java:135)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
  12. Offline

    Brody Romhanyi

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    why doesnt the lottery draw its self? it got to like 0 mins then it said draw will be comming soon for like 30 more mins then i was just forced to draw it manely
  13. Offline

    _-DarkMinecrafter-_

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    You can already buy -1 tickets !
    And I have version 0.5.4 !

    This post has been edited 1 time. It was last edited by _-DarkMinecrafter-_ Aug 4, 2011.
  14. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks for the error report. What economy plugin are you using?

    Wow, thanks! I found a really dumb mistake by me.. Fixed now, 0.5.5 out.
  15. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yeah, I noticed that error myself. I'll have to check into it asap :)
  16. Offline

    Brody Romhanyi

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ok thank you tell me when its fixed
  17. Offline

    andrewkm

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Erbros
    +1 same issue here.
    Btw thanks for including KHobbits patch! :)

    This post has been edited 1 time. It was last edited by andrewkm Aug 4, 2011.
  18. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I do think it's fixed in the newest release, at least as far as I was able to test.
  19. Offline

    andrewkm

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    @Erbros
    The newest release still shows 0.5.5 in console. Where would I be able to get 0.60?
  20. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    It's probably just me forgetting to update version number. :) If you can do "/lottery config", then you hav e0.6.0
  21. Offline

    andrewkm

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Yup guess its 0.60 then :p
  22. Offline

    Mustek

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Hi there, before I go ahead and install this, quick question.

    I see a lot about iconomy, but how does betting with blocks work?
    Can you define how much blocks or items you have to pay for a ticket?
    And can you define how much items you can win, or how does it work?
  23. Offline

    jmcneely

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    nevermind, I made a stupid. In my test server, I forgot to change useiconomy to false.

    This post has been edited 1 time. It was last edited by jmcneely Aug 10, 2011.
  24. Offline

    kahlilnc

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Love the update :D
  25. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Good! :)
    You define the item/block used as "coins" and the cost (number of items/blocks) for each ticket. It then works just like a lottery with coins, except that the winner will have to do "/lottery claim" to get the blocks/items he won.

    The winner win as much items/blocks:

    cost * number of tickets bought * netPayout / 100 = winning amount of blocks / items

    Just test it out on a test server to get to know the variables etc. ;)

    Thanks for the feedback :)

    Thanks! :D
  26. Offline

    thestriker095

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Welcome Message setting not working for me?
  27. Offline

    jamietech

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Does this alert the player on their next join if they won the lottery?
  28. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    No, I'll add it to todo list.
    The players don't get any notice? Show me your config.yml + server startup log from server.log
  29. Offline

    Erbros

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thank you :)
  30. Offline

    thestriker095

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    well its not that they cant see it its that i cant disable it when it is set to false the message still appears upon joining.
  31. Offline

    jamietech

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    woo :D
  32. Offline

    prelude85

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Nice plugin mate! I like the idea and think its great to add to my server. I have just 1 prop. :) Can i configure the Min. ammount of players?

    Expecialy when its not known you can join the lottery i see it happen 1 or 2 ppl keep placing bets.

    In my case, i want to stimulate economy for people who have little experiance, so i want to set the payout to 150% or 200% even.

    Even better is that you allow the option to set a fixed POT price.

    e.g. 1000 bucks.

    People buy tickets for 50 each.

    Min participants 10
    Days before drawing: 72 hours

    And maybe add some type of reporting like


    Like "7 people are playing for the next drawing on 18-08-2011, the price pot is 1000 bucks (or 150% of deposit). 3 more players are needed for the next drawing"

    Then in case theres not enough players, it will renew with 72 hours.

Share This Page