Jump to content
RedBelette

A cronjob function for a mission

Recommended Posts

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
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

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×