Template timeout.

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
Is there a way to have a timeout for a template,
example, if the template didn't succeed/fail within 500 sec, finish the template as failure?

Thanks.
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
You can use {-TimeNow.Date-} or {-Environment.TickCount-} to check dates and compare them the way you need inside template
 

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
Hey, I just tested it, but it doesn't work if for some reason the template is stuck on some page..I tried using "tab timeout" but it didn't work either..

Do you know of a solution to prevent templates from getting stuck/if they get stuck- stop the template...?

Thanks!
 

rostonix

Известная личность
Регистрация
23.12.2011
Сообщения
29 067
Благодарностей
5 707
Баллы
113
What do you mean by stuck? What actions were performed? Did instance stop responsing? More infor is needed.
 

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
The instance stops responding only in ZP,
I will try to test it and see which actions might cause it to happen and in which stage the template gets stuck
 

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
NVM, I just saw that it is possible via the .bat
I'll test it and see, thanks!
 

muchink

Client
Регистрация
28.07.2012
Сообщения
193
Благодарностей
6
Баллы
18
Found it,
whenever I'm using multi threading and using this C# code for pasting, the templates probably can't copy and paste one by one so it gets stuck,
this is the code, I remember HB gave it to me once, but only now I noticed that I'm having problems with it, I'll try to find other solutions.

string newTheme = project.Variables["VariableName"].Value;
lock(SyncObjects.InputSyncer)

{

System.Windows.Forms.Clipboard.SetText(newTheme);
Emulator.ActiveWindow(instance.FormTitle);
System.Windows.Forms.SendKeys.SendWait("^v");

}
 

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)