Log in

View Full Version : R6 color trigger small delay



TAN9090
December 13th, 2017, 08:12 PM
SOOoooooooooooooo


i did .. or lets say i edit the codes and let it work in R6 for operator Glaz cuz when he scope the enemies will turn to yellow but sometime its dark and because of the map and the yellow object and walls
idk how ill make it perfect and fast to detect so first i edit the code but there was a problem in the mouse clicking maybe windows 10 problem



void CheckColour(COLORREF pixel, int x, int y)
{
if(ColourMatch(pixel))
{

mouse_event(MOUSEEVENTF_LEFTDOWN,x, y,0,0);
mouse_event(MOUSEEVENTF_LEFTUP,x, y,0,0);



}
}

and the result is this




https://www.youtube.com/watch?v=xLNLarQj6R0


i tried in GTA v and the same problem after that i changed the code to this function



void LeftClick()
{ INPUT Input={0}; // Create our input.
Input.type = INPUT_MOUSE; // Let input know we are using the mouse.
Input.mi.dwFlags = MOUSEEVENTF_LEFTDOWN;// We are setting left mouse button down.
SendInput( 1, &Input, sizeof(INPUT) ); // Send the input.
ZeroMemory(&Input,sizeof(INPUT)); // Fills a block of memory with zeros.
Input.type = INPUT_MOUSE; // Let input know we are using the mouse.
Input.mi.dwFlags = MOUSEEVENTF_LEFTUP; // We are setting left mouse button up.
SendInput( 1, &Input, sizeof(INPUT) ); // Send the input. }

and the result is good but not perfect ..



https://www.youtube.com/watch?v=m7pyoBuVWnY



if anyone know something to make it better ? :)

its clicking by its self btw i didn't click left mouse in the video


bool ColourMatch(COLORREF pixel)
{
int r = GetRValue(pixel);
int g = GetGValue(pixel);
int b = GetBValue(pixel);
//std::cout << r << ", " << g << ", " << b << std::endl;
//RED
if(ChosenColour == "1")
{
if((r > 185 && r < 206) && (g > 150 && g < 220) && (b > 80 && b < 150))
{
return true;
}
}
//GREEN
else if(ChosenColour == "2")
{
if(r > 150 && g > 150 && b > 150)
{
return true;
}
}
//BLUE
if(ChosenColour == "3")
{
if(r < 40 && g < 40 && b > 50)
{
return true;
}
}
return false;
}



and can someone tell me how and where to put a function like if u hold Alt the trigger will work

0x33c
December 13th, 2017, 10:17 PM
Idk why this thread is on x22 because x22 dont support r6s but for your first vid/problem, in the most fps your mousecoursor is invisible + the cursor is centered on screen, now if you move your mouse it will go to the direction but swap back rly quick, if you set the mouse down event on x + y where the enemy is (at the center of the screen)your programm want to swap this way but getting swaped in the middle agan befor it reaches x and y this is why you look down.

This is rly quick overlook, atm. For your second prob, maybe screen capture need to long to check each frame, lower the area 10x10px on screen center(exclude 4x4px reddot scope in center) will be faster to react as you scan the hole screen (just if i understand your color pixel trigger code)

Anyway i am sleeping

TAN9090
December 13th, 2017, 10:32 PM
Idk why this thread is on x22 because x22 dont support r6s but for your first vid/problem, in the most fps your mousecoursor is invisible + the cursor is centered on screen, now if you move your mouse it will go to the direction but swap back rly quick, if you set the mouse down event on x + y where the enemy is (at the center of the screen)your programm want to swap this way but getting swaped in the middle agan befor it reaches x and y this is why you look down.

This is rly quick overlook, atm. For your second prob, maybe screen capture need to long to check each frame, lower the area 10x10px on screen center(exclude 4x4px reddot scope in center) will be faster to react as you scan the hole screen (just if i understand your color pixel trigger code)

Anyway i am sleeping

u mean this ?


int startingX = rcClientPositioning.right-((rcClientPositioning.right-rcClientPositioning.left)/2);
int startingY = rcClientPositioning.bottom-((rcClientPositioning.bottom-rcClientPositioning.top)/2);



void ScanThread(ScanContents * scan)
{
// MessageBox(NULL, NULL, NULL, NULL);
int debugRuntime = clock();
while(true)
{
//scan up and down the screen
for(int y = scan->StartY+scan->DeductY; y < scan->StartY+scan->CompareY; y+=3)
{
//scan accross the screen
for(int x = scan->StartX+scan->DeductX; x < scan->StartX+scan->CompareX; x+=3)
{
//Sleep(100);
//SetCursorPos(x, y);
CheckColour(GetPixel(scan->Hdc, x, y), x, y);
}
}

}
_endthread();
}


thanks for replying and good night x)