Input, Mappings & Controls

3.3.Pixel Tools #

This section only applies to REPL4Y, this functionality is not available in REM4P.

 

To get started using the pixel scan feature of REPL4Y open up the Pixel Tool found under the controls ‘Scripts’ section after connecting to your console.

 

 

Then, click ‘Capture Image’ to capture a screenshot of the stream when the object required is visible, in this case, the enemy health bar.

 

 

 

 

You can then click the ‘Select Pixel’ button then click anywhere on the image to select a pixel, here we select the health bar

 

NOTE: You can zoom in and out using the mouse scroll wheel.

 

The script code will then update for the selected pixel, you can use this code in the script editor to find the selected pixel.

 

 

NOTE: Pixel offsets start at the top left, changing your stream resolution will change the location of the pixel or scan area!

 

If you want to search an area of the screen instead of just a single pixel you can then use ‘Select Search Area’. This will allow you to highlight an area of the screen to scan for the selected pixel.

 

Click once to begin drawing an area and click again to finish.

 

 

 

The script code will update to use the ‘FindPixelArea’ function instead of the ‘FindPixel’ function. You can copy paste this code into the script editor to use it.

 

Below is a complete example of auto aim for Destiny 2 using the heath bar as a reference and a description of the available pixel functions.

 

Functions:

// Updates the current frame, depending on your stream framerate this will only return a different frame at either 33.3ms at 30fps and 16.6ms at 60fps. 
void CaptureFrame();

// Searches for the rgb colour provided at pixel offset, variation is how close the rgb match must be eg. (red +- variation)
// Returns true if pixel found, else false
bool FindPixel(int pixelXOffset, int pixelYoffset, int red, int green, int blue, int variation)

// Searches for the rgb colour provided within the given area, variation is how close the rgb match must be eg. (red +- variation)
// Scans from the top left of area to the bottom right
// Returns PixelOffset structure which contains the following variables:
//    PixelOffset {
//        int x;
//        int y;
//        bool found;
//    };
PixelOffset FindPixelArea(int startx, int starty, int endx, int endy, int red, int green, int blue, int variation)

// Same as FindPixelArea but searches the area in reverse so pixels to the bottom right of area will be found before the top left
PixelOffset FindLastPixelArea(int startx, int starty, int endx, int endy, int red, int green, int blue, int variation)

// Attempts to move the right stick in order to make in game character look at an object. 
// from x/y is your cursor offset on screen, to x/y is the offset you wish to look at
// minAxis should be the axis deadzone
// sensitivity is the amount of force applied per pixel.
void LookAt(int fromX, int fromY, int toX, int toY, int minAxis, float sensitivity)

 

 

Script Example:

global screenCentreX = 640;
global screenCentreY = 415;

def onInit()
{
    
}

def onTriggered()
{
    while(HotkeyActive())
    {
        // At 60 fps 16.66ms is as often as we'll get a new frame, round up a bit due to frame pacing
        Sleep(20); 
        
        // Update the frame data
        CaptureFrame(); 
        
        // Look for the start of health bar
        var healthStart = FindPixelArea(536, 328, 732, 496, 204, 86, 83, 10);
        if(healthStart.found) 
        {
            // Look for the end of health bar
            var healthend = FindLastPixelArea(healthStart.x, healthStart.y, healthStart.x + 200, healthStart.y + 20, 204, 86, 83, 10);
            if(healthend.found && healthend.x - healthStart.x > 30) //Ignore false positives where start and end too close together
            {
                // Calculate centre of bar
                var xOffset = (healthStart.x + healthend.x) / 2;
                // Target just below bar
                var yOffset = healthStart.y + 25;

                LookAt(screenCentreX, screenCentreY, xOffset, yOffset, 28, 0.3f);
                continue;
            }
        }
        
        RemoveAxisForce(RIGHTSTICKX);
        RemoveAxisForce(RIGHTSTICKY);
        Send();
    }
    
    //Remove any left over force
    RemoveAxisForce(RIGHTSTICKX);
    RemoveAxisForce(RIGHTSTICKY);
    Send();
}

def onExit()
{
    
}

 

Help Guide Powered by Documentor
Suggest Edit