AutoHotKey is a fork of AutoIT afaik, AutoIT is the original. Never used AutoHotKey before, always used AutoIt (it's very easy to use).
Here's a little program I made in autoit to solved bejeweled in starcraft 2 LOL
#include <Color.au3>
hotkeyset( "{esc}" , "Quit" )
HotKeySet("2", "execute")
global $grid[8][8]
global $i = 0
global $j = 0
Global $tolerance = 20
Global $number_found = 0
Func get_pixel_colour()
$grid[0][0] = hex(PixelGetColor(1150,143),6)
$grid[0][1] = hex(PixelGetColor(1150+66,143),6)
$grid[0][2] = hex(PixelGetColor(1150+66+66,143),6)
$grid[0][3] = hex(PixelGetColor(1150+66+66+66,143),6)
$grid[0][4] = hex(PixelGetColor(1150+66+66+66+66,143),6)
$grid[0][5] = hex(PixelGetColor(1150+66+66+66+66+66,143),6)
$grid[0][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143),6)
$grid[0][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143),6)
$grid[1][0] = hex(PixelGetColor(1150,143+66),6)
$grid[1][1] = hex(PixelGetColor(1150+66,143+66),6)
$grid[1][2] = hex(PixelGetColor(1150+66+66,143+66),6)
$grid[1][3] = hex(PixelGetColor(1150+66+66+66,143+66),6)
$grid[1][4] = hex(PixelGetColor(1150+66+66+66+66,143+66),6)
$grid[1][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66),6)
$grid[1][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66),6)
$grid[1][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66),6)
$grid[2][0] = hex(PixelGetColor(1150,143+66+66),6)
$grid[2][1] = hex(PixelGetColor(1150+66,143+66+66),6)
$grid[2][2] = hex(PixelGetColor(1150+66+66,143+66+66),6)
$grid[2][3] = hex(PixelGetColor(1150+66+66+66,143+66+66),6)
$grid[2][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66),6)
$grid[2][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66),6)
$grid[2][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66),6)
$grid[2][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66),6)
$grid[3][0] = hex(PixelGetColor(1150,143+66+66+66),6)
$grid[3][1] = hex(PixelGetColor(1150+66,143+66+66+66),6)
$grid[3][2] = hex(PixelGetColor(1150+66+66,143+66+66+66),6)
$grid[3][3] = hex(PixelGetColor(1150+66+66+66,143+66+66+66),6)
$grid[3][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66+66),6)
$grid[3][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66+66),6)
$grid[3][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66+66),6)
$grid[3][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66+66),6)
$grid[4][0] = hex(PixelGetColor(1150,143+66+66+66+66),6)
$grid[4][1] = hex(PixelGetColor(1150+66,143+66+66+66+66),6)
$grid[4][2] = hex(PixelGetColor(1150+66+66,143+66+66+66+66),6)
$grid[4][3] = hex(PixelGetColor(1150+66+66+66,143+66+66+66+66),6)
$grid[4][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66+66+66),6)
$grid[4][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66+66+66),6)
$grid[4][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66+66+66),6)
$grid[4][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66+66+66),6)
$grid[5][0] = hex(PixelGetColor(1150,143+66+66+66+66+66),6)
$grid[5][1] = hex(PixelGetColor(1150+66,143+66+66+66+66+66),6)
$grid[5][2] = hex(PixelGetColor(1150+66+66,143+66+66+66+66+66),6)
$grid[5][3] = hex(PixelGetColor(1150+66+66+66,143+66+66+66+66+66),6)
$grid[5][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66+66+66+66),6)
$grid[5][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66+66+66+66),6)
$grid[5][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66+66+66+66),6)
$grid[5][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66+66+66+66),6)
$grid[6][0] = hex(PixelGetColor(1150,143+66+66+66+66+66+66),6)
$grid[6][1] = hex(PixelGetColor(1150+66,143+66+66+66+66+66+66),6)
$grid[6][2] = hex(PixelGetColor(1150+66+66,143+66+66+66+66+66+66),6)
$grid[6][3] = hex(PixelGetColor(1150+66+66+66,143+66+66+66+66+66+66),6)
$grid[6][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66+66+66+66+66),6)
$grid[6][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66+66+66+66+66),6)
$grid[6][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66+66+66+66+66),6)
$grid[6][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66+66+66+66+66),6)
$grid[7][0] = hex(PixelGetColor(1150,143+66+66+66+66+66+66+66),6)
$grid[7][1] = hex(PixelGetColor(1150+66,143+66+66+66+66+66+66+66),6)
$grid[7][2] = hex(PixelGetColor(1150+66+66,143+66+66+66+66+66+66+66),6)
$grid[7][3] = hex(PixelGetColor(1150+66+66+66,143+66+66+66+66+66+66+66),6)
$grid[7][4] = hex(PixelGetColor(1150+66+66+66+66,143+66+66+66+66+66+66+66),6)
$grid[7][5] = hex(PixelGetColor(1150+66+66+66+66+66,143+66+66+66+66+66+66+66),6)
$grid[7][6] = hex(PixelGetColor(1150+66+66+66+66+66+66,143+66+66+66+66+66+66+66),6)
$grid[7][7] = hex(PixelGetColor(1150+66+66+66+66+66+66+66,143+66+66+66+66+66+66+66),6)
EndFunc
Func ColorInBounds($pMColor, $pTColor, $pVariation)
$lMCBlue = _ColorGetBlue("0x"&$pMColor)
$lMCGreen = _ColorGetGreen("0x"&$pMColor)
$lMCRed = _ColorGetRed("0x"&$pMColor)
$lTCBlue = _ColorGetBlue("0x"&$pTColor)
$lTCGreen = _ColorGetGreen("0x"&$pTColor)
$lTCRed = _ColorGetRed("0x"&$pTColor)
$a = Abs($lMCBlue - $lTCBlue)
$b = Abs($lMCGreen - $lTCGreen)
$c = Abs($lMCRed - $lTCRed)
If ( ( $a < $pVariation) AND ( $b <$pVariation) AND ( $c < $pVariation) ) Then
Return True
Else
Return False
EndIf
EndFunc
Func solve()
while ($j < 8)
While ($i < 8)
;;1
if ($i + 0 < 8 And $j + 3 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 0],$grid[$i + 0][$j + 1],$tolerance) And ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 0][$j + 3],$tolerance)) Then
MouseClick("left",1150+$j*66+66*3,143+$i*66,1,1)
MouseClick("left",1150+$j*66+66*2,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;2
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 0] , $grid[$i + 0][$j + 1],$tolerance) And ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 1][$j + 2],$tolerance)) Then
MouseClick("left",1150+$j*66+66*2,143+$i*66+66,1,1)
MouseClick("left",1150+$j*66+66*2,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;3
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 0] , $grid[$i + 0][$j + 2],$tolerance) And ColorInBounds($grid[$i + 0][$j + 2] , $grid[$i + 1][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66+66,143+$i*66+66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;4
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 1][$j + 0] , $grid[$i + 0][$j + 1],$tolerance) And ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 0][$j + 2],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66+66,1,1)
MouseClick("left",1150+$j*66,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;5
if ($i + 0 < 8 And $j + 3 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 0] , $grid[$i + 0][$j + 2],$tolerance) And ColorInBounds($grid[$i + 0][$j + 2] , $grid[$i + 0][$j + 3],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;6
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 2] , $grid[$i + 1][$j + 1],$tolerance) And ColorInBounds($grid[$i + 1][$j + 1] , $grid[$i + 1][$j + 0],$tolerance)) Then
MouseClick("left",1150+$j*66+66+66,143+$i*66,1,1)
MouseClick("left",1150+$j*66+66+66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;7
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 1][$j + 0],$tolerance) And ColorInBounds($grid[$i + 1][$j + 0] , $grid[$i + 1][$j + 2],$tolerance)) Then
MouseClick("left",1150+$j*66+66,143+$i*66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;8
if ($i + 1 < 8 And $j + 2 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 0] , $grid[$i + 1][$j + 1],$tolerance) And ColorInBounds($grid[$i + 1][$j + 1] , $grid[$i + 1][$j + 2],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66,1,1)
MouseClick("left",1150+$j*66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;9
if ($i < 5) Then
if (ColorInBounds($grid[$i][$j] , $grid[$i + 1][$j],$tolerance) And ColorInBounds($grid[$i + 1][$j] , $grid[$i + 3][$j],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66+66+66+66,1,1)
MouseClick("left",1150+$j*66,143+$i*66+66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;10
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 1][$j] , $grid[$i + 2][$j],$tolerance) And ColorInBounds($grid[$i + 2][$j] , $grid[$i + 0][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66+66,143+$i*66,1,1)
MouseClick("left",1150+$j*66,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;11
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 0][$j] , $grid[$i + 2][$j],$tolerance) And ColorInBounds($grid[$i + 2][$j] , $grid[$i + 1][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66+66,143+$i*66+66,1,1)
MouseClick("left",1150+$j*66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;12
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 0][$j] , $grid[$i + 1][$j],$tolerance) And ColorInBounds($grid[$i + 1][$j] , $grid[$i + 2][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66+66,143+$i*66+66+66,1,1)
MouseClick("left",1150+$j*66,143+$i*66+66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;13
if ($i + 3 < 8) Then
if (ColorInBounds($grid[$i][$j] , $grid[$i + 2][$j],$tolerance) And ColorInBounds($grid[$i + 2][$j] , $grid[$i + 3][$j],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66,1,1)
MouseClick("left",1150+$j*66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;14
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 0][$j] , $grid[$i + 1][$j + 1],$tolerance) And ColorInBounds($grid[$i + 1][$j + 1] , $grid[$i + 2][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;15
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 1][$j],$tolerance) And ColorInBounds($grid[$i + 1][$j] , $grid[$i + 2][$j + 1],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66+66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
;;16
if ($i + 2 < 8 And $j + 1 < 8) Then
if (ColorInBounds($grid[$i + 0][$j + 1] , $grid[$i + 1][$j + 1],$tolerance) And ColorInBounds($grid[$i + 1][$j + 1] , $grid[$i + 2][$j + 0],$tolerance)) Then
MouseClick("left",1150+$j*66,143+$i*66+66+66,1,1)
MouseClick("left",1150+$j*66+66,143+$i*66+66+66,1,1)
;sleep(1000)
get_pixel_colour()
$number_found = $number_found + 1
EndIf
EndIf
$i = $i + 1
WEnd
$i = 0
$j = $j + 1
WEnd
$j = 0
$i = 0
EndFunc
Sleep(2000)
get_pixel_colour()
Func execute()
HotKeySet("2")
solve()
If $number_found > 0 Then
$number_found = 0
$tolerance = 20
Else
$tolerance = $tolerance + 5
EndIf
get_pixel_colour()
HotKeySet("2", "execute")
EndFunc
While True
Sleep(10)
WEnd
func Quit()
exit
endfunc