RedBelette 26 Posted September 27, 2017 params ["_job", "_time"]; trigger = createTrigger ["EmptyDetector", [0,0,0], false]; trigger setTriggerActivation ["NONE", "PRESENT", true]; trigger setTriggerStatements ["thisTrigger", _job, ""]; trigger setTriggerTimeout [_time, _time, _time, true]; https://github.com/RedBelette/RED_co9_op_anger_of_the_west.Kunduz/blob/master/function/MIS_fnc_cronjob.sqf Hello everyone, I want to create a small function to launch repetitive tasks. A small function of cronjob. This can be useful, for example, in cleaning up deceded units. You have an example so above. Do you think this example will work? Is this a good practice? Best regards, RedBelette Share this post Link to post Share on other sites
scottb613 263 Posted September 27, 2017 Unix guy ? Nice... Regards, Scott Share this post Link to post Share on other sites
RedBelette 26 Posted September 27, 2017 params ["_job", "_time"]; _trigger = createTrigger ["EmptyDetector", [0,0,0], false]; _trigger setTriggerActivation ["NONE", "PRESENT", true]; _trigger setTriggerStatements ["!(triggerActivated thisTrigger)", _job, ""]; _trigger setTriggerTimeout [_time, _time, _time, true]; _trigger Here is the corrected script Share this post Link to post Share on other sites
pierremgi 4823 Posted September 27, 2017 params ["_job","_time"]; while {true} do { _job; sleep _time; }; 1 Share this post Link to post Share on other sites
RedBelette 26 Posted September 27, 2017 I had this solution there initially but I wanted something cleaner. Do you know if it's better to go through a while true? Share this post Link to post Share on other sites