hello this script makes that when we have the mouse 2 pressed and the color changes in the middle of the screen it will automatically launch the mouse button 1
I would like this script to run the mouse 1 only when the color in the middle of the screen changes color to red
Does anyone know how to change this code?
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)
}
}
}
script
- divanebaba
- Posts: 809
- Joined: 20 Dec 2016, 03:53
- Location: Diaspora
Re: script
Please use code-tags and post one or more issues in only one thread. Not the other way
Double-posting. gähn
Double-posting. gähn
Einfach nur ein toller Typ.
-
- Posts: 44
- Joined: 18 Aug 2016, 22:56
Re: script
also, a little more descriptive title would be good.