Forum Discussion

SachaMagne's avatar
10 years ago

[Fixed] How to use properly AlarmHandlde ?

I made a script that use AlarmHandle and the function is never called nor return any compiling/python errors.
I'm a bit puzzled on that one as i need this function to be called every sim hour.


ts = services.time_service()
span = interval_in_sim_hours(1)
alarm_hour= ts.sim_now.hour()
time=create_date_and_time(hours=alarm_hour)
time=ts.sim_timeline.now + span
write_debug_log('time={} , span {}'.format(time,span)) ---> time=02:18:57.280 day:1 week:2 , span 1.00 hours
AlarmHandle(StartMod, DoJob, ts.sim_timeline,time, repeating=True, repeat_interval=span, accurate_repeat=True)


Is there something else to do to activate it ?
Thanks for all feedback!