[MECH] Autorun Commands v3.2.4 - Set custom commands to run automatically [1.5.2-R1.0]

Discussion in 'Archived: Plugin Releases' started by LittleGruz, Oct 24, 2011.

  1. Offline

    LittleGruz

    Autorun Commands - Set custom commands to run automatically
    Version: 3.2.4

    Made in response to this thread.

    Visit the BukkitDev page for more details and downloads.

    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 plugin!

    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 joins
    • Allows the execution of a command when a player first joins
    View the source here.

    Check out my sweet site here.

    Enjoy my mods? Donate here! Dislike my mods? Donate here (and give feedback)! Powers of two are cool (e.g. $1.28, $2.56, etc.).

    Changelog:
    Past versions (open)
    Version 3.2.2:
    • Allow death commands to be set with GLOBAL.
    • Fixed problem of not being able to set OP commands for auto death commands.
    Version 3.2.1:
    • Replaced depreciated code.
    • Fixed some player messages.
    Version 3.2:
    • Option to have a delay for join commands added.
    • Bug fix for OP startup commands.
    Version 3.1.2:
    • Fix for when Multiverse would not load before AutorunCommands.
    Version 3.1.1:
    • Support for the plugin MultiWorld.
    Version 3.1:
    • First join commands.
    • Toggle for first join commands.
    • Multiple join commands executed.
    Version 3.0.3:
    • Fixed bug where respawn commands are executed when player was loading.
    Version 3.0.2:
    • Fixed bug which caused multiple instances of repeat commands to run.
    Version 3.0.1:
    • Fixed bug which occurred if there was no join command.
    Version 3.0:
    • Finally fixed multiworld bug.
    • Added display commands for blocks.
    • Added display commands for repeating tasks.
    • Added display commands for commands.
    • Command blocks can only be destroyed by an OP player.
    • Remembers the time remaining for a repeating task when the server is shutdown.
    • Allows commands to be executed when a player joins.
    Version 2.7.2:
    • Remove repeat command bug fix.
    Version 2.7.1:
    • Bug fix which caused the repeat commands to be saved and read incorrectly.
    Version 2.7:
    • Allows commands to be executed at a set frequency.
    Version 2.6:
    • Allows commands to be executed upon a player's death.
    • A myriad of bug fixes
    Version 2.5:
    • Allows buttons to cause a command to execute.
    • Fixed op command removal.
    Version 2.4.1:
    • Changed event listeners to support the new Bukkit event system.
    Version 2.4:
    • Added op support for command blocks.
    • Added a remove command command.
    Version 2.3:
    • Added ability to set commands to run at server start up.
    Version 2.2:
    • Added the ability to assign commands which are run by an op (console).
    • Allow commands to be executed upon player execution.
    Version 2.1:
    • Made command blocks more responsive.
    Version 2.0:
    • Gave blocks to ability to initiate the execution of a command.
    Version 1.0:
    • Added the ability to have a global command.
    Version 0.1:
    • Release.
     
    sk8r776 and Lextao like this.
  2. Offline

    Adrenaline

    Waiting for update to 1.2.3
    StartUp commands cause this:
    PHP:
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    2012-03-04 09:16:34 [WARNINGTask of 'AutorunCommands' generated an exception
    java
    .lang.NullPointerException
        at org
    .bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
        
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:461)
        
    at littlegruz.autoruncommands.listeners.CommandServerListener$1.run(CommandServerListener.java:26)
        
    at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:126)
        
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:520)
        
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
     
  3. Offline

    LittleGruz

    That only happens when you have commands in your startupCommands.txt file, that do not exists in the commands.txt file.

    EDIT: Oh. And...*updated*
     
  4. Offline

    Adrenaline

    :O ok
     
  5. Offline

    LittleGruz

    New version! You can now set a command to trigger when a stone button is pressed!
    As for adding the respawn trigger, that will be done in a jiffy.

    Woah (open)

    [​IMG]

    Another update! Version 2.6 allows you to set commands to run when a player respawns. There are also a few bug fixes which I feel a bit silly having in my code for such time.

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

    lenis0012

    do so if you join a region it wil auto run commands! i need that alot
     
  7. Offline

    LittleGruz

    What do you mean by "join a region"? Do you mean when someone enters a particular chunk or if they enter a certain world? Or am I completely off?
     
  8. Offline

    lenis0012

    like a worldguard region something like that
    (i need a plugin witch enable a potion effect when you enter a region)
    i have a plugin for the command but it needs to autorun if you enter like a worldguard region (or just define with wood sword) something like that
    can you do that?
    thanks for reading
    ~lenis0012
     
  9. Offline

    LittleGruz

    Hmm...the worldguard region you refer to seems to be from another mod. I would rather not have this mod reliant on another mod. Without that mod, I reckon it is possible for me to set an Autorun listener for when a player changes worlds or enters a new chunk.
    Another solution is that you can prevent people entering the new worldguard region, except at a small entrance-way. At the entrance you could set the blocks on the ground to run the command you desire.
     
  10. Offline

    TheJJ103

    wait wait wait, does that mean i can make it do "/weather sun 10000" every so many minutes ??
     
  11. Offline

    LittleGruz

    Sorry to be a downer, but no...not yet.
     
  12. Offline

    Pandaraze

    Is it possible to make it so a player can execute a command only once? For example, pressing a button gives a diamond, but only once.
     
  13. Offline

    LittleGruz

    Yes, I reckon it is. It would probably be implemented with the /setcommandblock with a special flag somewhere telling it to remember the player's name.
     
    Pandaraze likes this.
  14. Offline

    Pandaraze

    That would really be great as a quest reward system.
     
  15. Offline

    LittleGruz

    Ooh, yeah. Good point.
    Reward (open)

    omg-it-spins.jpg
     
  16. Offline

    Pandaraze

    Imagine a Indiana Jones type of cave that you have to fight your way through, and at the end there's a reward for your hard work that hasn't been stolen by the first one there.
     
  17. Offline

    LittleGruz

    And then after you shimmy out of the cave, someone takes your reward! :D
     
  18. Offline

    LittleGruz

    With version 2.7, you can now set a command to repeat.

    e.g.
    To get your /weather sun 10000 command to run every 8 minutes type:
    /addacommand sunshine weather sun 10000
    /addrepeatcommand sunshine 480

    Technically this was released about 12 hours ago, but the Bukkit web server seemed to be having some problems and would not allow me to post or change posts. But the download link pointed to the most recent version, so if you have downloaded it with the link within that time period, you already have version 2.7.
     
  19. Offline

    LittleGruz

    Version 2.7.1: Bug fix De-borkification. Woooo.
    Just fixed the repeat commands reading and saving the identifiers wrong.
     
  20. Hey looks like a nice plugin, but i dont understand how to use it. please could you make a video and tell me how to make a button that when i press it it changes the time to night
     
  21. Offline

    CheesyWalnut

    what does /addopcommand do?
     
  22. Offline

    LittleGruz

    It is similar to /addacommand which adds a command into the list of commands you use to run in a certain scenario (e.g. upon death, on a regular interval, on a player's right click etc.). The only difference which /addopcommand provides is that it adds a command that will be run by the console (op) instead of the user.

    I suppose I video would be a good idea. But in the mean-time. To make a stone button trigger a command to run you do these 3 simple steps (for this example, the command '/time add 12000' will be used to make it night):

    1. /addopcommand timeSwitch time add 12000
    2. /setcommandblock timeSwitch
    3. Right click the stone button you want to trigger the event
     
  23. Offline

    grant1222

    I'm having trouble with the repeat command. This is how I'm typing it:

    /addrepeatcommand stop 1m_1

    I have no idea how to set up a time and an interval. Can you give me an example? That would help the most.
     
  24. Offline

    LittleGruz

    This is an example given just a few posts above
    You have to give the time in seconds (8 minutes = 480 seconds)
    If you want to run a command that needs to be executed by an op user, substitute '/addacommand' with '/addopcommand'
     
  25. Offline

    Pandaraze

    How can I make it so when you step on a block it prints a message to the player? Like the
    \message command in commandsigns
     
  26. Offline

    LittleGruz

    Pandaraze
     
  27. Offline

    luckyboy67

    How the hell do you set up the interval command
     
  28. Offline

    LittleGruz

     
  29. Offline

    luckyboy67

    thank you
     
  30. Thanks, worked :D
     
  31. Offline

    minerscentral

    I would make it so on a timed interval it will warp all my users to the warp name of cow for example /warp cow for everyone every 1000 secs how can i do this?
     

Share This Page