Help make this script loop for (x) amount of time, ASAP!

GPC1 script programming for Titan One. Code examples, questions, requests.

Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Wed Mar 24, 2021 11:30 pm

Hi guys, just need these alterations made to this script.

IN SHORT: Stop combo overlap. Pause Combo 1 whilst combo 2 is running.

After the part where it waits 25 seconds to tap X, how can I make it do that whilst stopping combo 1, then resuming combo 1 after it's tapped X?

Code: Select all
int SMASH = FALSE;
int SMASH1 = FALSE;
int wt=25000;
 
main {
    if(event_press(XB1_DOWN)) {
        SMASH = !SMASH;
        }
        if (SMASH) {
            combo_run(SMASH_X);
        }
 
        if(event_press(XB1_DOWN)) {
        SMASH1 = !SMASH1;
        }
        if (SMASH1) {
            combo_run(SMASH_Y);
        }
}
 
 
 
combo SMASH_X {
set_val(XB1_RT,100);
set_val(XB1_A, 100);
wait(110);
set_val(XB1_RT,100);
set_val(XB1_A, 0);
wait(110);
set_val(XB1_RT,100);
}
 
combo SMASH_Y {
wait (wt);
set_val(XB1_X,100)
wait(110);
}




Thanks guys!!
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Scachi » Thu Mar 25, 2021 5:15 am

according to this documentation the maximum time for wait is 4000.
no idea if using wait 25000 will work correctly.
https://www.consoletuner.com/kbase/comb ... s=AgAAAAE=
you can use multiple wait calls to get to 25000 in total.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Thu Mar 25, 2021 11:43 am

Scachi wrote:according to this documentation the maximum time for wait is 4000.
no idea if using wait 25000 will work correctly.
https://www.consoletuner.com/kbase/comb ... s=AgAAAAE=
you can use multiple wait calls to get to 25000 in total.


Yeah it does work. It's max is up to 32767. Found it on another script and it works fine! How come I've seen on here where the moderators are saying that you can only use 4000ms chunks?

Actually, I want to change it differently, I think I wrote what I needed incorrectly.

Can you adjust it so it repeats the first combo for 7 minutes, stops combo 1, then does combo 2 once (where it taps X), then goes back to combo 1? Then repeat. I just don't want them overlapping.


Code: Select all
int SMASH = FALSE;
int SMASH1 = FALSE;
 
 
main {
    if(event_press(XB1_DOWN)) {
        SMASH = !SMASH;
        }
        if (SMASH) {
            combo_run(SMASH_X);
        }
 
        if(event_press(XB1_DOWN)) {
        SMASH1 = !SMASH1;
        }
        if (SMASH1) {
            combo_run(SMASH_Y);
        }
}
 
 
 
combo SMASH_X {
set_val(XB1_RT,100);
set_val(XB1_A, 100);
wait(110);
set_val(XB1_RT,100);
set_val(XB1_A, 0);
wait(110);
set_val(XB1_RT,100);
}
 
combo SMASH_Y {
set_val(XB1_X,100)
wait(110);
}
 
 


Thanks!
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Scachi » Thu Mar 25, 2021 12:41 pm

Ctuna2000 wrote:
Scachi wrote:according to this documentation the maximum time for wait is 4000.
no idea if using wait 25000 will work correctly.
https://www.consoletuner.com/kbase/comb ... s=AgAAAAE=
you can use multiple wait calls to get to 25000 in total.


Yeah it does work. It's max is up to 32767. Found it on another script and it works fine! How come I've seen on here where the moderators are saying that you can only use 4000ms chunks?

I don'T have a T1 anymore. Using a T2 only. So I have to rely on the documentation.
The official documentation mentions 4000ms as the maximum working value.
Have you tested that 25000 really is working, really is waiting and not only 4000 ?
The compiler gives a warning message too:
WARNING line 21: value '8000' is out of range [10 ~ 4000]
Ctuna2000 wrote:Actually, I want to change it differently, I think I wrote what I needed incorrectly.

Can you adjust it so it repeats the first combo for 7 minutes, stops combo 1, then does combo 2 once (where it taps X), then goes back to combo 1? Then repeat. I just don't want them overlapping.
Thanks!

try this:
Code: Select all
int SMASH = FALSE;
 
int msecs, secs, mins, hours, days;
 
main {
    msecs = msecs + get_rtime();
    if(msecs >= 1000) {
        msecs = msecs - 1000;
        secs = secs + 1;
        if(secs >= 60) {
            secs = secs - 60;
            mins = mins + 1;
            if(mins >= 60) {
                mins = mins - 60;
                hours = hours + 1;
                if(hours >= 24) {
                    hours = hours - 24;
                    days = days + 1;
                }
            }
        }
    }
 
    if(event_press(XB1_DOWN)) {
        SMASH = !SMASH;
        msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
    }
 
    if (SMASH) {
        if (mins < 7) combo_run(SMASH_X);
        else {
            combo_stop(SMASH_X);
            combo_run(SMASH_Y);
        }
    }
 
}
 
 
combo SMASH_X {
set_val(XB1_RT,100);
set_val(XB1_A, 100);
wait(110);
set_val(XB1_RT,100);
set_val(XB1_A, 0);
wait(110);
set_val(XB1_RT,100);
}
 
combo SMASH_Y {
set_val(XB1_X,100)
wait(110);
msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
wait(0);
}
 
 
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Thu Mar 25, 2021 1:22 pm

Scachi wrote:
Ctuna2000 wrote:
Scachi wrote:according to this documentation the maximum time for wait is 4000.
no idea if using wait 25000 will work correctly.
https://www.consoletuner.com/kbase/comb ... s=AgAAAAE=
you can use multiple wait calls to get to 25000 in total.


Yeah it does work. It's max is up to 32767. Found it on another script and it works fine! How come I've seen on here where the moderators are saying that you can only use 4000ms chunks?

I don'T have a T1 anymore. Using a T2 only. So I have to rely on the documentation.
The official documentation mentions 4000ms as the maximum working value.
Have you tested that 25000 really is working, really is waiting and not only 4000 ?
The compiler gives a warning message too:
WARNING line 21: value '8000' is out of range [10 ~ 4000]
Ctuna2000 wrote:Actually, I want to change it differently, I think I wrote what I needed incorrectly.

Can you adjust it so it repeats the first combo for 7 minutes, stops combo 1, then does combo 2 once (where it taps X), then goes back to combo 1? Then repeat. I just don't want them overlapping.
Thanks!

try this:
Code: Select all
int SMASH = FALSE;
 
int msecs, secs, mins, hours, days;
 
main {
    msecs = msecs + get_rtime();
    if(msecs >= 1000) {
        msecs = msecs - 1000;
        secs = secs + 1;
        if(secs >= 60) {
            secs = secs - 60;
            mins = mins + 1;
            if(mins >= 60) {
                mins = mins - 60;
                hours = hours + 1;
                if(hours >= 24) {
                    hours = hours - 24;
                    days = days + 1;
                }
            }
        }
    }
 
    if(event_press(XB1_DOWN)) {
        SMASH = !SMASH;
        msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
    }
 
    if (SMASH) {
        if (mins < 7) combo_run(SMASH_X);
        else {
            combo_stop(SMASH_X);
            combo_run(SMASH_Y);
        }
    }
 
}
 
 
combo SMASH_X {
set_val(XB1_RT,100);
set_val(XB1_A, 100);
wait(110);
set_val(XB1_RT,100);
set_val(XB1_A, 0);
wait(110);
set_val(XB1_RT,100);
}
 
combo SMASH_Y {
set_val(XB1_X,100)
wait(110);
msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
wait(0);
}
 
 


Thank you!! I'll test it out and let you know how it goes!

Well, when I set the time as (wt) for 25000, and it works I guess. I can stack it several times aswell.
If I set it for higher than 32767 and it says "value out of range [-32768 ~ 32767]." So the max for that is around 32 seconds.

Whereas I set a conventional wait time for higher than 4000 and it said
"value '11000' is out of range [10 ~ 4000].

I'm not sure, what do you think? Since setting the time as "wt" (like in the script) works, I don't know what else to say haha.
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Mad » Thu Mar 25, 2021 9:33 pm

It was changed from 4000 to 32768. :smile0517:
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord (2K / FPS)
Mad
Major General
Major General
 
Posts: 4533
Joined: Wed May 22, 2019 5:39 am

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Scachi » Thu Mar 25, 2021 10:07 pm

Mad wrote:It was changed from 4000 to 32768. :smile0517:

The docs need an update then.
User avatar
Scachi
Brigadier General
Brigadier General
 
Posts: 3044
Joined: Wed May 11, 2016 6:25 am
Location: Germany

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Fri Mar 26, 2021 5:25 pm

Scachi wrote:
Mad wrote:It was changed from 4000 to 32768. :smile0517:

The docs need an update then.


In the last few lines for SMASH_Y. Why does it say "msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;"? The line underneath the msecs bit, "wait(0)" doesn't work anyways. It says it's meant to be between 10-4000. Was that a typo or were u trying to do something else?

Thanks!
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Fri Mar 26, 2021 6:42 pm

Scachi wrote:
Ctuna2000 wrote:
Scachi wrote:according to this documentation the maximum time for wait is 4000.
no idea if using wait 25000 will work correctly.
https://www.consoletuner.com/kbase/comb ... s=AgAAAAE=
you can use multiple wait calls to get to 25000 in total.


Yeah it does work. It's max is up to 32767. Found it on another script and it works fine! How come I've seen on here where the moderators are saying that you can only use 4000ms chunks?

I don'T have a T1 anymore. Using a T2 only. So I have to rely on the documentation.
The official documentation mentions 4000ms as the maximum working value.
Have you tested that 25000 really is working, really is waiting and not only 4000 ?
The compiler gives a warning message too:
WARNING line 21: value '8000' is out of range [10 ~ 4000]
Ctuna2000 wrote:Actually, I want to change it differently, I think I wrote what I needed incorrectly.

Can you adjust it so it repeats the first combo for 7 minutes, stops combo 1, then does combo 2 once (where it taps X), then goes back to combo 1? Then repeat. I just don't want them overlapping.
Thanks!

try this:
Code: Select all
int SMASH = FALSE;
 
int msecs, secs, mins, hours, days;
 
main {
    msecs = msecs + get_rtime();
    if(msecs >= 1000) {
        msecs = msecs - 1000;
        secs = secs + 1;
        if(secs >= 60) {
            secs = secs - 60;
            mins = mins + 1;
            if(mins >= 60) {
                mins = mins - 60;
                hours = hours + 1;
                if(hours >= 24) {
                    hours = hours - 24;
                    days = days + 1;
                }
            }
        }
    }
 
    if(event_press(XB1_DOWN)) {
        SMASH = !SMASH;
        msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
    }
 
    if (SMASH) {
        if (mins < 7) combo_run(SMASH_X);
        else {
            combo_stop(SMASH_X);
            combo_run(SMASH_Y);
        }
    }
 
}
 
 
combo SMASH_X {
set_val(XB1_RT,100);
set_val(XB1_A, 100);
wait(110);
set_val(XB1_RT,100);
set_val(XB1_A, 0);
wait(110);
set_val(XB1_RT,100);
}
 
combo SMASH_Y {
set_val(XB1_X,100)
wait(110);
msecs = 0; secs = 0; mins = 0; hours = 0; days = 0;
wait(0);
}
 
 


Alright, so I tried the script, after the time passes, it starts combo 2, but it just stays on combo 2? Can you change it so it goes back to combo 1 and repeats?

Thanks.
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Re: Help make this script loop for (x) amount of time, ASAP!

Postby Ctuna2000 » Fri Mar 26, 2021 7:34 pm

@mad @Scachi

Can someone help ASAP, thanks.
User avatar
Ctuna2000
Sergeant Major
Sergeant Major
 
Posts: 84
Joined: Tue Mar 09, 2021 10:09 pm

Next

Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 102 guests