Filled Random Command Plugin

Discussion in 'Plugin Requests' started by PhillyCheezsteak, Feb 21, 2015.

Thread Status:
Not open for further replies.
  1. Plugin category: Mechanics

    Suggested name: Random Command

    What I want: A plugin that allows you to create random command lists in the config with their percentages of chance. Here is an example of the config and how it would be used.

    Config

    List1
    - '5' warp town1
    - '25' summon Pig
    - '70' spawn

    List2
    - '10' home
    - '20' summon Sheep
    - '70' summon Chicken

    So in the config the number between the ' ' is the percent chance of that command being executed and next to that is the command corresponding to the percent

    So if I would type in /RC List2 or /RandomCommand List2 it would pick one command from List2 and the chances are based off the percentages next to the commands.





    Ideas for commands: /RC (list name) and /RandomCommand (list name) same exact function

    Ideas for permissions: RandomCommand.use

    When I'd like it by: As soon as you can please :)
     
  2. Offline

    mrCookieSlime

    @PhillyCheezsteak
    I'm interested in making this as long as you're fine with me adding it to CommandOverride instead.
     
  3. @mrCookieSlime If you were to add it to Command Override, how would the config be, and would the commands and permissions be the same?
     
  4. Offline

    mrCookieSlime

    @PhillyCheezsteak
    I don't know about how the syntax should look then yet.
    And I don't really understand what you mean by way of "commands and permissions being the same".
     
  5. @mrCookieSlime the syntax of the config is not important, but what I meant was if there will be a separate config for this add on, or will everything be in one config? Also for the permission, I mean what would you make the permission node to use the command?
     
  6. Offline

    mrCookieSlime

    @PhillyCheezsteak
    It's not going to be a seperate config and I won't add a permission, you can do it on your own. Check the CommandOverride BukkitDev Page, link is in my Signature.
     
  7. @mrCookieSlime Ah okay cool. You can do it if you want :)

    Thank you :) Yeah I researched a lot with your plugin and it's very customizable, which is great. Please post/reply when you finish it :)
     
    Last edited: Feb 21, 2015
  8. @mrCookieSlime Hey I was just wondering if you had any updates or progress with the plugin? There is no rush, I am just wondering.
     
  9. Offline

    mrCookieSlime

  10. Offline

    mrCookieSlime

    @PhillyCheezsteak
    Done. https://www.dropbox.com/s/82ai6ugt1wojh17/CommandOverride v1.4.0.jar?dl=0
    It requires the latest Version of CS-CoreLib to work though. (The one I uploaded 8 minutes ago *cough* *cough*)
    Link is also in my Signature.

    Example:

    /execute3outof8commands:
    - RANDOM 3 8
    - command:/say 1
    - command:/say 2
    - command:/say 3
    - command:/say 4
    - command:/say 5
    - command:/say 6
    - command:/say 7
    - command:/say 8

    This will choose 3 random script lines to be executed from the followed 8 lines. Any lines that exceed the specified limit of 8 will always get executed as they are outside of the RANDOM syntax.
     
  11. @mrCookieSlime Awesome thank you! Can you also please add support for the percentage chance? Kinda like this

    /execute3outof8commands:
    - RANDOM 3 8
    - command 10:/say 1
    - command 20:/say 2
    - command 30:/say 3
    - command 5:/say 4
    - command:5/say 5
    - command:10/say 6
    - command:18/say 7
    - command:2/say 8


    So next to "command" I put a number which is the percentage of that command being executed.
     
  12. Offline

    mrCookieSlime

    @PhillyCheezsteak
    Done. https://www.dropbox.com/s/sakd6856hp4if2z/CommandOverride v1.4.1.jar?dl=0

    /execute3outof8commands:
    - RANDOM 3 8
    - '[chance: 10]command:/say 1'
    - '[chance: 20]command:/say 2'
    - '[chance: 30]command:/say 3'
    - '[chance: 40]command:/say 4'
    - '[chance: 50]command:/say 5'
    - '[chance: 60]command:/say 6'
    - '[chance: 70]command:/say 7'
    - '[chance: 80]command:/say 8'

    Note that every single one must use the [chance: <chance>] syntax or not a single one, only applying that to some of them won't work. So either put it in front of every line which is affected by the RANDOM syntax or just leave it out completely.
     
  13. Offline

    mrCookieSlime

    @PhillyCheezsteak
    ... You obviously should put your command under "commands:" and not "arguments:".
    Kinda makes sense, doesn't it? :D
     
  14. Offline

    mrCookieSlime

    @PhillyCheezsteak
    What did you type in?
    What is the given output?

    Also your - - permission thing there, you can't have that. Use the permissions.yml file in your CommandOverride folder for that instead.
     
  15. @mrCookieSlime I fixed the permission here is my config
    http://pastebin.com/LdCkZMr9

    So I enter /spawntest1 which is the command I am trying to make, and here is the output I get in the chat
    [chance: 10]command:/say 1
    [chance: 20]command:/say 2
    [chance: 30]command:/say 3
    [chance: 40]command:/say 4
    [chance: 50]command:/say 5
    [chance: 60]command:/say 6
    [chance: 70]command:/say 7
    [chance: 80]command:/say 8


    the weird part is when I have a command block execute the command, it says the command does not exist
     
  16. Offline

    mrCookieSlime

    @PhillyCheezsteak
    CommandOverride does not (yet) work for anything besides Players.
    And it seems to me then that you are not using the latest Version.
    Try to update, link is still in my Signature.
     
  17. @mrCookieSlime Thank you very much it works now! When you have time, can you please add support for command blocks? There is no rush, but it would be very helpful :) Thank you again for the random command plugin
     
  18. Offline

    mrCookieSlime

Thread Status:
Not open for further replies.

Share This Page