Batch Commander (Infinite Batch Commands via Player or Console)

Discussion in 'Archived: Plugin Requests' started by Ajster1989, Aug 23, 2012.


Do you think that this would be a very productive plugin to use?

  1. I think that it would save hours of permissions programming

  2. I think that it would be great for allowing reward kit

    0 vote(s)
  3. I think that is would be great because I can get a lot of things done with just one command.

  4. I don't think that it will help me.

  1. Offline


    Plugin category: Tools

    Suggested name: batch comander

    What I want: I would like to see a batch commands plugin that I could upload a text file to my server, and have a simple command to run it.

    File Layout:

    /plugins/batchcommander/batch.txt <---- this text file can be named anything, and specified in the run command.

    I don't think that a config file is necessary because you can include everything in the batch files as needed.

    What a batch file should look like:
    Batch Name = My batch Command
    Delete = Yes/No <------ can be great if programming permissions and want it to be deleted after it's run, to save space too.
    Announce Lag = Yes/No <-------- sometimes it's just nice to let players know that your running a hefty command. This would announce to the whole server instead of just the player that the batch is being run, and who ran it.
    Run As = Console/Player <--------- If console it set, runs command as console, if player is set the runs as the player running batch command, or looks for player variable in command.
    Command = 'command 2'
    Command = 'command 3'
    Command = 'command 4'
    Command = 'command 5

    The idea would be that you would be able to have an infinite number of commands, and batch commander would just run all commands till the end of the file is reached.

    This would make MySQL Permissions Programming require alot less hours (My Server has over 600 lines of commands required to build our permissions system alone.

    Code: <-------- allowed to run a batch commander command

    /batchcommander batch.txt <---- this would be relitive to the name of the batch file that was uploaded to the server.
    /batchcommander player billybob batch.txt <---- if run as is set to player then it would change the player running the command to the variable. however if run as is set to console this is ignored. (good for giving a kit or items to a certain player.
    When I'd like it by:
    Yesterday. (default answer from forum template, but yes)

    I think I was pretty descriptive... can someone make this, or can this not be done?
    Send like it would be a simple plugin...

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


    Well, it can be accomplished with CommandHelper macros, to an extent. I don't know how to run a command from the console, but I'm sure it exists.
  3. Offline


    have a for loop that iterates over a string list in the config:

    for(String command:getConfig.getStringList("commands"){
    getServer().dispatchCommand(getServer().getConsoleSender(), command)
    thats the bulk of the code

    i'm a little busy to do this right now, so if anyone wants to take it feel free. If this isnt done by tomorrow bump it and I'll make the rest
  4. Offline


  5. Offline


    This would be much easier done in a YAML config.
    Here's an example of how I'd set it up:

      delete: true/false
      announce-lag: true/false
      run-as-console: true/false
        - /command 1
        - /command 2
        - /command 3
  6. Offline


    I guess this would be ok actually, but add a command name field so it's not just command 1
    name: [name]
    run-as-console: [true/false]
    - /command 1
    - /command 2
    - /command 3
    - /command 4
    - /....
    I not really picky, but this file could get really long, so which ever is easier to program...

Share This Page