[AutoIt] Help with some pixelsearch reverse menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    Gissel's Avatar Member
    Reputation
    11
    Join Date
    May 2007
    Posts
    42
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [AutoIt] Help with some pixelsearch reverse

    Hello out there on the forums, im new at this AutoIt so im here for some help

    i was reading up on a tutorial trying to make a script for Bejeweled.
    But as soon as it try to scan from Cornor 1 to Cornor 4, it never find the specified color in that cornor, instead it just keep on searching.

    Hope you understand what im trying to explain, and can help me get past this.


    Cornor 1
    _log("Searching top left position of playfield")
    ToolTip('Searching top left position pixel with color '& hex($CornerColor1,6),0,0)

    $Corner1
    = pixelSearch(0,0,@DesktopWidth,@DesktopHeight, $CornerColor1,0)
    If @error Then
    msgbox(0,"","Top Left pixel with color: "& hex($CornerColor1,6)&" not found ")
    exit
    Else
    MouseMove($corner1[0],$corner1[1])
    endif

    Cornor 4
    _log("Searching bottom right position of playfield")
    ToolTip('Searching bottom right position pixel with color '& hex($CornerColor4,6),0,0)

    $Corner4 = _pixelSearchReverse(0,0,@DesktopWidth,@DesktopHeight, $CornerColor4)
    If @error Then
    msgbox(0,"","Bottom Right pixel with color: "& hex($CornerColor4,6)&" not found ")
    exit
    Else
    MouseMove($corner4[0],$corner4[1])
    endif

    PixelSearchReverse
    Func _pixelSearchReverse($left,$top,$right,$bottom,$color)
    $coordFoundColor=_ArrayCreate("-1","-1")
    $i = 0
    $j = 0

    for
    $i = @DesktopWidth to 0 Step-1
    for $j = @DesktopHeight to 0 Step-1

    $currentcolor = PixelGetColor($i,$j)
    if $currentcolor = $color then
    $coordFoundColor[0]=$i
    $coordFoundColor[1]=$j
    return$coordFoundColor
    endif

    next
    next
    SetError (-1)
    endFunc
    Last edited by Gissel; 11-20-2012 at 09:58 AM.

    [AutoIt] Help with some pixelsearch reverse
  2. #2
    abuckau907's Avatar Active Member
    Reputation
    49
    Join Date
    May 2009
    Posts
    225
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how did you define CornerColor1 and cc4? Maybe it's in the wrong format? Just looking at it, PixelSearch expects it to be in 0xrrggbb.

    For testing --> Make a new function, which tells you the color under the mouse, and make sure it gives good output. ie. put your mouse over a black region and see what value is returned, then try for a white region, the red, then blue etc. ? (maybe don't check right at the cursor position, because it might capture the the color of your cursor icon - so do GetPixelColor(MouseX,MouseY - 5) and tell us what results you find)


    Code:
    Function DoSomeTesting
    $cursPos = MouseGetPos()
    $curColor = GetPixelColor($curPos[0], $curPos[1] - 5)
    msgbox("Color under mouse is: " & $curColor)
    EndFunction
    
    //I didn't look up syntax for msgbox function. it's just example.
    edit: What's the bigger picture? Do you plan to only make small programs for small games? If so, auto-it is perfect. But if you want to be programmer, auto-it is bad.Free C# and Visual Studios from microsoftdotcom may* be better tool than auto-it.
    Last edited by abuckau907; 11-26-2012 at 06:19 PM.

Similar Threads

  1. Help with some warnings
    By j0nniDEP in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 04-16-2009, 09:06 PM
  2. need help with some stuff plz =p
    By darkriderking in forum World of Warcraft General
    Replies: 1
    Last Post: 12-09-2008, 03:22 AM
  3. Need help with some stuff
    By jordy in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 06-14-2008, 04:17 AM
  4. Help with some stuff plz
    By Minichili in forum World of Warcraft Emulator Servers
    Replies: 20
    Last Post: 04-03-2008, 12:56 PM
All times are GMT -5. The time now is 02:55 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