GPC SCRIPT LIBRARY

AutoDrive - Driving in circles!

Some games require you to drive a long ways for a trophy, such as Rocket League's 500km. To help you with that long drive, this script will drive your car in circles!

To use, just start driving your car in a continuous loop, then press R3 to start "AutoDrive"! The script will save and keep using the current steering and throttle position. To disable or re-enable the script just press R3 again.

(Also works for any other racing game in which there is a need to drive in circles.)\
Version 1.0
Author CypherNova139
Published Date 2015-11-07 12:36:55
Latest Date 2015-11-07 12:37:55
Downloads 284
VOTE NOW

2

0
Contact Author
Scripts by Author
RELEASE NOTES
Initial release
Code:Select all
//Some games require you to drive a long ways for a trophy, such as Rocket League's 500km. 
//To help with that long drive, this script will drive your car in circles!
//To use, just start driving your car in a continuous loop, then press R3 to start "AutoDrive"! The script will save and keep using the current steering and throttle position.
//Also works for any other racing game in which there is a need to drive in circles.

//Controls:
//  R3: Enable/Disable AutoDrive Stick and throttle buttons.
// A short vibration confirms a successful enable, no vibration confirms a successful disable.
//  R3 + Holding steering(Stick X axis) and Throttle (R2): Press to set Stick and Throttle button values to use as the current values being pressed on the controller.
// A short then longer vibration confirms and enables the new set values.
//

//TRACE values:
//TRACE_1 : AutoDrive enabled/disabled
//TRACE_2 : Set value for Stick X axis (Steering)
//TRACE_3 : Set value for Throttle.

define deadzone_val = 20;

int enable, StickX, throttle, stickXset, throttleset, trigger;

init {

trigger = PS4_R3;
throttle = PS4_R2;
StickX = PS4_LX;
}



main {
      

    if(event_press(trigger)) {
        enable = !enable;
//set actual stick values being used, not just 100
        if(get_val(StickX) >- deadzone_val ^^ get_val(StickX) < deadzone_val) {
            if(get_val(throttle)) {
                enable = 1;
                stickXset = get_val(StickX);
                throttleset = get_val(throttle);
                combo_run(Rumble11);
            }
        }
        set_val(TRACE_2, stickXset);
        set_val(TRACE_3, throttleset);
        if(enable == 1) { combo_run(Rumble1);}
    }

    if(enable) {
        set_val(PS4_LX, stickXset);
        set_val(PS4_R2, throttleset);
    }

set_val(TRACE_1, enable) 
}


combo Rumble1 { 
    // 1 short rumble
    set_rumble(RUMBLE_B, 100);
    wait(200);
    set_rumble(RUMBLE_B, 0);
}

combo Rumble11 { 
    // 1 short rumble, 1 long rumble
    set_rumble(RUMBLE_B, 100);
    wait(200);
    set_rumble(RUMBLE_B, 0);
    wait(250);
    set_rumble(RUMBLE_B, 100);
    wait(400);
    set_rumble(RUMBLE_B, 0);
}

Pin It on Pinterest

Share This