#include <Misc.au3>
#include <FastFind.au3>
#include <WinAPI.au3>
#include <APIConstants.au3>
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
$color = 16765255 ; 색깔#
$colorhex = 0xffd247
$coord1 = 763
$coord2 = 841
$coord3 = 919
$coord4 = 997
$count = 0
While 1
If $count = 0 Then
$mouse = MouseGetPos()
EndIf
$button4 = PixelGetColor($coord4, 606)
If $button4 = $color Then
MouseClick("left", $coord4 + 30, 625, 1, 1)
$count += 1
EndIf
$button4 = PixelGetColor($coord4, 606)
$button3 = PixelGetColor($coord3, 606)
If $button4 <> $color And $button3 = $color Then
MouseClick("left", $coord3 + 30, 625, 1, 1)
$count += 1
EndIf
$button4 = PixelGetColor($coord4, 606)
$button3 = PixelGetColor($coord3, 606)
$button2 = PixelGetColor($coord2, 606)
If $button4 <> $color And $button3 <> $color And $button2 = $color Then
MouseClick("left", $coord2 + 30, 625, 1, 1)
$count += 1
EndIf
$button4 = PixelGetColor($coord4, 606)
$button3 = PixelGetColor($coord3, 606)
$button2 = PixelGetColor($coord2, 606)
$button1 = PixelGetColor($coord1, 606)
If $button4 <> $color And $button3 <> $color And $button2 <> $color And $button1 = $color Then
MouseClick("left", $coord1 + 30, 625, 1, 1)
$count += 1
EndIf
WEnd
There are four buttons that light up in certain conditions, and I am trying to click them as fast as I can.
Also, I MUST press Button 4 before Button 3, 3 before 2, and 2 before 1. Which is the reason I wrote it like:
$button4 = PixelGetColor($coord4, 606)
$button3 = PixelGetColor($coord3, 606)
$button2 = PixelGetColor($coord2, 606)
$button1 = PixelGetColor($coord1, 606)
If $button4 <> $color And $button3 <> $color And $button2 <> $color And $button1 = $color Then...
I am currently using PixelGetColor, but I'm not sure if this is the best way to do this process loop.
Is there any faster function which does the same thing as PixelGetColor?
Or possibly any way to accelerate the process..?
+ If anyone can help compress the coding neatly, It'll be great, too.