auto commands plz help

Discussion in 'Plugin Development' started by Crowdy199(9), May 22, 2012.

  1. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    guys i really don t get it i tryied everything i don t no what code to use to automaticly send commands to run.bat i was trying to do System.out.print("Save-all") and define the program as run.bat but somewone told me i was doing it wrong plz help me learn the code to autp sned commands to run.bat Thanks -Crowdy199(9)
  2. Offline

    WaffleOnABike

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I am so confused...
    ZachBora likes this.
  3. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    i want to no how to auto send commands to run.bat (launcher) every 4 mins what code do i use
  4. Online

    tyzoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Are you writing a bukkit plugin?
  5. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    yes making a plugin
  6. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    yah i am making a plugin
  7. Online

    tyzoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:java
    1. getServer().dispatchCommand(getServer().getConsoleSender(), "save-all");
  8. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  9. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    ok thanks alot man (oh and i ahve colors on my bukkit server)
  10. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    1 more question how do i make it save every 4 mins
  11. Online

    tyzoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:java
    1. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
    2. public void run() {
    3. Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "save-all");
    4. }
    5. }, 4800L);


    Where plugin is your reference to your plugin's main class.

    This post has been edited 2 times. It was last edited by tyzoid May 23, 2012.
  12. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
  13. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    so this is my plugin is this right ??

    package me.Crowdy199.AutoSave;

    import org.bukkit.Bukkit;
    import org.bukkit.plugin.java.JavaPlugin;

    public class AutoSave extends JavaPlugin {

    Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(plugin, new Runnable() {
    public void run() {
    Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "Save-All");
    }
    }, 4800L);

    }
  14. Online

    tyzoid

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Code:java
    1. public class AutoSave extends JavaPlugin {
    2. public void onEnable(){
    3. Bukkit.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    4. public void run() {
    5. Bukkit.getServer().dispatchCommand(getServer().getConsoleSender(), "Save-All");
    6. }
    7. }, 4800L);
    8. }
    9. public void onDisable(){
    10. }
    11. }

    This post has been edited 2 times. It was last edited by tyzoid May 23, 2012.
  15. Offline

    Crowdy199(9)

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    is this rite for plugin.yml



    name: AutoSave
    main: me.Crowdy199.AutoSave.AutoSave
    version: 1.0
    author: Crowdy199
    description: Provides automatic world saves at defined

    commands:
    autosave:
    description: Saves the world.
    aliases: save

Share This Page