Self Canceling Delayed Task Help

Discussion in 'Plugin Development' started by AXCoding, Jul 24, 2014.

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

    AXCoding

    Hi guys, I'm making a plugin that needs to read the config.. Get a message, then wait lets say 3 seconds before sending the next message in the config. Example
    Code:
    FactionTutorial:
        1:
          text: To join a faction do /f join FactionName
          #Delay in seconds
          delay: 3
        2:
          text: Do /f create to create a faction!
          #Delay in seconds
          delay: 3
    
    I need to iterate through it to get FactionTutorial.1.text then wait 3 seconds then get FactionTutorial.2.text.. and so on.
    I've read http://wiki.bukkit.org/Scheduler_Programming , I just can't understand what they are doing.
    Any help would be greatly appreciated .
     
  2. Offline

    EcMiner

    You need to schedule a repeating task which increments an integer till it doesn't exist in the config anymore, once it doesn't exist in the config you can cancel the task or you could first load all messages in the config and save them in a list and then have an integer increment every 3 seconds till it its the same as the size of the kist and then cancel the task
     
  3. Offline

    AXCoding

    EcMiner How would I go about doing it.. Sorry If I sound really stupid but I learn by example :)

    Anyone Please Help :(

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016
Thread Status:
Not open for further replies.

Share This Page