i need your help for pixel search

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
sungurreis
Posts: 22
Joined: 02 May 2021, 15:20

i need your help for pixel search

04 May 2021, 07:17

hello hi this is my project pixel search scenario. What I want to fix is ​​that I want to use a different pixel in the same coordinate as a verification to make sure I find the correct pixel. example red When I search the code goes to different places sometimes I don't want that, so I need to look for another verifier pixel, I want it to follow the red color when it sees the red and purple color. I just want it to keep searching when it sees red color. can you fix my code
1)

Code: Select all

#NoEnv
#SingleInstance, Force
#Persistent
#InstallKeybdHook
#UseHook
#KeyHistory, 0
#HotKeyInterval 1
#MaxHotkeysPerInterval 127
version = badeverything v0.02


V::

Pause

Suspend

return


k:: Hotkey, *~$LButton, Toggle


*~$LButton::

SetKeyDelay,-1, 1
SetControlDelay, -1
SetMouseDelay, -1
SetWinDelay,-1
SendMode, InputThenPlay
SetBatchLines,-1
ListLines, Off
CoordMode, Pixel, Screen, RGB
CoordMode, Mouse, Screen
PID := DllCall("GetCurrentProcessId")
Process, Priority, %PID%, High
 
EMCol := 0xF20101
ColVn := 10
AntiShakeX := (A_ScreenHeight // 160)
AntiShakeY := (A_ScreenHeight // 128)
ZeroX := (A_ScreenWidth // 2) ;dont touch?
ZeroY := (A_ScreenHeight // 2) 
CFovX := (A_ScreenWidth // 40)  ;configure for FOV up = smaller lower= bigger current boxes right fov
CFovY := (A_ScreenHeight // 64)
ScanL := ZeroX - CFovX
ScanT := ZeroY
ScanR := ZeroX + CFovX
ScanB := ZeroY + CFovY
NearAimScanL := ZeroX - AntiShakeX
NearAimScanT := ZeroY - AntiShakeY
NearAimScanR := ZeroX + AntiShakeX
NearAimScanB := ZeroY + AntiShakeY

Loop, {
	KeyWait, LButton, D
	PixelSearch, AimPixelX, AimPixelY, NearAimScanL, NearAimScanT, NearAimScanR, NearAimScanB, EMCol, ColVn, Fast RGB
	if (!ErrorLevel=0) {
		loop, 10 {
			PixelSearch, AimPixelX, AimPixelY, ScanL, ScanT, ScanR, ScanB, EMCol, ColVn, Fast RGB
			AimX := AimPixelX - ZeroX
			AimY := AimPixelY - ZeroY
			DirX := -1
			DirY := -1
			If ( AimX > 0 ) {
				DirX := 1
			}
			If ( AimY > 0 ) {
				DirY := 1
			}
			AimOffsetX := AimX * DirX
			AimOffsetY := AimY * DirY
			MoveX := Floor(( AimOffsetX ** ( 1 / 2 ))) * DirX
			MoveY := Floor(( AimOffsetY ** ( 1 / 2 ))) * DirY
			DllCall("mouse_event", uint, 1, int, MoveX * 1.9, int, MoveY, uint, 0, int, 0) ;turing mouse to color were it says * is the speed of the aimbot turn up for unhuman reactions lower for human
		}
	}
}

Pause:: u
return:
goto, init
2)
this code does what I want, but it tracks in different coordinates in the game.

Code: Select all

search := [[954, 557, 17, 15, 0xC3897C], [957, 559, 6, 5, 0x8D898C]] ; x, y, w, h, color for first & second search
Loop {
 KeyWait, RButton, D
 PixelSearch, x1, y1, search.1.1, search.1.2, search.1.1 + search.1.3 - 1, search.1.2 + search.1.4 - 1
  , search.1.5, 10, Fast RGB
 If ErrorLevel
  Continue
 PixelSearch, x2, y2, search.2.1, search.2.2, search.2.1 + search.2.3 - 1, search.2.2 + search.2.4 - 1
  , search.2.5, 10, Fast RGB
  MouseMove, x1, y1
} Until !ErrorLevel
MouseMove, x1, y1

Is there anyone who can add this code to the number one code? I do not know about ahk, if anyone can help, I would be grateful :)
Last edited by SKAN on 04 May 2021, 08:35, edited 1 time in total.
Reason: Topic moved from Scripts and Functions

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot], wilkster and 289 guests