πŸ€‘ Lottery πŸ€‘


#1

Lottery[API v5]


This is a simple lottery plugin.

The time which counts down to the draw will be reset after the server is started or the game is reloaded.

Commands

  • /lottery buy [amount]: To buy the specified amount of tickets or if not specified only one ticket.
  • /lottery info: Shows how many tickets one have bought and how much is in the pot.
  • /lottery draw: Force-draw. Ignores the config-set drawInterval. (Just added for testing purposes)

Permissions

  • lottery.ticket.buy
  • lottery.draw

Config

# Format explanation: http://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-
drawInterval=PT3H
drawMessage {...}

broadcasts {
    # Broadcasts how to buy tickets when someone bought one
    broadcastTicketPurchase=false
    # Broadcasts in set interval how much is in the pot; set to PT0M to disable
    timedBroadcastInterval=PT30M
}

# The max. amount of tickets a player can buy
maxTickets=5
ticketCosts=100
# How much of the pot should be given to the winner
payoutPercentage=90

# Don't modify this!
internalData {
    boughtTickets {}
    pot=0
}

Download

Source


RandomByte


Lottery Plugin
Lottery Plugin
#2

Has this been tested enough to know that the basic functionality works? I am thinking of adding this to my server, but I fear there being an exploit of some sort that might break my economy.


#3

This is only tested a little bit. Please don't use it on an established economy system because there might be bugs.

But you could help confirming that there are no bugs to reduce the time until this plugin is released :smirk:

I will add some config explanation to the first post. I just forgotten to add it.


#4

I don't really want to test or mess around with it because the only server I have access to is my pixelmon one, but I have players playing on it and I don't want my economy to be ruined IF there is a bug.


#5

v0.1.1 released!


The changelog can be found at the above linked page


#6

explain "drawInterval=PT3H" also could you add a message for people to see when a player buys a ticket so others know the plugin is there. ie. has bought x tickets. Command: /lottery buy

also could use perms for /auto draw


#7

@Khaoz

http://docs.oracle.com/javase/8/docs/api/java/time/Duration.html#parse-java.lang.CharSequence-

Everything you need to understand the format is in the linked page.
What command do you mean with /auto draw?


#8

Yeah, im not sure who is able to draw the lotto at this point. a regular admin was able to do it and they dont have op or * perms
and I would like to see something where it announces when a player buys a ticket, and how to go about doing it; as people keep asking when it actually draws but have no clue that people are even doing it.


#9

Well, the draw command really doesn't have permissions. I'll fix that soonβ„’. Luckily, this plugin still is WIP.

So this plugin should send to all the players somewhat a command-help list when someone buys a ticket? That's like when someone uses WorldEdit and it annouces: "Hey, I'm WorldEdit, use me!". That feature will definitely be turned off by default.


#10

I mean it really just needs a way of showing to everyone when a ticket has been purchased. so maybe like

Player has purchased x amount of tickets
Next announcement: "Hey I'm..." or whatever.
So its 2 announcements, 1 is default off; the other just shows when a ticket has been purchased.


#11

v0.1.2 released!


See above linked page for the changelog.


#12

Would it be possible to add the amount of time left in the lottery to /lottery info?


#13

Yeah, I will be working on that.


#14

Cool thanks. :slight_smile:


#15

v0.2 released!


See above linked page for the changelog.


@IBG_Nova


#16

Thank you very much for your quick work!


#17

http://prntscr.com/c3rvnh

whys there a negative timer?


#18

I'll have to investigate this. A /sponge plugins reload should fix it for now. Thanks for the report!


#19

@Khaoz I hope it is fixed now!


v0.2.1 released!

The changelog can be found on the above linked page.


#20

i don't currently have a setup to compile it from source code. (no .jar available) I'll see if i cant get a mate to do it though.