1

Тема: Блокировка мышки в одной точке

Здравствуйте. Есть скрипт и необходимо его немного доработать. Расскажу что делает скрипт: При зажатии определенной кнопки(в данном случае ПКМ) скрипт считывает пиксели в центре экрана и запоминает цвета этих пикселей, если цвета меняются, то происходит нажатие ЛКМ. Тобишь это обыкновенный триггербот. Что я хочу: Чтоб при нажатии ПКМ я не мог шевелить мышкой пока зажата ПКМ и происходили действия описанные выше.
Если кто-то в этом разбирается прошу помощи. Заранее благодарен.

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)
}
}
}

2

Re: Блокировка мышки в одной точке

Используйте при зажатии:

BlockInput, MouseMove 

при отпускании:

BlockInput, MouseMoveOff
По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

3

Re: Блокировка мышки в одной точке

Я не особо разбираюсь в скриптах. Не могли бы вы мне помочь вставить ваш код в мой скрипт?serzh82saratov

4

Re: Блокировка мышки в одной точке

Как то так наверное.


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
	{
		BlockInput, MouseMoveOff
		sleep 50
		MouseGetPos, oneX, oneY
		PixelGetColor, colorone, oneX+RGBset, oneY+RGBset
		SplitRGBColor(colorone, oneRed, oneGreen, oneBlue)
	}
	 
	if GetKeyState("RButton") && trigger==true
	{
		BlockInput, MouseMove 
		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)
		}
	}
}
По вопросам возмездной помощи пишите на E-Mail: serzh82saratov@mail.ru Telegram: https://t.me/sergiol982
Win10x64 AhkSpy, Hotkey, ClockGui

5

Re: Блокировка мышки в одной точке

serzh82saratov
Работает на рабочем столе, но не работает в игре. Не подскажете в чем может быть причина?