Jump to content
VulturARG

How long is too long for a script to execute?

Recommended Posts

Hi, 

 

I tried that an scripts start running 2 hrs after game started. This code is from EOS script

if (_pause > 0 and !_initialLaunch) then {
	for "_counter" from 1 to _pause do {
		if (_hints) then {
			hint format ["Attack ETA : %1",(_pause - _counter)];
		};
		sleep 1;
	};
};

They code after that never started.


Is there any way to wait for long period?

 

Regards

Share this post


Link to post
Share on other sites
10 hours ago, killzone_kid said:

Doesn’t say much

 

I need that a process wait 2 hours for start.
Meanwhile the mission is running
It's possible?
With that code that I wrote before, the code never started to run after those lines.

Share this post


Link to post
Share on other sites
waitUntil { sleep 1; time > 7200 };
// your code

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
13 hours ago, VulturARG said:

 

I need that a process wait 2 hours for start.
Meanwhile the mission is running
It's possible?
With that code that I wrote before, the code never started to run after those lines.

sleep (2*60*60);

// your code

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
14 hours ago, killzone_kid said:

sleep (2*60*60);

// your code

 

Some people told me that Arma 3 can kill process if it are in a long waiting loop.
I don't know is that is true. This was the reason to my question.

Share this post


Link to post
Share on other sites

A sleep isn't a loop. A while/do loop will, in specific situations, terminate itself after 10k iterations, but that's not relevant here. Other than that, not sure what "some people" are talking about.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/20/2020 at 6:37 PM, M1ke_SK said:

waitUntil { sleep 1; time > 7200 }; // your code

If you want to wait 2 hours, checking every second seems a bit excessive doesn't it?

Checking once per minute would be more than sufficient..

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
1 hour ago, Dedmen said:

If you want to wait 2 hours, checking every second seems a bit excessive doesn't it?

Checking once per minute would be more than sufficient..

Not very much information to go on how OP want to use it tho.

This is general idea that works for every case. It depends on use.

 

From what I see, he is using it for some counting ETA to some wave, so you probably want to have precise counter there.

  • Thanks 1

Share this post


Link to post
Share on other sites
20 hours ago, VulturARG said:

 

Some people told me that Arma 3 can kill process if it are in a long waiting loop.
I don't know is that is true. This was the reason to my question.

unless you terminate the script with 'terminate' command or overload the scheduler so that it gets broken, the script won't be unloaded from scheduler

 

  • Like 1
  • Thanks 1

Share this post


Link to post
Share on other sites
On 5/22/2020 at 7:15 AM, M1ke_SK said:

From what I see, he is using it for some counting ETA to some wave, so you probably want to have precise counter there.

 

Yes, I count for a few minutes, to long waits. It's will be used in different situation in parallel

Share this post


Link to post
Share on other sites

Thanks to all!!!

 

I run some test and I saw that using for with sleep, have delays in busy servers. I'll try this solution:

 

On 5/20/2020 at 1:37 PM, M1ke_SK said:

waitUntil { sleep 1; time > 7200 };
// your code

 

 

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

×