Jump to content
Sign in to follow this  
foolove

code NOT working seems to stay in loop

Recommended Posts

foolove

While 1 = 1

$coord1 = PixelSearch( 538, 463, 626, 479, 0xE7E7E7 )

If Not @error Then

MouseClick("left", $coord1[0], $coord1[1], 1)

EndIf

$FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock[0], $FindDock[1], 1)

Else

$FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock2[0], $FindDock2[1], 1)

EndIf

EndIf

$FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock3[0], $FindDock3[1], 1)

Else

$FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE )

If Not @error Then

MouseClick("left", $FindDock4[0], $FindDock4[1], 1)

EndIf

EndIf

WEnd

MouseClick("left", 1124, 591, 1, 0)

Send("Welcome to a bot in testing 123!!!")

Send("{ENTER}")

Share this post


Link to post
Share on other sites
Xandy

#include "misc.au3"
While 1 = 1
if _ispressed("0d") then exitloop; press the ENTER key to exit the loop
$coord1 = PixelSearch( 538, 463, 626, 479, 0xE7E7E7 )
If Not @error Then
  MouseClick("left", $coord1[0], $coord1[1], 1)
EndIf
 
 
$FindDock = PixelSearch(766, 41, 781, 49, 0xFEFEFE )
If Not @error Then
  MouseClick("left", $FindDock[0], $FindDock[1], 1)
Else
  $FindDock2 = PixelSearch(784, 212, 797, 221, 0xFEFEFE )
If Not @error Then
  MouseClick("left", $FindDock2[0], $FindDock2[1], 1)
  EndIf
EndIf
 
$FindDock3 = PixelSearch(803, 386, 817, 394, 0xFEFEFE )
If Not @error Then
  MouseClick("left", $FindDock3[0], $FindDock3[1], 1)
Else
  $FindDock4 = PixelSearch(819, 559, 834, 567, 0xFEFEFE )
If Not @error Then
  MouseClick("left", $FindDock4[0], $FindDock4[1], 1)
EndIf
EndIf
WEnd
 
MouseClick("left", 1124, 591, 1, 0)
Send("Welcome to a bot in testing 123!!!")
Send("{ENTER}")

Edited by songersoft

Share this post


Link to post
Share on other sites
ahmet

You haven't set condition for exiting loop. Look at ExitLoop function.

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
Sign in to follow this  

×