pixelgetcolor end move mouse this color

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

pixelgetcolor end move mouse this color

05 Jul 2018, 14:15

I need a script that would work like this

when it clicks the left mouse gets pixelgetcolor 320.240 x y and follow the mouse move after that pixelcolor

please help :)
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

Re: pixelgetcolor end move mouse this color

05 Jul 2018, 16:15

zliyr, please :)
I can do a simple script
but what I need is beyond my skills
I already read it 100x end two days I look google and I can not do it
User avatar
zliyr
Posts: 36
Joined: 30 Jun 2018, 14:22
Contact:

Re: pixelgetcolor end move mouse this color

05 Jul 2018, 16:39

Simplified version of https://autohotkey.com/board/topic/1261 ... eft-click/

Code: Select all

#MaxThreadsPerHotkey, 2
CoordMode, Pixel, Screen
*~LButton::
	while GetKeyState("LButton", "P"){
		PixelSearch, colourx, coloury, 0, 0, 1920, 1080, 0x4242ff, 0, Fast RGB 
		IF ErrorLevel = 1 
						{
		sleep, 1000
					}
		IF ErrorLevel = 0 	
					{
		Click, %colourx%, %coloury% Left, 1					
		sleep, 1000
						}
							}
return
If that doesn't work then you are gonna need to try DllCall("mouse_event", uint, 1, int, 100, int, 0)
i'll do more tomorrow, very tired atm :yawn:

EDIT: you should use https://start.duckduckgo.com/ instead of google, it gives better results imo
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

Re: pixelgetcolor end move mouse this color

05 Jul 2018, 17:01

Unfortunately, nothing happens when I run this script
this is to find color pixel
I need pixelgetcolor and follow the cursor with it
User avatar
zliyr
Posts: 36
Joined: 30 Jun 2018, 14:22
Contact:

Re: pixelgetcolor end move mouse this color

05 Jul 2018, 17:19

Yeah as I said i'll try again tomorrow,
I think the solution you want is with DllCall("mouse_event", uint, 1, int, 100, int, 0)
exactly how it will work? no idea
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

Re: pixelgetcolor end move mouse this color

05 Jul 2018, 17:26

ok, I will be waiting for you :)
I only hope that you understand me
I need it first
left mouse click
take pixel color 320.240 x y
then the mouse cursor has to go with this pixel color
User avatar
zliyr
Posts: 36
Joined: 30 Jun 2018, 14:22
Contact:

Re: pixelgetcolor end move mouse this color

06 Jul 2018, 13:05

Yeah you need to search for the pixel color, click if its found
then calculate how where the mouse needs to move
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

Re: pixelgetcolor end move mouse this color

06 Jul 2018, 13:27

it can not be in code just search for color
because first click the mouse must detect this color
and only later mouse cursor has to follow him
adi
Posts: 15
Joined: 02 Jul 2018, 07:12

Re: pixelgetcolor end move mouse this color

06 Jul 2018, 13:31

see this script when we click the button gets pixelcolor all 120,000 colors




sens:=10
delz:=10
holdtiem:=400
crossset:=1
;color split
SplitRGBColor(RGBColor, ByRef Red, ByRef Green, ByRef Blue)
{
Red := RGBColor >> 16 & 0xFF
Green := RGBColor >> 8 & 0xFF
Blue := RGBColor & 0xFF
}

SplitBGRColor(BGRColor, ByRef Red, ByRef Green, ByRef Blue)
{
Red := BGRColor & 0xFF
Green := BGRColor >> 8 & 0xFF
Blue := BGRColor >> 16 & 0xFF
}

;Menu loop
loop
{
GetKeyState, state, F10
if state = D
{
SoundPlay, %A_ScriptDir%\8.mp3
sleep 2000
ExitApp
}

GetKeyState, state, F11
if state = D
{
trigger:=false
}

GetKeyState, state, Insert
if state = D
{
trigger:=true
}

;Beta trigger
if !GetKeyState("XButton2") && trigger==true
{
sleep 50
MouseGetPos, oneX, oneY
PixelGetColor, colorone, oneX+crossset, oneY+crossset
SplitRGBColor(colorone, oneRed, oneGreen, oneBlue)
}

if GetKeyState("XButton2") && trigger==true
{
sleep 1
MouseGetPos, twoX, twoY
PixelGetColor, colortwo, twoX+crossset, twoY+crossset
SplitRGBColor(colortwo, twoRed, twoGreen, twoBlue)

if (((oneRed-sens)<=twoRed) && ((oneRed+sens)<=twoRed)) or (((oneRed-sens)>=twoRed) && ((oneRed+sens)>=twoRed)) or (((oneGreen-sens)<=twoGreen) && ((oneGreen+sens)<=twoGreen)) or (((oneGreen-sens)>=twoGreen) && ((oneGreen+sens)>=twoGreen)) or (((oneBlue-sens)<=twoBlue) && ((oneBlue+sens)<=twoBlue)) or (((oneBlue-sens)>=twoBlue) && ((oneBlue+sens)>=twoBlue))
{
sleep delz
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
sleep holdtiem
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
}
}
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 150 guests