What is wrong ? no error at build but no effect in game.
I want something like EventInterval = 21:00,22:00,1:00
private AZStartTask _task;
class AZStartTask implements Runnable
{
private long _startTime;
public AZStartTask(long startTime)
{
_startTime = startTime;
}
public void setStartTime(long startTime)
{
_startTime = startTime;
}
public void run()
{
startEvent();
}
}
public void scheduleEventStart()
{
try
{
Calendar currentTime = Calendar.getInstance();
Calendar nextStartTime = null;
Calendar testStartTime = null;
for (String timeOfDay : Config.EVENT_INTERVAL)
{
// Creating a Calendar object from the specified interval value
testStartTime = Calendar.getInstance();
testStartTime.setLenient(true);
String[] splitTimeOfDay = timeOfDay.split(":");
testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0]));
testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1]));
// If the date is in the past, make it the next day (Example: Checking for "1:00", when the time is 23:57.)
if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis())
{
testStartTime.add(Calendar.DAY_OF_MONTH, 1);
}
// Check for the test date to be the minimum (smallest in the specified list)
if (nextStartTime == null || testStartTime.getTimeInMillis() < nextStartTime.getTimeInMillis())
{
nextStartTime = testStartTime;
}
}
_task = new AZStartTask(nextStartTime.getTimeInMillis());
ThreadPoolManager.getInstance().executeTask(_task);
}
catch (Exception e)
{ }
}
Get the maximum opportunities, income, and profit with our verification.
We help you pass verification on the services and applications you need, opening access to full functionality and scaling.
Fast. Reliable. Secure.
Minimal risks — predictable results.
Bonus for new clients:
Pay for the first verification and get a 10% discount on the next one.
Learn more — Go to
Get the maximum opportunities, income, and profit with our verification.
We help you pass verification on the services and applications you need, opening access to full functionality and scaling.
Fast. Reliable. Secure.
Minimal risks — predictable results.
Bonus for new clients:
Pay for the first verification and get a 10% discount on the next one.
Learn more — Go to
Virtual numbers for full control and flexibility.
We offer long-term number rental (days, months) and one-time SMS receiving — all in one service.
Long-term rental is suitable for stable access to accounts, repeated verifications, and number retention.
One-time numbers are for quick registrations and single-use operations.
Reliable SMS delivery, predictable results, and convenience that even many large SMS services do not offer.
Go to the SMS service
Telegram gifts are once again showing growth.
This is associated with a possible pause in the gift release pipeline by Pavel Durov, as well as the approaching New Year, when demand traditionally increases.
Against this backdrop, Telegram Stars, the platform’s internal currency, are once again coming to the forefront. With their help, users send gifts, subscribe to Telegram Premium, and use paid features within the Telegram ecosystem.
Buy Telegram Stars with maximum benefit in our bot
Question
xAddytzu
What is wrong ? no error at build but no effect in game.
I want something like EventInterval = 21:00,22:00,1:00
private AZStartTask _task; class AZStartTask implements Runnable { private long _startTime; public AZStartTask(long startTime) { _startTime = startTime; } public void setStartTime(long startTime) { _startTime = startTime; } public void run() { startEvent(); } } public void scheduleEventStart() { try { Calendar currentTime = Calendar.getInstance(); Calendar nextStartTime = null; Calendar testStartTime = null; for (String timeOfDay : Config.EVENT_INTERVAL) { // Creating a Calendar object from the specified interval value testStartTime = Calendar.getInstance(); testStartTime.setLenient(true); String[] splitTimeOfDay = timeOfDay.split(":"); testStartTime.set(Calendar.HOUR_OF_DAY, Integer.parseInt(splitTimeOfDay[0])); testStartTime.set(Calendar.MINUTE, Integer.parseInt(splitTimeOfDay[1])); // If the date is in the past, make it the next day (Example: Checking for "1:00", when the time is 23:57.) if (testStartTime.getTimeInMillis() < currentTime.getTimeInMillis()) { testStartTime.add(Calendar.DAY_OF_MONTH, 1); } // Check for the test date to be the minimum (smallest in the specified list) if (nextStartTime == null || testStartTime.getTimeInMillis() < nextStartTime.getTimeInMillis()) { nextStartTime = testStartTime; } } _task = new AZStartTask(nextStartTime.getTimeInMillis()); ThreadPoolManager.getInstance().executeTask(_task); } catch (Exception e) { } }9 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now