Hey there. I'd like to make my script search for the color black in a few specific spots and when it finds said black it can do something, in this case send a key.
For example, if it sees black at 182, 198 it can send the D key. If it sees black at 184, 991 it can press S.
Thanks so much!
Do Something When A Color Is Detected At a Certain Spot
Do Something When A Color Is Detected At a Certain Spot
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it
Oh also try and explain stuff well if I need it
Re: Do Something When A Color Is Detected At a Certain Spot
absolute barebones
Code: Select all
PixelGetColor color, 182, 198, RGB
if (color = 0x000000)
Send d
Re: Do Something When A Color Is Detected At a Certain Spot
so uh how do i know what shade it is? it doesnt seem to be that shade, or im doing something wrong?swagfag wrote: ↑03 Jan 2019, 08:56absolute barebonesCode: Select all
PixelGetColor color, 182, 198, RGB if (color = 0x000000) Send d
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it
Oh also try and explain stuff well if I need it
Re: Do Something When A Color Is Detected At a Certain Spot
the variable color contains the hex rgb representation of the found color at the coordinates you supplied to the command. unless u meant something else by "shade"
Re: Do Something When A Color Is Detected At a Certain Spot
yes i mean color. how do i find what color/hex it is?
I'm pretty new to this language and barely know what I'm doing. Please excuse any stupidity lol.
Oh also try and explain stuff well if I need it
Oh also try and explain stuff well if I need it
Re: Do Something When A Color Is Detected At a Certain Spot
by checking the contents of the variable color?
or if ure asking how to convert it into something human readable:
or if ure asking how to convert it into something human readable:
Code: Select all
color := 16711935
MsgBox % Format("0x{:X}", color)
Re: Do Something When A Color Is Detected At a Certain Spot
I saw from the other post that you're still with troubles so, you could do a simple test script to copy the color.
For example by pressing F1:
Is that what you mean?
For example by pressing F1:
Code: Select all
F1::
PixelGetColor color, 182, 198, RGB
Clipboard := color
return
Who is online
Users browsing this forum: Starker and 253 guests