Hello:
Depending on the PC and server where my script is run, I need less or more pause, I was thinking about change for a dynamic system, implement an option that breaks up or down depending on the PC and server.
Not if it could be determined, as in games, any evidence that tells me the response speed of the PC and current server and then adjust automatically pause.
While I can think of how to define a varible I thought, with a value of 1 for normal pause, and increase or decrease it in steps of 25 for slower 1.25, 1.50, ... they would like Sleep 250 * wSleepMulti.
But these days the problem is more serious, it seems that the pauses do not work properly for a network problem, the program runs remotely via Citrix, we must slow down the entire script.
I use SendInput, it is the fastest system I found when I started but is failing, I'm thinking of changing everything to Send, and use SetKeyDelay, SetMouseDelay and SetDefaultMouseSpeed, but can not find values appropriate starting or values to increase them.
Anyone who has had the same problem and can give me some clue?
--
Greetings
Slowing my script
Re: Slowing my script
one more idea , you can add the parameter to set the waiting time for winwaitactive or winwait and add the errorlevle to judge for the next steps. I think this can reduce the different computer response time.
Re: Slowing my script
CHMike In my scripts always I wait a while for a window, if it is not finished the script not to do wrong things, sometimes I put a safe waiting for me time to complete manually what did not work so automatically.
I think the biggest problem is SendInput and mouse movement, I need to slow down two with similar values, eg .: 25% over time.
Thank you for your suggestion.
I think the biggest problem is SendInput and mouse movement, I need to slow down two with similar values, eg .: 25% over time.
Thank you for your suggestion.
Re: Slowing my script
Citrix is just an image on the screen not a real program running on your local computer.
Use ImageSearch or PixelGetColor to know when it's ready for input.
Use ImageSearch or PixelGetColor to know when it's ready for input.
Re: Slowing my script
Xtra I know, whenever I can use the image search. I am currently conducting tests with variable pauses or slowing the mouse movement and sending text, but it seems that is not the solution.
Re: Slowing my script
It could also be that the program you are running on citrix is part of the problem,
then you would have two problems...
I would start by using send (which is event by default) and then use
For every bit of navigation use imagesearch in a loop so it will keep trying until successful this is your dynamic wait timing.
If it seems redundant do it anyways it will make it more reliable and that's all the matters.
(tip: use tooltips to debug / see the script navigation)
Example of dynamic wait:
Once you get it working i would then make the imagesearch into a function to simplify the process.
I do this all the time.
HTH
then you would have two problems...
I would start by using send (which is event by default) and then use
Code: Select all
SetKeyDelay, 50, 50
If it seems redundant do it anyways it will make it more reliable and that's all the matters.
(tip: use tooltips to debug / see the script navigation)
Example of dynamic wait:
Code: Select all
Loop
{
ToolTip, looking for imagename %A_Index%
ImageSearch, posX, posY, 100, 100, 200, 200, imagename.png
if (ErrorLevel = 0)
{
ToolTip, found: imagename
break ; or click the image here if it's a button etc and then break the loop.
}
Sleep 100
}
ToolTip
I do this all the time.
HTH
Re: Slowing my script
I agree.Xtra wrote:It could also be that the program you are running on citrix is part of the problem,
then you would have two problems...
I've tried different values for the first parameter SetKeyDelay, 25 is semi slow 50 slow, but does not solve the problem, I will try with both parameters.Xtra wrote:I would start by using send (which is event by default) and then useCode: Select all
SetKeyDelay, 50, 50
I already do, an example of my codeXtra wrote:For every bit of navigation use imagesearch in a loop so it will keep trying until successful this is your dynamic wait timing.
If it seems redundant do it anyways it will make it more reliable and that's all the matters.
(tip: use tooltips to debug / see the script navigation)
Code: Select all
Loop 5 ; If I can not find the first
{
BuscaImagen("r_estado_siguiente_act.png") ; Look for the Next button but not pressed.
If !ErrorLevel ; If I find (ErrorLevel = 0) ...
Break ; ... exit
Sleep 250*vSpeedx ; SpeedX can be 1, 1.15. 1.50, and so on.
}
If ErrorLevel ; If you finish the loop and does not find the button ...
{
TrayTip,,Botón siguiente no encontrado %ErrorLevel%,,3 ; ... warns and ...
Return ; ... exit.
}
I'm trying to SetMouseDelay because sometimes not the site that should move.
Thanks again.
Who is online
Users browsing this forum: peter_ahk and 329 guests