I'm trying to make a script for http://www.tetrisfriends.com/games/Battle2P/game.php
By using PixelSearch i can find where the start button is and press it.
Now i need to wait for the player to finish the game.
Then when the game is over, i need to press "play again" or if it can press "Promote Me".
and then do it all over again.
So i alredy have a sytem that search the guide point en then press the start button.
But after the game starts i can't seem to get the now color.
Why is PixelGetColor not working?
Here is all the code that i have made:
Can someone tell me why it is not working.
Thanks.
Zero.
PS: I only know AutoIt for about a week
so for the most part I'm new to it.
I know Game Maker, Java, HTML, CSS, Javascript, JQuery, PHP so learing this learning this language is easy for me.
By using PixelSearch i can find where the start button is and press it.
Now i need to wait for the player to finish the game.
Then when the game is over, i need to press "play again" or if it can press "Promote Me".
and then do it all over again.
So i alredy have a sytem that search the guide point en then press the start button.
But after the game starts i can't seem to get the now color.
Why is PixelGetColor not working?
Here is all the code that i have made:
[ autoit ]
HotKeySet("{ESC}", "Terminate") Global $cont = 0 Global $startpoint = PixelSearch(0,0,@DesktopWidth,@DesktopHeight, 0x0099FF) If Not @error Then $cont = 1 Else $cont = 0 EndIf If $cont = 1 Then Global $startbutton = $startpoint $startbutton[0] = $startpoint[0]+172 $startbutton[1] = $startpoint[1]+246 Global $startcolor = PixelGetColor($startpoint[0], $startpoint[1]) Global $nowcolor = $startcolor EndIf Func Terminate() Exit EndFunc Func startGame() MouseClick("primary", $startbutton[0], $startbutton[1], 1, 0) EndFunc If $cont = 1 Then startGame() While 1 $nowcolor = PixelGetColor($startpoint[0], $startpoint[1]) If Not $startcolor = $nowcolor Then ConsoleWrite($nowcolor) ConsoleWrite(@LF) EndIf WEnd Else Msgbox(48,"Error", "Can't find Tetris Battle Field." & @LF & "Make sure you are on the Tetris Friends Battle 2P Page," & @LF & "And the whole playing field is showing.", 8) Terminate() EndIf
Can someone tell me why it is not working.
Thanks.
Zero.
PS: I only know AutoIt for about a week
![>_<](http://aut1.autoit-cdn.com/forum/public/style_emoticons/default/pinch.gif)
I know Game Maker, Java, HTML, CSS, Javascript, JQuery, PHP so learing this learning this language is easy for me.