Jump to content

I'm trying to make a script that clicks on a circle in a 3x3 when said circle turns black but nothing happen - (Locked)


Recommended Posts

I'm sure there is a better way to do this but I'm  new so w/e I also tried one where the line looked like this : If $1=0x000000 Then MouseClick ("left",857,363,1,10)

Global $1,$2,$3,$4,$5,$6,$7,$8,$9

HotKeySet("{ESC}", "Terminate")
ToolTip ("thang is running",0,0)
While 1
Sleep (10)
$1=PixelGetColor (857,363)
$2=PixelGetColor (947,365)
$3=PixelGetColor (1161,356)
$4=PixelGetColor (814,495)
$5=PixelGetColor (972,493)
$6=PixelGetColor (1102,510)
$7=PixelGetColor (814,639)
$8=PixelGetColor (953,649)
$9=PixelGetColor (1124,639)
WEnd

If $1=0x000000 Then
    MouseClick ("left",857,363,1,10)
EndIf
If $2=0x000000 Then
    MouseClick ("left",947,365,1,10)
EndIf
If $3=0x000000 Then
    MouseClick ("left",1161,356,1,10)
EndIf
If $4=0x000000 Then
    MouseClick ("left",814,495,1,10)
EndIf
If $5=0x000000 Then
    MouseClick ("left",972,493,1,10)
EndIf
If $6=0x000000 Then
    MouseClick ("left",1102,510,1,10)
EndIf
If $7=0x000000 Then
    MouseClick ("left",814,639,1,10)
EndIf
If $8=0x000000 Then
    MouseClick ("left",953,649,1,10)
EndIf
If $9=0x000000 Then
    MouseClick ("left",1124,639,1,10)
EndIf

Func Terminate()
    Exit 0
EndFunc
Link to comment
Share on other sites

Your While loop only sets the variables with the respective return value of PixelGetColor over and over again until you terminate it. The section with the mouse clicks will never be reached.

Before we go into detail, what application are you trying to automate ?

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Link to comment
Share on other sites

  • Developers

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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