I tried to create a Script which will Move my Mouse Cursor to the location whenever the color 0xFB9303 is found, then it should wait for the color 0xFFCFC7 to appear, and after that it should click on it as fast as possible.
That seems to work but after a few seconds it crashes with the Crash Code:
Line 20 (File:"File Path, File Name")
Error: Subscript used on non-accessible variable
Heres the Code:
Code:
#RequireAdmin
HotKeySet("g", "start")
HotKeySet("h", "stop")
$WaitColor=0xFB9303
$ClickColor=0xFFCFC7
While 1
Sleep(100)
WEnd
func stop()
Exit
EndFunc
func start()
while 1
$productbar1 = PixelSearch(850,750,1050,800, $WaitColor,0)
If Not @error Then
MouseMove($productbar1[0],$productbar1[1], 1)
EndIf
$productbar2 = PixelSearch(850,750,1050,800, $ClickColor,0)
If Not @error Then
MouseMove($productbar1[0],$productbar1[1], 0)
MouseClick("left", $productbar1[0], $productbar1[1]-5, 1, 0)
Sleep(200)
EndIf
WEnd
EndFunc






