mond1106

send after delay wont work

3 posts in this topic

Hi,

 

Im new to autoit I trying to delay the send of enter of the program im making but it doesnt work.

 

here is my code.

 

#include<ImageSearch2015.au3>

HotKeySet("{-}", "TogglePause")
HotKeySet("{ESC}", "Terminate")
Global $NoWork
$TransTimer = 0

$x1 = 0
$y1 = 0


While 1

Local $hWnd = WinWait("[Pictures]", "", 5)
WinActivate($hWnd)

$picture = "poopies.png"

$result = _ImageSearch($picture,1,$x1,$y1,0,0)

ConsoleWrite($result)

If $result = 1 Then

   MouseClick("left",$x1,$y1,1,1)
   sleep (10000)

   Send("ENTER")
   Send("ENTER")
   Send("ENTER")
EndIf

WEnd


Func TogglePause()
$NoWork = Not $NoWork
While $NoWork

sleep(100)
ToolTip('Paused',491,149)
WEnd
ToolTip("")
EndFunc

Func Terminate()
Sleep(100)
ToolTip('Stopped',491,149)
Sleep(10000)
Exit 0
EndFunc

 

 

Thank you.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now