This is what I use:
Code:
package com.falador.world.content;
import com.falador.util.Misc;
import com.falador.util.Stopwatch;
import com.falador.world.World;
/*
* @author FaladorPS
* www.FaladorPS.com
*/
public class Reminders {
private static final int TIME = 600000; //10 minutes
private static Stopwatch timer = new Stopwatch().reset();
public static String currentMessage;
/*
* Random Message Data
*/
private static final String[][] MESSAGE_DATA = {
{"@blu@[SERVER]@bla@ Remember to ::vote for rewards every 12 hours!"},
{"@blu@[SERVER]@bla@ Use the command :;drop (npcname) for drop tables"},
{"@blu@[SERVER]@bla@ Use the ::help command to ask staff for help"},
{"@blu@[SERVER]@bla@ Make sure to read the forums for information www.FaladorPS.com"},
{"@blu@[SERVER]@bla@ Remember to spread the word and invite your friends to play!"},
{"@blu@[SERVER]@bla@ Use ::commands to find a list of commands"},
{"@blu@[SERVER]@bla@ Donate to help the server grow! :;donate"},
{"@blu@[SERVER]@bla@ Toggle your client settings to your preference in the wrench tab!"},
{"@blu@[SERVER]@bla@ Register and post on the forums to keep them active! ::Forum"},
};
/*
* Sequence called in world.java
* Handles the main method
* Grabs random message and announces it
*/
public static void sequence() {
if(timer.elapsed(TIME)) {
timer.reset();
{
currentMessage = MESSAGE_DATA[Misc.getRandom(MESSAGE_DATA.length - 1)][0];
World.sendMessage(currentMessage);
}
}
}
}