Page 1 of 1

Trying to get left stick to move left and then right

PostPosted: Fri May 17, 2019 2:56 pm
by Rejectz
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);
}
 

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

PostPosted: Fri May 17, 2019 4:18 pm
by alanmcgregor
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);
}