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: Code: /plugins/batchcommander.jar /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: Code: 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 ect... 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. Permissions: Code: batchcommander.run <-------- allowed to run a batch commander command Commands: Code: /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.
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.
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
This would be much easier done in a YAML config. Here's an example of how I'd set it up: Code: command1: delete: true/false announce-lag: true/false run-as-console: true/false commands: - /command 1 - /command 2 - /command 3 command2: etc...
I guess this would be ok actually, but add a command name field so it's not just command 1 Code: command: name: [name] delete:[true/false] run-as-console: [true/false] commands: - /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... Thanks!