Votifier Listener - Multiple Random Rewards

Discussion in 'Archived: Plugin Requests' started by BlackBeltPanda, Jul 1, 2013.

  1. Offline

    BlackBeltPanda

    I run a server called PandaCraft and I'd like a listener for Votifier that would be more likely to get the players on my server to vote. I believe this listener would benefit everyone and could be pretty popular.

    Plugin category: Economy

    Suggested name: PCVoteReward or VoteReward

    What I want: Basically, it needs to reward a player for voting by sending them a random amount of a certain item randomly picked from a list of items, a random amount of money, and a random amount of experience. I'd like it to be able to save users who were offline when they voted in a pending users file and issue the rewards when they log in. I'd also like a reminder and top-voter feature. Here's some details and an example config:

    *Award random items from list.
    -Format
    -(Item Name/ID),(Min Quant.),(Max Quant.)

    *Award random money amount. Use Vault.

    *Award random exp. amount

    *Pending list of offline voters
    -Awards items on login

    *Vote Reminder
    -If user hasn't voted within "X" hours after last vote, remind them to vote.

    *Config file:
    ItemAmt: (Number of items to pick from the list. Allows for multiple item rewards.)
    Items:
    -Item1 (ex. - Diamond, 2, 6)
    -Item2 (ex. - TNT, 8, 17)
    -Etc.
    Money: (Min),(Max)
    Exp.: (Min),(Max)
    Award if Offline: (True/False)
    Vote Reminder: (True/False)
    Reminder Hours: (X Hours)
    Reminder Message: (Message)
    Run Commands on Vote: (True/False)
    Vote Command:
    -Command1
    -Command2
    -Etc.
    Top Voter: (True/False)
    Top Voter Period: (X Days)
    Top Voter Command:
    -Command1
    -Command2
    -Etc.

    Ideas for commands: /reloadlistener

    Ideas for permissions: listener.reload

    When I'd like it by: ASAP
     
  2. Offline

    smsunarto

  3. Offline

    timtower Administrator Administrator Moderator

    smsunarto I summon the great:
    BlackBeltPanda I could make this for you, couple of questions:
    • Can you run commands when somebody votes? ( would make it so easy ) I can live with an no ( I think )
    • Are you okay with just data numbers? names are slightly more difficult
    • Doesn't votifier has an reminder option?
     
  4. Offline

    BlackBeltPanda

    1. Not sure what you're asking. I'd like the listener to run commands when somebody votes.
    2. ID numbers are fine.
    3. No, Votifier's basically just an API that relays information to the listeners; the listeners handle running functions.
     
  5. Offline

    timtower Administrator Administrator Moderator

    1. Was about making it command based, then I didn't need to hook into votifier
    2. Good to know
    Will start working on this, main functions first:
    • Vote reward
    • Award on login if voted
     
  6. Offline

    jacklin213

    No need for me to b summoned :p u have this all under control :D
     
  7. Offline

    timtower Administrator Administrator Moderator

    Where did you got summoned? :confused:
     
  8. Offline

    jacklin213

    thats the point , save the best for last :p jks
     
    timtower likes this.
  9. Offline

    timtower Administrator Administrator Moderator

    LOL
     
    jacklin213 likes this.
  10. Offline

    BlackBeltPanda

    Awesome =)
    I think getting rewarded with random useful items along with $ and exp. will be a lot more incentive for users to vote. I noticed when players accumulate lots of $ in-game, they no longer feel the need to vote. This should help =D
     
  11. Offline

    BlackBeltPanda

    Any progress? =D
     
  12. Offline

    timtower Administrator Administrator Moderator

  13. Offline

    timtower Administrator Administrator Moderator

  14. Offline

    BlackBeltPanda

    Code:
    2013-07-05 10:54:45 [SEVERE] Could not pass event VotifierEvent to VoteLikeMe v0.0.1
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35)
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
        at com.vexsoftware.votifier.net.VoteReceiver$1.run(VoteReceiver.java:181)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftTask.run(CraftTask.java:53)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:513)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
        at nl.timdebrouwer.votelikeme.VoteLikeMe.reward(VoteLikeMe.java:88)
        at nl.timdebrouwer.votelikeme.VoteLikeMe.onVote(VoteLikeMe.java:56)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
        ... 12 more
     
  15. Offline

    BlackBeltPanda

  16. Offline

    timtower Administrator Administrator Moderator

    BlackBeltPanda was gone for the weekend, wil fix when I am on my pc
     
  17. Offline

    BlackBeltPanda

    Awesome, thanks. =)
     
  18. Offline

    timtower Administrator Administrator Moderator

  19. Offline

    BlackBeltPanda

    Code:
    2013-07-07 18:36:05 [SEVERE] Could not pass event VotifierEvent to VoteLikeMe v0.0.2
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:35)
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
        at com.vexsoftware.votifier.net.VoteReceiver$1.run(VoteReceiver.java:181)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftTask.run(CraftTask.java:53)
        at org.bukkit.craftbukkit.v1_5_R3.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345)
        at net.minecraft.server.v1_5_R3.MinecraftServer.r(MinecraftServer.java:513)
        at net.minecraft.server.v1_5_R3.DedicatedServer.r(DedicatedServer.java:226)
        at net.minecraft.server.v1_5_R3.MinecraftServer.q(MinecraftServer.java:477)
        at net.minecraft.server.v1_5_R3.MinecraftServer.run(MinecraftServer.java:410)
        at net.minecraft.server.v1_5_R3.ThreadServerApplication.run(SourceFile:573)
    Caused by: java.lang.IllegalArgumentException: n must be positive
        at java.util.Random.nextInt(Random.java:300)
        at nl.timdebrouwer.votelikeme.VoteLikeMe.reward(VoteLikeMe.java:89)
        at nl.timdebrouwer.votelikeme.VoteLikeMe.onVote(VoteLikeMe.java:58)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425)
        ... 12 more
     
  20. Offline

    Retherz_

  21. Offline

    BlackBeltPanda

  22. Offline

    Retherz_

    It does, if you config it
     
  23. Offline

    BlackBeltPanda


    I already checked the config; there's no option for specifying random numbers of a list of items to award the player. The config only lets you specify specific commands to run.
     
  24. Offline

    Retherz_

    Here is a part of the config:
    Code:
     
    #    100:
    #      broadcast: '{AQUA}{username} {GOLD}was {AQUA}super lucky {GOLD}and received an {AQUA}extra $5000!'
    #      playermessage: '{AQUA}You were super lucky and received an extra $5000!'
    #      commands:
    #        - '/eco give {username} 5000'
    #
    #  The above examples would give a 1 in 50 chance of a voter receiving an extra $1000, and a 1 in 100 chance of $5000
    #  If you do not use essentials economy, the command(s) can be modified to suit whichever economy you  
    
     
  25. Offline

    timtower Administrator Administrator Moderator

    And where is the random part?

    BlackBeltPanda I am trying to fix it for you ( don't need help, small problems )
     
  26. Offline

    Retherz_

    If you put multiple with the same chance, it will be random
     
  27. Offline

    timtower Administrator Administrator Moderator

    BlackBeltPanda Think that I fixed everything, make sure to change the commands before using it on the server! Unless you want players to get kicked XD
     
  28. Offline

    BlackBeltPanda

    It doesn't limit to only one item, though. It will give as many as are randomly selected.
     
  29. Offline

    timtower Administrator Administrator Moderator

    Could you post your config file?
    EDIT: Isn't that what you wanted?
     
  30. Offline

    timtower Administrator Administrator Moderator

Share This Page