Autorun Commands
Want to execute a command which displays stats just by right clicking the desired player? Or how about giving them a rose or 64 many, many times with ease? Or even make a command run which kicks players if they walk over a certain block? You can do that and more with this mod!
Features:
- Allows the execution of a command simply by right clicking on a player.
- Allows the execution of a command simply by walking over a block.
- Allows the execution of a command simply by pressing a stone button.
- Allows the execution of a command simply by dying
- Allows the execution of a command simply by respawning
- Allows the execution of a command at server start up
- Allows the execution of a command on a regular interval
- Allows the execution of a command when a player join
How to use:
Step 1:
- Assign a command to an identifier.
- For this example, we want to say 'Hello <playername>!' and we will assign it the identifier "wassup"
- type: /addacommand wassup say Hello potato!
- Adding the word 'potato' will substitute the name of the player who is the target of the event
OR
- Assign an OP command to an identifier.
- For this example, we want to give me 64 TNT blocks and assign it the identifier "TNT_spam"
- type: /addopcommand TNT_spam give LittleGruz 46 64
Step 2:
- Assign the identifier to an appropriate event.
- For this example we will assign "TNT_spam" to occur every 10 minutes (600 seconds) and to assign "wassup" to be run when a player right clicks another player
- type: /setclickcommand wassup GLOBAL
- NOTE: The use of the word GLOBAL (all caps) means that when anyone right clicks someone, "wassup" will be run instead of just me running it
- type: /addrepeatcommand TNT_spam 600
Step 3:
- Watch them trigger!
- Now if I right click someone called "Bruce". I will execute the command '/say Hello Bruce!'
- And every 10 minutes I will get a full stack of TNT
Future plans:
- Sleep
If you have any comments or questions, please head on over to the forums.
View the source here. Check out the main website here.
Apparently, the lovely Socram8888 has fixed an error in my code that produces ConcurrentModificationExceptions. Get it from Github here.
@littlegruz
Thank's so much! That delay command was extremely helpful for me! Just wanted to praise you and give you kudos xD
@Baglex
Just so you know, I have actually read your comment and will soon try to reproduce the error.
Im trying to make it so players are granted a rank when they log in.
I did /addopcommand addguest pex user potato group add Guest Then /addjoincommand addguest
When a player joins, the console says they tried to execute the command but did not have permission.
Im also getting an error in my console over and over. Its spamming.
2012-07-22 06:24:51 [WARNING] Task of 'AutorunCommands' generated an exception java.lang.NullPointerException at littlegruz.autoruncommands.listeners.CommandPlayerListener$1.run(CommandPlayerListener.java:137)
What im trying to do is get people added to the default group in pex along with a secondary group when they join the server. I also added whenever they join so everyone who was already part of the server and did not have the rank will be added to it.
Any help would be great, also maybe some documentation on how to use your configs?
Thanks.
@harryjamesuk
I remember now. Thanks for the reminder :)
I suppose that is the danger of not congregating the ideas that need to be done, thinking "nah, I will come back here and find that message"...and then completely missing it.
@littlegruz
Yes, further back I said that I was having problems with the player join commands because they run before the plugin gets a chance to load for the player. What I mean is when you join it would delay the command by lets say, 3 seconds.
-------This is what I said before:
Would it be possible to "delay" commands. E.G: The command /dynmap show would be delayed for 10 seconds before it would activate.
-------@littlegruz:
Well, the reason I'd like it is because I wanted to use "/dynmap show" when a user joins but autorun commands seems to run the command before the plugin has time to activate for the user so it's not really having a use at the moment (I know, this is hard to explain so you'll probably not understand me)
It would also come in handy for things like "In 10 seconds, you'll receive 5 tnt" or something. Or even when you die it would freeze you for 10 seconds then let you carry on.
Possibilities are almost endless :P
-------And you replied:
@harryjamesuk:
I see now. Basically I would just need to re-implement code I made to stop the respawn commands executing too early. So what you have suggested is possible. It will be added in the next version but not with a configurable time; I will instead give it a similar delay to the respawn commands.
Hey, love the plugin! :D
Just thought of a cool set of features:
Overall, great work :)
@harryjamesuk
Player join commands have already been added. Have a look at "player join commands" in the command summary page.
@kuyakolin
Thanks for the kind words :)
@denoflions
My question is why does everyone on your server get OP?
This is a Great Plugin, I use it to make life easier for staff and players alike, We make players just walk through a doorway, to activate a command like pvp on/off. It works great,
Thanks for your Plugin.
Is there any update on the delay for running a command on player join? Just wondering ;)
@littlegruz
Well I just installed the new release and the problem is fixed for me so his problem must be with another conflicting plugin maybe? Thanks for fixing this it makes life so much easier :)
@denoflions
Bugger, I thought I fixed that in v3.1.2. That is getting real troublesome.
@littlegruz
I'm also having an issue where command blocks aren't saving after a restart like @IsThisNameCoolEnoughForYou.
I'm using MultiVerse as my multiworld plugin.
@greaperc4
Use either '/addacommand' or '/addopcommand' first.
The command summary page will help with the commands' syntax.
@littlegruz
when i do /addjoincommand manload manload it says: Wrong number of arguments can u help me?
@denoflions
You have definitely set it up correctly. I will try to look into the reason behind that.
I seem to be confused on how you use this.
I'm trying to set it up so that all users are given OP upon respawning. I have certain challenge areas that remove OP when you teleport into them, and I'd like the server to auto-reapply OP when they respawn.
So I ran commands like so:
/addopcommand makeop op potato
/setrespawncommand makeop
When I then kill myself via lava and respawn it says I don't have permission to access that command. I thought addopcommand ran from the console?
Edit: I used the same makeop and bound it to walking on a block, and that works as intended. I guess for now I'll bind the block you spawn on as a command block.
@IsThisNameCoolEnoughForYou
What multi world plugin are you using?
help! When I Shut down my server or reload, when I go back on, it doesn't save! This is so annoying to say I'm making an Ownertools Building.
@greaperc4
It seems you mis-understand what this plugin does.
This plugin gives you the tools to run commands automatically on certain events. As it happens, the two events you mentioned are supported.