Jump to content

Anyone Know How To Do This?

Recommended Posts

anyone know how to make a program to get the cordinates of a pixel? i konw u can use the one with that comes with autoit but i need to get the cordinates of a pixel while im in game...so it doesn't work : / I need it for a bot im making so the cordinates must be percise. I wanted the program to just save the pixel cordinate of where the mouse is pointing to or produce a pop up of what that cordinate is when i press a hotkey. Anyone know any progs that do this or how i could make a script do this in auto it.

Thx :whistle:

Link to comment
Share on other sites

  • Administrators

You can use the MouseGetPos and PixelGetColor functions. You can use these to write a script that pauses for a while and then makes a note of where your mouse pointer currently is and gets the pixel colour in the background.

Here is a script that sleeps until you press the hotkey ctrl+alt+p - it then reads the pixel at the current mouse position and pops up a message box. If it doesn't do what you want it should at least get you pointed in the right direction:

; Setup our hotkey
HotKeySet("^!p", "GetPixel")

; Set up a low-CPU use infinite loop
While 1

Func GetPixel()
 ; Get the current mouse pointer co-ords
  $pos = MouseGetPos()

 ; Get the colour of the pixel currently under the pointer
  $col = PixelGetColor($pos[0], $pos[1])

 ; Show the messagebox (may have to quit the game to see it)
  MsgBox(4096, "Pixel under mouse was:", $col & " (0x" & Hex($col, 6) & ")" )
 ; Completely exit the script

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

  • Recently Browsing   0 members

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