Jump to content

send after delay wont work


 Share

Recommended Posts

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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...