Help with making a script T2 xbox for how 2 survive 2

GPC2 script programming for Titan Two. Code examples, questions, requests.

Help with making a script T2 xbox for how 2 survive 2

Postby Mekolame » Mon Oct 17, 2022 3:45 am

Is it possible to make a script like this?

Button A
Pause 3
Button B
Pause 3
Move pointer down 1 sec
Pause 3
Button B
Pause 3
Button A
Pause 5 minutes
Loop

It is for afk leveling in How to Survive 2.

Thanks
User avatar
Mekolame
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Aug 19, 2015 7:32 am

Re: Help with making a script T2 xbox for how 2 survive 2

Postby Mad » Mon Oct 17, 2022 8:30 pm

Not sure what you meant by move pointer down, right stick you mean? that's what I've put.
Code: Select all
#include <xb1.gph>
uint32 timer;
 
init { combo_run(afk); }
 
main {
    if(!afk) {
        if(elapsed_time() && ++timer >= 300000) {
            timer = 0;
            combo_run(afk);
        }
    }
}
 
combo afk {
    printf("running combo"); wait(0);
    set_val(XB1_A, 100);
    wait(60); wait(3000);
    set_val(XB1_B, 100);
    wait(60); wait(3000);
    set_val(XB1_RX, 100);
    wait(1000); wait(3000);
    set_val(XB1_B, 100);
    wait(60); wait(3000);
    set_val(XB1_A, 100);
    wait(60); wait(3000);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Help with making a script T2 xbox for how 2 survive 2

Postby Mekolame » Mon Oct 17, 2022 8:38 pm

Sweet, can't wait to try it. The cursor is moved by the left stick when you are in this task though. Sorry for not being accurate. I really really appreciate the help. Thank
User avatar
Mekolame
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Aug 19, 2015 7:32 am

Re: Help with making a script T2 xbox for how 2 survive 2

Postby Mekolame » Mon Oct 17, 2022 11:01 pm

I have to work on the timing, but seems to work. It moves the cursor to the right not down, I assume I need to change it to RY axis?

Also can you put an turn on/off switch to activate it. Thanks again!
User avatar
Mekolame
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Aug 19, 2015 7:32 am

Re: Help with making a script T2 xbox for how 2 survive 2

Postby Mad » Tue Oct 18, 2022 2:41 am

Changed to left stick down. Left trigger + dpad down to toggle.
Code: Select all
#include <xb1.gph>
uint32 timer;
bool toggle;
main {
    if(is_active(XB1_LT) && event_active(XB1_DOWN)) {
        toggle = !toggle;
        if(toggle) combo_run(afk);
    }
    if(toggle && !afk) {
        if(elapsed_time() && ++timer >= 300000) {
            timer = 0;
            combo_run(afk);
        }
    }
}
 
combo afk {
    printf("running combo"); wait(0);
    set_val(XB1_A, 100);
    wait(60); wait(3000);
    set_val(XB1_B, 100);
    wait(60); wait(3000);
    set_val(XB1_LY, 100f);
    wait(1000); wait(3000);
    set_val(XB1_B, 100);
    wait(60); wait(3000);
    set_val(XB1_A, 100);
    wait(60); wait(3000);
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
Mad
Major General
Major General
 
Posts: 4536
Joined: Wed May 22, 2019 5:39 am

Re: Help with making a script T2 xbox for how 2 survive 2

Postby Mekolame » Tue Oct 18, 2022 8:37 pm

SWEET! Can't wait to try it! Thanks again. Should I post all the right timers for all 8 levels when I get it all tested out? For other users I mean.
Thanks again!
User avatar
Mekolame
Staff Sergeant
Staff Sergeant
 
Posts: 12
Joined: Wed Aug 19, 2015 7:32 am


Return to GPC2 Script Programming

Who is online

Users browsing this forum: midg3t2, тебяя and 182 guests