Schedule a repeating task Bungeecord.

Discussion in 'BungeeCord Plugin Development' started by dandwhit, May 4, 2015.

Thread Status:
Not open for further replies.
  1. Hello.
    I'm wondering how I can schedule a repeating task with the scheduler feature. I know how to do this in the Bukkit API but I couldn't figure out how in BungeeCord.
    Basically I just want something to repeat every 24 hours.
    Thanks for any help,
    Dan
     
    • Friendly Friendly x 2
  2. getScheduler().schedule( Plugin, Runnable, long, long, TimeUnit ).

    The longs will be in whatever TimeUnit you specify, the first is delay, the second is how often to repeat.
     
    • Useful Useful x 4
    • Agree Agree x 1
  3. Thanks. I figured out how to do it now anyway :p
     
  4. You should leave the title so others can find it.. Also if you'd like it locked report it.
     
    • Agree Agree x 2
  5. Code (Text):
        public void clearLists() {
            getProxy().getScheduler().schedule(this, new Runnable() {
                @Override
                public void run() {
                    Donate.clearDonateList();
                    Donate.clearOtherList();
                }
            }, 1, 1440, TimeUnit.MINUTES);
        }
    Working code.
     
    • Like Like x 8
    • Agree Agree x 3
    • Informative Informative x 1
  6. jflory7

    jflory7 Retired Moderator
    Retired Benefactor

    Thread locked per request
     
    • Winner Winner x 2
    • Agree Agree x 1
Thread Status:
Not open for further replies.