Schedule indefinite repeating task

Discussion in 'Plugin Development' started by JazzaG, Sep 20, 2012.

  1. Offline

    JazzaG

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    How would one schedule a task to repeat indefinitely?

    Code:
    this.getServer().getScheduler().scheduleSyncRepeatingTask(this, new Runnable() {
    public void run() {
     
    }
    }, delay, indefinite_timer); // ?
    
    Thank you
  2. Online

    macguy8

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    I don't entirely get your question, but my best answer would be to schedule an infinte repeating task, and an one time task. When the one time task is reached, use this.getServer().getScheduler().unregisterAllTasks(); I think the unregister part is correct, but I don't know for sure if it's the right code
  3. Offline

    mollekake

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    it's better to go another way about it. What is it that you want to accomplish by this?
  4. Offline

    JazzaG

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Thanks for replies guys.

    I wanted to achieve something like one of those broadcasters, and so I learned how to do it by decompiling them :D. From what I learned, my delay variable should go where "indefinite_timer" should be. I misread the wiki page on this.

    Thanks, however.

Share This Page