Trying to get left stick to move left and then right

GPC script programming for Titan One device. Code examples, how to, questions, requests.

Moderators: The_Rabid_Taco, pablosscripts, bonefisher, Baby Cham, Elvish

Trying to get left stick to move left and then right

Postby Rejectz » Fri May 17, 2019 2:56 pm

I was hoping someone could help please, all im trying to get is my left analog stick move left and then right when i press A and not stop until i press A again, but at the moment it's moving right and then forwards and activates as soon as i load the profile on the titan stick.. Any help would be appreciated

This is what ive got so far

Code: Select all
//
// Anti afk script
//----------------------------------------
 
main {
    if(get_ptime(XB1_A)) {
        combo_run(AntiAFK);
    }
}
 
combo AntiAFK {
    set_val(XB1_LY, 100);
    wait(100);
    set_val(XB1_LY, 0);
    wait(4000);
    set_val(XB1_LY, 0);
    wait (1000);
    set_val(XB1_LY, -100);
    wait(100);
    set_val(XB1_LY, -0);
    wait(4000);
    set_val(XB1_LY, -0);
    wait (1000);
}
 
Rejectz
Sergeant First Class
Sergeant First Class
 
Posts: 22
Joined: Fri Feb 20, 2015 10:17 am

Re: Trying to get left stick to move left and then right

Postby alanmcgregor » Fri May 17, 2019 4:18 pm

Try this:

Code: Select all
 
//
// Anti afk script
//----------------------------------------
 
int toggleAntiAFK = 0; //this flag will manage the AFK combo execution
 
main {
    if(event_press(XB1_A)) {
        toogleAntiAFK = !toogleAntiAFK; // this ON/OFF the flag
    }
 
    if(toogleAntiAFK){ // when flag is ON/TRUE run the combo
        combo_run(AntiAFK);
    }
    else
        if(combo_running(AntiAFK)){ //if flag is FALSE/OFF and the combo is running, stop it
            combo_stop(AntiAFK);
        }
}
 
combo AntiAFK {
    set_val(XB1_LY, 100);
    wait(100);
    set_val(XB1_LY, 0);
    wait(4000);
    set_val(XB1_LY, 0);
    wait (1000);
    set_val(XB1_LY, -100);
    wait(100);
    set_val(XB1_LY, -0);
    wait(4000);
    set_val(XB1_LY, -0);
    wait (1000);
}
 
Image
User avatar
alanmcgregor
Major
Major
 
Posts: 1020
Joined: Tue Mar 27, 2018 8:38 am


Return to GPC Script Programming (Titan One)

Who is online

Users browsing this forum: No registered users and 5 guests