Scripting Alarm Clock Refactor

This commit is contained in:
AconiteX
2021-09-19 12:03:54 -04:00
parent 2fc6ea8e3b
commit d998af72ba
6 changed files with 146 additions and 99 deletions
@@ -5,6 +5,8 @@ import script.library.events;
import script.library.holiday;
import script.obj_id;
import java.time.LocalTime;
public class planet_event_handler extends script.base_script
{
public planet_event_handler()
@@ -72,7 +74,7 @@ public class planet_event_handler extends script.base_script
removeObjVar(self, "lifeday");
setObjVar(self, "lifeday.emptyScoreBoard", "true");
newTimeStamp(self);
createDailyAlarmClock(self, "lifeDayDailyAlarm", null, 10, 0, 0);
timedMessageToDaily(self, "lifeDayDailyAlarm", null, LocalTime.of(10, 0, 0));
}
}
private boolean newDay(obj_id self) throws InterruptedException
@@ -91,7 +93,7 @@ public class planet_event_handler extends script.base_script
int secondsUntil = secondsUntilNextDailyTime(10, 0, 0);
int then = now + secondsUntil;
setObjVar(self, EVENT_TIMESTAMP, then);
createDailyAlarmClock(self, "lifeDayDailyAlarm", null, 10, 0, 0);
timedMessageToDaily(self, "lifeDayDailyAlarm", null, LocalTime.of(10, 0, 0));
}
public int setUpEventLeaderBoard(obj_id self, dictionary params) throws InterruptedException
{