Jump to content

Mouse Over Scan ?


Recommended Posts

u can just use pixelchecksum just define coordinates, it doesnt scan for a color under ur mouse unless ur like getting the coordinates of your mouse and like yeah....

$checksum = PixelChecksum(0,0, 50,50)

While $checksum = PixelChecksum(0,0, 50, 50)
  Sleep(100)
WEnd

MsgBox(0, "", "Something in the region has changed!")
Edited by thatsgreat2345
Link to comment
Share on other sites

  • Moderators

While 1
    Sleep(10)
    $Position_Color = _ColorUnderMouse()
    ToolTip('X-Coord = ' & $Position_Color[1] & @CRLF _ 
    & 'Y-Coord = ' & $Position_Color[2] & @CRLF _
    & 'Color = ' & $Position_Color[3])
WEnd

Func _ColorUnderMouse()
    $OptPixMode = Opt('PixelCoordMode', 2)
    $OptMouseMode = Opt('MouseCoordMode', 2)
    Local $Mpos = MouseGetPos()
    Local $PixColor = '0x' & Hex(PixelGetColor($Mpos[0], $Mpos[1]), 6)
    Local $InfoReturn[4]
    $InfoReturn[1] = $Mpos[0]
    $InfoReturn[2] = $Mpos[1]
    $InfoReturn[3] = $PixColor
    Opt('PixelCoordMode', $OptPixMode)
    Opt('MouseCoordMode', $OptMouseMode)
    Return $InfoReturn
EndFunc
Edit: Forgot to reset my Coord Modes

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

HA added a hotkeyset to quit what now mr

hotkeyset("{esc}", "quit")
While 1
    Sleep(10)
    $Position_Color = _ColorUnderMouse()
    ToolTip('X-Coord = ' & $Position_Color[1] & @CRLF _
    & 'Y-Coord = ' & $Position_Color[2] & @CRLF _
    & 'Color = ' & $Position_Color[3])
WEnd

Func _ColorUnderMouse()
    $OptPixMode = Opt('PixelCoordMode', 2)
    $OptMouseMode = Opt('MouseCoordMode', 2)
    Local $Mpos = MouseGetPos()
    Local $PixColor = '0x' & Hex(PixelGetColor($Mpos[0], $Mpos[1]), 6)
    Local $InfoReturn[4]
    $InfoReturn[1] = $Mpos[0]
    $InfoReturn[2] = $Mpos[1]
    $InfoReturn[3] = $PixColor
    Opt('PixelCoordMode', $OptPixMode)
    Opt('MouseCoordMode', $OptMouseMode)
    Return $InfoReturn
EndFunc

func quit()
    Exit
    endfunc
Link to comment
Share on other sites

  • Moderators
:)!!.. how do you know he didn't already have one :mellow:

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

while 1

$coord = PixelSearch( 0, 0, 744, 479, 0x8C6042 )

If Not @error Then

MouseMove($coord[0],$coord[1])

MouseDown("left")

MouseUp("left")

Sleep(500)

MouseMove($coord[0]+40,$coord[1]+30)

MouseDown("left")

MouseUp("left")

Sleep(11000)

EndIf

Wend

whats wrong with that :) it does scan ... but find a black spot ... then does the rest >< and is the coord well written :S it is :mellow: i dont get it ! ahhh so frustrating lmao thanks guys for the help

Link to comment
Share on other sites

  • Moderators

Make sure you have the right color using AutoInfo.exe (Start >> AutoIt v3 >> Auto Window Info) Or (SciTe >> Tools >> AU3Info) or (C:\Program Files\AutoIt3\AU3Info.exe (Replace C: to whatever your hard drive is).

Then look at this:

Opt('PixelCoordMode', 2); look in the help file, you may need to change the 2 to 0 or 1
Opt('MouseCoordMode', 2); same as above, you'll know by how how you used AutoInfo Tool to get the coords
While 1
    $coord = PixelSearch(0, 0, 744, 479, 0x8C6042)
    If Not @error Then
        MouseClick('left', $coord[0], $coord[1])
        Sleep(500)
        MouseClick('left', $coord[0]+40, $coord[1]+30)
        Sleep(11000)
    EndIf
    Sleep(10)
WEnd

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Make sure you have the right color using AutoInfo.exe (Start >> AutoIt v3 >> Auto Window Info) Or (SciTe >> Tools >> AU3Info) or (C:\Program Files\AutoIt3\AU3Info.exe (Replace C: to whatever your hard drive is).

Then look at this:

Opt('PixelCoordMode', 2); look in the help file, you may need to change the 2 to 0 or 1
Opt('MouseCoordMode', 2); same as above, you'll know by how how you used AutoInfo Tool to get the coords
While 1
    $coord = PixelSearch(0, 0, 744, 479, 0x8C6042)
    If Not @error Then
        MouseClick('left', $coord[0], $coord[1])
        Sleep(500)
        MouseClick('left', $coord[0]+40, $coord[1]+30)
        Sleep(11000)
    EndIf
    Sleep(10)
WEnd
:) i get it to work :) thx to u ... your like my God dude lmao *bows* thanks alot i really appreciate it :mellow:
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...