Linkis20 Posted January 25, 2013 Share Posted January 25, 2013 I'm trying to make a script for http://www.tetrisfriends.com/games/Battle2P/game.phpBy 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:expandcollapse popupHotKeySet("{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() EndIfCan 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. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted January 25, 2013 Moderators Share Posted January 25, 2013 Hi, Linkis20, welcome to the forum. Please read the forum rules, especially the part about game automation (this is something new forum members often miss) and you'll find out why you will not receive help on this issue. A link to the forum rules is located at the bottom right of every page. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 25, 2013 Moderators Share Posted January 25, 2013 Linkis20,JLogan3o13 is quite right - please read the Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts