Тема: Блокировка мышки в одной точке
Здравствуйте. Есть скрипт и необходимо его немного доработать. Расскажу что делает скрипт: При зажатии определенной кнопки(в данном случае ПКМ) скрипт считывает пиксели в центре экрана и запоминает цвета этих пикселей, если цвета меняются, то происходит нажатие ЛКМ. Тобишь это обыкновенный триггербот. Что я хочу: Чтоб при нажатии ПКМ я не мог шевелить мышкой пока зажата ПКМ и происходили действия описанные выше.
Если кто-то в этом разбирается прошу помощи. Заранее благодарен.
Sensitivity:=10
TriggerDelay:=0
TriggerHoldTime:=420
RGBset:=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, Home
if state = D
{
trigger:=true
}
;Beta trigger
if !GetKeyState("RButton") && trigger==true
{
sleep 50
MouseGetPos, oneX, oneY
PixelGetColor, colorone, oneX+RGBset, oneY+RGBset
SplitRGBColor(colorone, oneRed, oneGreen, oneBlue)
}
if GetKeyState("RButton") && trigger==true
{
sleep 1
MouseGetPos, twoX, twoY
PixelGetColor, colortwo, twoX+RGBset, twoY+RGBset
SplitRGBColor(colortwo, twoRed, twoGreen, twoBlue)
if (((oneRed-sensitivity)<=twoRed) && ((oneRed+sensitivity)<=twoRed)) or (((oneRed-sensitivity)>=twoRed) && ((oneRed+sensitivity)>=twoRed)) or (((oneGreen-sensitivity)<=twoGreen) && ((oneGreen+sensitivity)<=twoGreen)) or (((oneGreen-sensitivity)>=twoGreen) && ((oneGreen+sensitivity)>=twoGreen)) or (((oneBlue-sensitivity)<=twoBlue) && ((oneBlue+sensitivity)<=twoBlue)) or (((oneBlue-sensitivity)>=twoBlue) && ((oneBlue+sensitivity)>=twoBlue))
{
sleep TriggerDelay
DllCall("mouse_event", uint, 2, int, 0, int, 0, uint, 0, int, 0)
sleep TriggerHoldTime
DllCall("mouse_event", uint, 4, int, 0, int, 0, uint, 0, int, 0)
}
}
}