Sign in to follow this  
Followers 0
notakiller

Mouse Over Scan ?

9 posts in this topic

Is it possible to make like a "scan" with your mouse like all over the screen (so that i can use pixelcheksum ?)

thx again guys :)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

[center]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.[/center]

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
:)!!.. how do you know he didn't already have one :mellow:

[center]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.[/center]

Share this post


Link to post
Share on other sites

cuz im just good like that ok cant a man post b4 sum1 makes a completely new UDF to do such a simple task :) lol

Share this post


Link to post
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

Share this post


Link to post
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

[center]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.[/center]

Share this post


Link to post
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:

Share this post


Link to post
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
Sign in to follow this  
Followers 0