Inactive [GEN/MISC/FUN]PrizeRedemption 1.5 - Rewards for everyone! [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Technius, Oct 2, 2011.

  1. Offline

    Windwaker

    Is there an error? If so post the stack trace
     
  2. Offline

    staniboy

    Oh I'm sorry, I was asking if it's working....sorry about my bad English...
     
  3. Offline

    Windwaker

    Have you tried using it on your server?
     
  4. Offline

    Technius

    I built this plugin using java code and not much bukkit code, so it shouldn't break very often.
     
  5. Offline

    Windwaker

    Bukkit is not a programming language
    Java is

    Bukkit is written with Java
    Your plugin is written with Java

    I think I know what you mean though
     
  6. Offline

    staniboy

    Bukkit is an API sir.



    Thank You
     
  7. Offline

    Windwaker

    Yes, yes it is. It's still written in Java though ;)
     
  8. Offline

    Technius

    We plugin developers all use the code provided by Bukkit's API, so then we can assume that the code is owned by Bukkit. Therefore, Bukkit's code.

    I'm going to word it correctly this time:
     
    WalkerCrouse likes this.
  9. Offline

    staniboy

    Here is a few things:
    1. Spelling error in message "You have already redeemed ths code"
    2. Why do we need codes.txt instead you can just look up for text files in plugin folder and use their names as a code.
    3. Future request: Limited use codes. For example: after redeeming a code by n-number of players code becomes inactive (would be great for paying off for donations)
    4. Future request: Inventory check. If player does not have enough space in his inventory for redeem error message will pop up instead of wasting a code
    5. Future request: Ability to create codes with more than one type of item. (kits)
    6. Future request: Code life time. For example after n-days code gets automatically deleted. (limited time offers)

    Thank You
     
  10. Offline

    Raycrash

    Does it work with custom blocks ?
     
  11. Offline

    Windwaker

    No
     
  12. Offline

    Raycrash

    Then I request that you add compatibility for custom blocks =)
     
  13. Offline

    Technius

    Thanks for the suggestions! Maybe I'll come back.... Yeah, I'm definitely coming back to this.

    That's if the plugin that adds custom blocks makes the blocks have item ids. If it doesn't it won't work.

    Updates might come slow because of my um.... Skyrim addiction. Just one more dragon...
     
  14. Offline

    Raycrash

    http://dev.bukkit.org/server-mods/spoutmaterials/
    AFAIK it creates itemids, Fus Ro Dah! ;) (lvl 39 here though not so much mainquests)
     
  15. Offline

    Technius

    @staniboy
    @Raycrash
    @Phantom Index

    1.5 is out, includes most of the fixes you guys want! :p Multi-item, limited uses, and a bit more! Back to Skyrim for me.
     
  16. Offline

    staniboy

    WOW thank you so much sir! And Happy Thanks Giving!
     
    Technius likes this.
  17. Offline

    staniboy

    Code generate seems to be broken now when generating multi-item code it wont generate it
    also when multi-code created such as this
    and then redeemed you will be only awarded 265#32

    EDIT: It seems that if you define number for an item (in example: 2264) its actually works

    EDIT: Still no inventory check...
     
  18. Offline

    Technius

    265#32 = 32 of 265.

    You mean just a plain number without the #? I think I made checks where if it doesn't have a number, it doesn't add that item. Let me check.... Oh, and if a certain item doesn't exist, it doesn't get added.

    Yeah, I did state that I had to take out the inventory check.
     
  19. Offline

    Phantom Index

    I don't receive anything when i redeem a code. Needs a little more fixing bro.
     
  20. Offline

    Technius

    Old codes don't work anymore. I tested it about 10 times with multiple codes and with some amount of codes, and it always works. Did you type in the command correctly?

    example: /code create ExampleCode 1#1 6:2#5 -u 1000
    Creates the code "ExampleCode" and it rewards 1 stone, 5 birch saplings, and it can be used 1000 times.
     
  21. Offline

    Phantom Index

    didn't include the #

    takes a lot to just make a code lol. i suggest a easier to type command.
     
  22. Offline

    Technius

    Well, how else are we going to do multi-item codes? If it were like /code create 1 1 6:2 5 -u 1000 people could leave out item amounts like you did...
     
  23. Offline

    staniboy

    Well it is time saving in u let item be added without # and be counted as "one" becouse it's gets added to the kit anyway

    /code generate is broken instead of generating a code it will create a code named "generate"

    And you did not stated that u had to takeout inventory check.

    Thank You
     
  24. Offline

    Technius

    Thanks staniboy, you helped me a lot! I'm going to credit you! Anyways, what was said above goes into 1.6! And I found out why /code generate doesn't work - I forgot to make it check if it says generate.
     
  25. Offline

    Pixiio

    Searching for a long time for this! Thanks
     
  26. Offline

    KingWar92

    Didn't you just forgot "0" in string of generator ?
     
  27. Offline

    beatcomet

    You are right, but it's probably not that hard to change the chars string, right?
    I also made a random item generator, but I lost the code, if the author will ask me to make one I don't think
    It's going to be much of a problem...

    @Technius

    I got a gread idea for you!
    You can completly change the way codes are being saved by creating a file for each code.
    The file will contain the names of the players who have used it.
    The whole system will be saved in a seperate folder and there will be one file with the data (amount of uses, items etc).
    if you want an example contact me and I will show you :)

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

    Technius

    The system is already like that, the code is saved in separate files with all the redeemed players in it. I didn't think of putting it in a separate folder though. It kind of sucks that Material.getItem(String item) throws null pointers though...
     
  29. Offline

    beatcomet


    Well you can set a dir at the beggining, something like
    Code:java
    1.  
    2. File f = new File(this.getDataFolder().getAbsolutePath()+"/data").mkdirs();
    3.  


    Now it will create a new dir : <bukkitfolder>/plugins/<pluginname>/data.
    to get the contents use a for loop:

    Code:java
    1.  
    2. String fname = "";
    3. for(File file : f.listFiles()){
    4. fname = file.getName();
    5. }
    6.  


    You can use it to make an array of codes, by creating a simple function.
    After doing that you can get the values from a seperate file (this is how I would do it) and put them all in a hashmap, the key would be a String and the value would be a String.

    To add or check weather the use has already used the code you can create a simple function that checks the correct file for the username.

    If you want to do that I will be glad to help :)
     
  30. Offline

    Technius

    Of course, all that you mentioned I already use, except for the file reading.
    I use: BufferedWriter, BufferedReader, FileInputStream, FileOutputStream, File
    I might just add a config option, but I think that just a quick read/write is better than HashMaps taking up memory...
     

Share This Page