#include HotKeySet("^!x", "QuitProg") ;press ctrl+alt+x to stop program $iterations = 0 Dim $coord[2] Dim $values[5] $colour = 0xD8A355 ;coffee $x1 = 0 $y1 = 0 $x2 = 1015 $y2 = 0 $values[0] = 0 $values[1] = 0 $values[2] = 1015 $values[3] = 0 $values[4] = $colour MsgBox(0, "Ready", "Press OK to start Mikey's Millionaire City Bot. Press ctrl+alt+x to exit at any time.") sleep(5000) While 1 ;search(0, 0, 1015, 0, $colour) ;search top line (i think) search($values[0], $values[1], $values[2], $values[3], $values[4]) WEnd func search($x1, $y1, $x2, $y2, $colour) $coord = PixelSearch($x1, $y1, $x2, $y2, $colour) If Not @error Then If $colour == 0xD8A355 Then ;if coffee $nextPixel = 0xBC782F ElseIf $colour == 0xA75945 Then;if flower $nextPixel = 0xE7CBA3 EndIf If PixelGetColor($coord[0]+1, $coord[1]) == $nextPixel Then ; check one pixel to the right MouseClick("left", $coord[0], $coord[1], 1) ;click on found pixel sleep(1000) MouseMove(0, 0) sleep(2000) $values[0] = $coord[0]+1 $values[1] = $coord[1] $values[2] = $x2 $values[3] = $y2 $values[4] = $colour Return ;search($coord[0]+1, $coord[1], $x2, $y2, $colour) EndIf Else ;if error If $y1 > 730 Then $iterations+=1 $x1 = 0 $y1 = 0 ;sleep(30000) ; wait 30sec If $colour == 0xD8A355 Then ;if coffee, then flower $colour = 0xA75945 ElseIf $colour == 0xA75945 Then ; if flower, then coffee $colour = 0xD8A355 EndIf $values[0] = $x1 $values[1] = $y1 $values[2] = 1015 $values[3] = 0 $values[4] = $colour ;search($x1, $y1, 1015, 0, $colour) ;start again Return Exit EndIf $y1+=1 $y2+=1 $values[0] = 0 $values[1] = $y1 $values[2] = 1015 $values[3] = $y2 $values[4] = $colour Return ;search(0, $y1, 1015, $y2, $colour) ;search next line (i think) EndIf EndFunc Func declare() Dim $coord[2] $coord[0] = 0 $coord[1] = 0 EndFunc Func QuitProg() Exit EndFunc