Commander

Programming
Dragonphase - designed for mau5ville.com
Additional Credit
If you have experience with Java and creating Bukkit plugins, I will greatly appreciate the help and am interested with working with developers; I will be rewriting Commander to make it easier to use and more efficient to produce code for.
I am currently looking for someone to help me produce a video demonstration of Commander, demonstrating basic and advanced features. Please message me on bukkit if you are interested - a high standard of demonstrative and/or reviewer abilities is preferred. The reason for this is that most people miss the advanced features or don't understand how to use them.
Overview
Commander is a powerful device interface tool used to assign commands, messages and statements to buttons, levers and pressure plates.
| Features |
|---|
| Add and remove multiple commands to buttons, levers and pressure plates |
| Manually add and edit existing device data in the devices.yml file |
| Check player permissions, items and groups using if-else statements |
| Perform commands as player, op or console |
| Multi-Perms support - Vault required! |
| Add commands to regions - WorldGuard and WorldEdit required! |
How to use
Firstly, make sure you have VAULT installed, as well as any of the permissions plugins it can handle (such as PermissionsEx or bPermissions). This allows permissions detection for all permissions-based systems specified on the Vault page.
Supported Devices
As of right now, only four devices are supported and listed below. Wooden Button will be easy to implement when 1.4 is released. I am currently in progress of developing a tripwire interface system for Commander:
Wooden Pressure Plate, Stone Pressure Plate, Stone Button, Wooden Button, Lever
Command Types
Command Types specify how the command will be run:
Player, Op, Console
You may also use p, o or c Note: it is impossible for non-ops to op themselves using the op command type, as after all commands have been initiated, it de-ops the player. It is possible on a console command type however.
Commands
An explanation of how these commands work is shown when you type the command in-game:
| Command | Description |
|---|---|
| /commander | Display the commander help. You can also use /com |
| /commander add | Add commands to the device you are looking at. See Supported Devices |
| /commander rem[ove] | Remove commands from the device you are looking at |
| /commander clear | Clear the interface of the device you are looking at |
| /commander check | Check all associated commands of the device you are looking at |
| /commander list | Show a list of all devices in all worlds |
| /commander add-entry | Add commands to the region you are standing in |
| /commander add-entry(regionName) | Add commands to the region named regionName |
| /commander rem-entry | Remove commands from the region you are standing in |
| /commander rem-entry(regionName) | Remove commands from the region named regionName |
References
References add a very powerful aspect to the uses of commander. References allow you to display specific traits of the player or the server to the player. References can also be used in messages and statements:
| Reference | Description |
|---|---|
| @player OR @name | Player name |
| @group | Player group name |
| @world | Player world name |
| @time | Player world time |
| @level | Player level |
| @exp OR @xp | Player experience |
| @health | Player health level |
| @food | Player food level |
| @mode OR @gm | Player game mode |
| @server | Server IP |
| @region | Name of the region you are standing in |
Conditional references
With commander, you can force the command to continue on to the next command or stop running any further commands. This is useful when adding conditional statements on devices:
| Reference | Description |
|---|---|
| @continue | Continue to the next command |
| @return | Do not run further commands |
An useful example of this is:
@in admin>@@You are an admin>@return /give @player 57 1
This will check if the player is an admin - if they are in the admin group, it sends a message to them saying "You are an admin" and then gives them one diamond block. if they are not in the admin group, @return sop any other commands from running.
A little note about conditional references
Commands in conditional references are run the same as any other commands - if you specify it to be run as the player, op or console, it will run them as the player, op or console.
Messaging
This plugin would be pretty useless if it didn't have a method to send custom messages to a player's chat screen. All color code formats are supported:
| Reference | Description | Example |
|---|---|---|
| @@Message | Send "Message" to the player who initiates the device | @@Hello @player! |
Statements
Statements allow you to run a command if a condition has been met, else optionally run an alternate command. This is useful if you want players with a specific permissions node, group or item to run a command:
| Statement | Description | Example |
|---|---|---|
| @check | Check if the player has a specific permission node | @check foo.bar>@@Yes>@@No |
| @has | Check if the player has a specific item | @has 35>@@You have wool>@@You do not have wool |
| @in | Check if the player is in a specific group | @in moderators>@@You are a moderator>@@You are a @group |
Manually editing devices
Device data is saved to Commander/devices.yml by default. if you are using an earlier version of Commander, simply rename "commands.yml" to "devices.yml":
Editing devices manually is useful when you have created an empty interface and wish to manually add your own commands to the device. This is also useful when you wish to add commands that cannot be entered into minecraft by default, such as long WorldEdit generation commands.
By defaults, commands in the devices.yml file do not contain a forward slash (/). If you want to add a command, simply write it out without the forward slash. With WorldEdit commands, you need to add one forward slash (instead of two):
| say hello | Normal /say command |
| /wand | WorldEdit wand |
Permissions
| Permission Node | Description |
|---|---|
| commander.device.use.player | Allow players to use player commands on devices (enabled by default) |
| commander.device.use.op | Allow players to use op commands on devices |
| commander.device.use.console | Allow players to use console commands on devices |
| commander.device.break | Allow players to break a device |
| commander.admin.add | Add a command to a device |
| commander.admin.remove | Remove a command from a device |
| commander.admin.clear | Clear a device's interface |
| commander.admin.check | Check a device's associated commands |
| commander.admin.list | List all devices in all worlds |
| commander.admin.reload | Reload commander |
Further Ideas
- I plan to convert all references into statements:
@player Bob>@@You are bob!>@@You are not bob!
@health 20>/give @player 57 1>@@You are not at full health
- Tripwire support
- I have LOOKED INTO adding commands to any block.
Homepage: dragonphase.com
ba55ment: ba55ment.org
-
View User Profile
-
Send Message
Posted Sep 10, 2012@rmkilc
Confused as to the problem. could you specify in more detail what it is doing?
-
View User Profile
-
Send Message
Posted Sep 10, 2012Right now when commander replaces a word, it outputs this to console:
2012-09-06 13:52:27 [INFO] [PLAYERCHAT] akulakan: MOFO==> **
I would love a permission node to give to moderators that would output that same line to them in-game!
-
View User Profile
-
Send Message
Posted Sep 10, 2012Could you add a @Delay to the device, to prevent spamming?
-
View User Profile
-
Send Message
Posted Sep 10, 2012okay i found out what was going wrong i was downloading it to the wrong folder :P and it works
-
View User Profile
-
Send Message
Posted Sep 10, 2012@bryn1990
Click here to download the latest version of Commander!
Restart your server (recommended) or reload it.
-
View User Profile
-
Send Message
Posted Sep 10, 2012@Ojomrog
It will still work with WorldGuard installed, but in regions WITHOUT flag "Use: allow" on, it will cause commands to be continuously run. I am working on a work-around with WorldGuard but have had not much luck as of late. I have just started Uni but will still attempt to fix this as much as I can.
-
View User Profile
-
Send Message
Posted Sep 10, 2012Does this require world guard or whatever to run? Its not mentioned anywhere here that i can see but it seems to throw an error that sounds like it wouldn't work without it... Initial test to see if it wouldn't matter ended with nothing happening.
-
View User Profile
-
Send Message
Posted Sep 10, 2012@Dragonphase
i tryed @player it still did not work
-
View User Profile
-
Send Message
Posted Sep 10, 2012@bryn1990
Download the latest version and use @player instead of @dn
@dn is the NOT the exact player name, it is the player name with all of your chat prefixes, as it appears on the screen!
-
View User Profile
-
Send Message
Posted Sep 9, 2012i tryed to do the /commander add c deop @dn and i get "console: deep @dn" am i doing anything wrong?
-
View User Profile
-
Send Message
Posted Sep 9, 2012Tried your update. Works perfectly fine. So many possibilites! Thank you! :)
-
View User Profile
-
Send Message
Posted Sep 9, 2012Okay, I am writing from my phone right now. I'll try this when I get Home. Is that long number under your phone which Starts with bfak a Downloadlink?
-
View User Profile
-
Send Message
Posted Sep 9, 2012@NyanCraftDe
I know, the latest version hasn't been verified by bukkit yet. You can check the post for the latest one though, I added a direct download.
-
View User Profile
-
Send Message
Posted Sep 9, 2012I downloaded your plugin like 5 hours ago, so yes, Im using the newest version. I am using colors and prefixes for names, so I used @player. It still doesnt work. /commander add c ban @player just tells me, that there is no player online, who is called "@Player". It doesnt convert the references to names. It just uses the actual input "@player". I am online now. So, if you have got time, just join 78.143.4.249:25565.
-
View User Profile
-
Send Message
Posted Sep 9, 2012@NyanCraftDe
Edit: Please download the latest version. this will fix some variable issues.
Also, you must use @player as this refers to the exact player name. The display name (@dn) is the name of the player as it appears on the screen; so if your players have a color in their name, it won't work.
-
View User Profile
-
Send Message
Posted Sep 9, 2012Yes, Dragon, thank you, but i dont have time right now. Lets do this tomorrow.
Btw /kick @dn doesnt work and /give @dn 35 10 doesnt work too. All the References wont work for me.
-
View User Profile
-
Send Message
Posted Sep 9, 2012@NyanCraftDe
For the kick part, i'll have to take a look myself since i've never had that problem with it before. Do I have permission to take a look on your server?
For the playername part, you're doing it wrong. it's @dn, not @playername. The reason for this is to keep it short to allow for more room for command arguments.
-
View User Profile
-
Send Message
Posted Sep 9, 2012Does not really work for me. I tried to use a wooden pressure plate and then: /commander add c kick @player
It just says "No Players matched query".
I want the person who steps on the plate get kicked.
Am I doing something wrong?
I tried this too: /commander add c say @playername The console just said: <Console*> @playername. Shouldnt it be <Console*> Subrosa20 ?
-
View User Profile
-
Send Message
Posted Sep 8, 2012This looks freaking awesome! I'll get it tommarrow when I'm on my computer