Script Causing Freeze
9 posts
• Page 1 of 1
Script Causing Freeze
Heya all!
I recently made a script to automate raid hosting in Pokemon SwSh, and largely it works great, but after around 90 minutes of running, it completely locks up the Titan Two. GTuner shows the device as still sending inputs but none of them are reaching the console, nor any manual inputs. For it to work again, it needs to be unplugged and replugged in. It's worth saying it doesn't need to be power cycled though, since it's using an external power supply.
I've made repetitive scripts like this before for automated breeding in the game, and had no issues leaving that for 7+ hours, so I'm really not sure what the issue is.
Main looks like this, with it just picking between the two combos as needed.
It's also worth noting that when it does fail, it does so at the end of a combo finishing, not at any random point. I'm just at a loss at this point, any input would be great.
Edit:
It doesn't stop at the end of a combo, it freezes at a 15 second wait at the start of the HostRaid combo. Is there an issue with longer waits or something?
I recently made a script to automate raid hosting in Pokemon SwSh, and largely it works great, but after around 90 minutes of running, it completely locks up the Titan Two. GTuner shows the device as still sending inputs but none of them are reaching the console, nor any manual inputs. For it to work again, it needs to be unplugged and replugged in. It's worth saying it doesn't need to be power cycled though, since it's using an external power supply.
I've made repetitive scripts like this before for automated breeding in the game, and had no issues leaving that for 7+ hours, so I'm really not sure what the issue is.
Main looks like this, with it just picking between the two combos as needed.
- Code: Select all
main
{
if (comboFinished)
{
comboFinished = FALSE;
if (raidCount < 2) combo_run(HostRaid);
else combo_run(AddFriends);
}
}
It's also worth noting that when it does fail, it does so at the end of a combo finishing, not at any random point. I'm just at a loss at this point, any input would be great.
Edit:
It doesn't stop at the end of a combo, it freezes at a 15 second wait at the start of the HostRaid combo. Is there an issue with longer waits or something?
-
Scarlet - Staff Sergeant
- Posts: 10
- Joined: Fri Dec 27, 2019 3:13 pm
Re: Script Causing Freeze
Please post the full script. It is hard to get an idea without seeing the whole thing.
-
Scachi - Brigadier General
- Posts: 3044
- Joined: Wed May 11, 2016 6:25 am
- Location: Germany
Re: Script Causing Freeze
Scachi wrote:Please post the full script. It is hard to get an idea without seeing the whole thing.
Ah you're right! Sorry! It's here: https://pastebin.com/6KeAvEHz
-
Scarlet - Staff Sergeant
- Posts: 10
- Joined: Fri Dec 27, 2019 3:13 pm
Re: Script Causing Freeze
The issue isn't your script.
Restarting the game is causing the disconnects / lock ups.
No solution for this at the moment unfortunately.
- Code: Select all
// Quit out of raid
set_val(BUTTON_HOME, 100);
wait(PRESS_TIME);
set_val(BUTTON_A, 0);
wait(1000);
set_val(BUTTON_X, 100);
wait(500);
set_val(BUTTON_A, 100);
wait(PRESS_TIME);
set_val(BUTTON_A, 0);
wait(4500);
Restarting the game is causing the disconnects / lock ups.
No solution for this at the moment unfortunately.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: Script Causing Freeze
Mad wrote:The issue isn't your script.
- Code: Select all
// Quit out of raid
set_val(BUTTON_HOME, 100);
wait(PRESS_TIME);
set_val(BUTTON_A, 0);
wait(1000);
set_val(BUTTON_X, 100);
wait(500);
set_val(BUTTON_A, 100);
wait(PRESS_TIME);
set_val(BUTTON_A, 0);
wait(4500);
Restarting the game is causing the disconnects / lock ups.
No solution for this at the moment unfortunately.
Dang, thanks for letting me know! I think I can work around that by just going into Settings and turning off WiFi instead of closing the game.
-
Scarlet - Staff Sergeant
- Posts: 10
- Joined: Fri Dec 27, 2019 3:13 pm
Re: Script Causing Freeze
Was talking with Buffy about this on Discord and was told to give the thread a bump.
Having messed with it a little more, every Switch game I've tried locks up, as well as Wind Waker HD on the Wii U (though I can't test any other games on Wii U atm). It only appears to happen with wired connections on the Switch. I made a quick script to open and close a game on loop, and it ended up locking up after maybe ten loops when wired. BT is a little weird in that it seems to skip inputs occasionally on restarting the game, but carries on. You can see it in this video here where one restart cycle is twice as long as the others: https://youtu.be/h6-pSjlUby0
If there's any extra info wanted, just ask and I can get it.
Having messed with it a little more, every Switch game I've tried locks up, as well as Wind Waker HD on the Wii U (though I can't test any other games on Wii U atm). It only appears to happen with wired connections on the Switch. I made a quick script to open and close a game on loop, and it ended up locking up after maybe ten loops when wired. BT is a little weird in that it seems to skip inputs occasionally on restarting the game, but carries on. You can see it in this video here where one restart cycle is twice as long as the others: https://youtu.be/h6-pSjlUby0
If there's any extra info wanted, just ask and I can get it.
-
Scarlet - Staff Sergeant
- Posts: 10
- Joined: Fri Dec 27, 2019 3:13 pm
Re: Script Causing Freeze
Based in your first message it seems it is not the Titan Two that is freezing, but the console -for some reason- not accepting the inputs from the Titan Two.
First, please be sure to have the Titan Two updated with the latest firmware release (currently 1.7.3.0).
Second, if you are playing on Nintendo Switch, check if you have the device's output polling rate set to "Protocol's Default".
First, please be sure to have the Titan Two updated with the latest firmware release (currently 1.7.3.0).
Second, if you are playing on Nintendo Switch, check if you have the device's output polling rate set to "Protocol's Default".
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
Re: Script Causing Freeze
I believe after starting games the Switch requires some sort of re-authentication. I have ran into the same issue on my Switch (it does not always happen). Using
after starting the game seems to work, which further supports this argument.
- Code: Select all
port_disconnect();
wait(0);
wait(200);
port_connect(PORT_USB_C, PROTOCOL_SWITCH);
wait(0);
after starting the game seems to work, which further supports this argument.
-
Buffy - Lieutenant
- Posts: 422
- Joined: Wed Jul 20, 2016 5:23 am
Re: Script Causing Freeze
Thank you Buffy for the input. I personally never experienced this, will be testing. Does it happens only with some particular game?
ConsoleTuner Support Team
-
J2Kbr - General of the Army
- Posts: 20323
- Joined: Tue Mar 18, 2014 1:39 pm
9 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 125 guests