Schedule indefinite repeating task

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

Thread Status:
Not open for further replies.
  1. Offline

    JazzaG

    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. Offline

    macguy8

    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. it's better to go another way about it. What is it that you want to accomplish by this?
     
  4. Offline

    JazzaG

    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.
     
Thread Status:
Not open for further replies.

Share This Page