Autoit Question - If specific pixels found move menu

User Tag List

Results 1 to 2 of 2
  1. #1
    Gulogomi's Avatar Member
    Reputation
    1
    Join Date
    Nov 2014
    Posts
    3
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Autoit Question - If specific pixels found move

    Greetings everyone!

    I'm trying to create a bot for a flash game, to test and practice my current skills. The game itself has x amount of levels and I only have to complete 3 of them. The 3 levels is picked random in the games "level library ".

    I'm currently trying to make it complete a specific level, but I dont know how to make the player move 1 down, if all the specific pixels is found.

    Here is the code:

    Code:
    ;Exit HotKey
    HotKeySet("{F1}", "myExit")
    
    WinActivate("GAME– Google Chrome")
    
    Sleep(1000)
    
    ;Variables
    $dirtColor = 0x5E480F
    $clearDirtColor= 0x2D2206
    $stoneBlockColor=0x7F654C ;Remember viration
    $rolingStoneColor= 0x575656 ;Remember viration
    $backgroundColor = 0x97761E
    
    ;Levels
    Func checkLevel3() ;Scan which level it is
       if IsArray($player) = True Then
    	  ;Move cursor to player
    	  MouseMove($player[0],$player[1])
    	  Sleep(Random(250,500))
    
    	  ;Search 1
    	  $Search1 = PixelSearch($player[0],$player[1]+50,$player[0],$player[1]+50, $clearDirtColor, 2)
    	  MouseMove($Search1[0],$Search1[1])
    	  Sleep(Random(250,600))
    
    	  ;Search 2
    	  $Search2 = PixelSearch($player[0]+60,$player[1]+50,$player[0]+60,$player[1]+50, $rolingStoneColor, 30)
    	  MouseMove($Search2[0],$Search2[1])
    	  Sleep(Random(300,700))
    
    	  ;Search 3
    	  $Search3 = PixelSearch($player[0]+60,$player[1],$player[0]+60,$player[1], $clearDirtColor, 3)
    	  MouseMove($Search3[0],$Search3[1])
    	  Sleep(Random(300,700))
    
    	  ;Search 4
    	  $Search4 = PixelSearch($player[0]-30,$player[1],$player[0]-30,$player[1], $backgroundColor, 3)
    	  MouseMove($Search4[0],$Search4[1])
    	  ;Sleep(Random(300,700))
    
    	  ;Checks if all color matches
    	  if $Search1 = true And $Search2 = true And $Search3 = true And $Search4= true Then
    		 ;Clearing level3
    		 Send("{DOWN}")
    		 EndIf
       EndIf
    EndFunc
    
    ;Check player position
    $player= PixelSearch(190,182,1813,984,0x11c1A1)
    checkLevel3() ; Runs function for level 3
    
    Func myExit()
       Exit
    EndFunc
    Thanks for taking your time reading this.

    Autoit Question - If specific pixels found move
  2. #2
    Seminko's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2010
    Posts
    507
    Thanks G/R
    35/89
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey mate, Pixelsearch returns an array, which I think you know since:
    MouseMove($Search1[0],$Search1[1])

    So this won't work:
    if $Search1 = true And $Search2 = true And $Search3 = true And $Search4= true Then

    Try this:
    If IsArray($Search1) = True
    Don't just say thanks, click thanks!

Similar Threads

  1. [question] Chracter blp pixel size
    By houseplant2 in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 10-05-2009, 01:30 PM
  2. [Question] Tauren male > X always moving slowmotion?
    By roskamaster in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 03-23-2008, 07:09 PM
  3. ACTool OR AutoIT -Question-
    By DJRehab in forum World of Warcraft General
    Replies: 1
    Last Post: 09-30-2007, 12:56 PM
  4. [Question] Area specific models?
    By Charonis in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 07-31-2007, 11:11 AM
  5. autoIT question
    By Vel0city in forum World of Warcraft General
    Replies: 3
    Last Post: 06-18-2006, 02:54 PM
All times are GMT -5. The time now is 02:37 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search