MSC - Mouse Init Value

This script is part of Mouse Sensitivity Calculator. This script helps to determine the initial (minimum) value of mouse movement for controllers like FragFX. The initial value for the Controller Emu plugin is 20.
Versionv1.00
AuthorAdmin
Publish DateFri, 2 Sep 2011 - 22:25
Last UpdateFri, 2 Sep 2011 - 22:25
Downloads213
RATE


1

0

Code: Select all
/* *
*   MOUSE INIT VALUE - Mouse Sensitivity Calculator
*
*   This script helps to determine the initial (minimum) value
* of mouse movement for controllers like FragFX. The initial
* value for the Controller Emu plugin is 20.
*
*    How to use this script:
*        1) Plug the controller on GPP device
*        2) Build and Run this script
*        3) Open the GPP Monitor
*        4) Keep moving the mouse slightly until the values
*          of RX and RY (see defines) in the output panel
*          stop decreasing.
*        5) The lowest value between the RX and RY is what
*           should be used in the Mouse Sensitivity Calculator.
*
*    If you need to restart the test press the button which is
* defined by RST_BUTTON.
* *********************************************************** */

 
// Adjust the defines to match  //   PS3  | XBOX 360
// the system in use.           // -----------------
define RX = PS3_RX;             // PS3_RX | XB360_RX
define RY = PS3_RY;             // PS3_RY | XB360_RY
define AIM = PS3_L1;            // PS3_L1 | XB360_LB
define RST_BUTTON = PS3_R3;     // PS3_R3 | XB360_RS
                                // -----------------
 
int abs_mx, abs_my;
int initval_mx = 100;
int initval_my = 100;
 
main {
    // Reset variables
    if(event_press(RST_BUTTON)) {
        initval_mx = 100;
        initval_my = 100;
    }
 
    // Read input
    abs_mx = abs(get_val(RX));
    if(abs_mx > 0 && abs_mx < initval_mx) {
        initval_mx = abs_mx;
    }
 
    abs_my = abs(get_val(RY));
    if(abs_my > 0 && abs_my < initval_my) {
        initval_my = abs_my;
    }
 
    // Set output
    set_val(AIM, 100);
    set_val(RX, initval_mx);
    set_val(RY, initval_my);
}