Jump to content
  • 0

Question

Posted

I'm trying to make an event to be scheduled using a configuration. Example the Configuration looks like this:

ScheduleConfiguration = 1,10:30 ; 3,15:30 ;

basically 1 means the 1st day of week (monday) and it will start at 10:30. The next event will start in 3rd day of week at 15:30. I did split the String but i stuck on how to schedule the event to happen every X days. Any help? Thank you

7 answers to this question

Recommended Posts

  • 0
Posted (edited)

If you use aCis, you got ScheduledQuest which does exactly what you need.

 

If you don't use aCis, you have to code it yourself (using Calendar or the "new" Java8 API Time), either fully or using Quartz Scheduler for example.

Edited by Tryskell
  • 0
Posted

If you use aCis, you got ScheduledQuest which does exactly what you need.

 

If you don't use aCis, you have to code it yourself (using Calendar or the "new" Java8 API Time), either fully or using Quartz Scheduler for example.

This is my code: 

for (final String timeOfDay : Config.RESTART_INTERVAL_BY_TIME_OF_DAY)
			{
				testStartTime = Calendar.getInstance();
				testStartTime.setLenient(true);
				
				String[] parts = timeOfDay.split(",");
				
				final int day = Integer.parseInt(parts[0]);
				final int hour = Integer.parseInt(parts[1].split(":")[0]);
				final int minute = Integer.parseInt(parts[1].split(":")[1]);
				
				testStartTime.set(Calendar.DAY_OF_WEEK, day);
				testStartTime.set(Calendar.HOUR_OF_DAY, hour);
				testStartTime.set(Calendar.MINUTE, minute);
				testStartTime.set(Calendar.SECOND, 00);

				timeUntilRestart = testStartTime.getTimeInMillis() - currentTime.getTimeInMillis();

i added as test  7,20:40  so this mean the next event must be on Sunday 20:40 but it schedule it for 18/6/2017  this is 2 days ago.. 

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 account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • This is L2Etina’s first opening under our new team, and it’s off to a great start! We’re thrilled with the strong player turnout, the warm feedback, and your response to the major updates. We’re continuing to improve the server and would love to see you in game! ⚔️
    • I dont sell anything and i got scammed kiddo, if you noticed rookie just scammed me and blocked me. so asking this make you immature.
    • @Maxtor @Dragic @Celestine Why you unban this rat, it's will give very negative review if you will try sell something or provide service this very actually should be for @Dragic and his L2Forge sales.
    • Αχ ναι; τοτε γιατι με παρακαλουσες για κωδικες και οτι σου εδινα ελεγες τελεια και wow σαγαπαω? Ε ψευτρακο; Γιατι οτι πηρες λειτουργει οπως το ηθελες ακομη και σε λεπτομερεια που κανας αλλος θα σου ελεγε αντε κ γα*?   Σε τσουξανε οι τιμουλες μου στη τσεπουλα σου; κ βρηκες κανα new chatgpt dev? Φτωχομπινε του κερατα που κανεις παζαρια για 40-50 ευρω κωδικες.   Δεν ασχολουμε αλλο απλα ενημερωνω @Celestineτο παιδακι χρωσταει λεφτα για κωδικα που ελαβε και λειτουργει και το επιβεβαιωσε και με μπλοκαρε κ ολας. Ban η οχι δεν ασχολουμε αλλο. καλη τυχη 
    • den tha asxolithw allo mazi sou randoma,kserei olo to forum ti  eisai
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..