run in circles script
6 posts
• Page 1 of 1
run in circles script
I'm looking for a script to automatically run in circles for me to hatch pokemon eggs. I searched for awhile and found one that didn't work and another that waited long between circles. I tried to edit it myself but I had no idea what I was doing. If anyone could help that'd be cool.
-
KnightSpartan - Private First Class
- Posts: 3
- Joined: Mon Nov 25, 2019 4:42 am
Re: run in circles script
Post the one that worked and we can adjust the timing.
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: run in circles script
viewtopic.php?f=26&t=7449
This was it. I tried to make it constant by changing the wait times myself but it wasn't making perfect circles so it was wondering around.
This was it. I tried to make it constant by changing the wait times myself but it wasn't making perfect circles so it was wondering around.
-
KnightSpartan - Private First Class
- Posts: 3
- Joined: Mon Nov 25, 2019 4:42 am
Re: run in circles script
- Code: Select all
fix32 angle;
fix32 circle_size = 0.0040; // Lower the value for bigger circles
bool toggle;
main {
// Hold ZL and tap Dpad UP to toggle on/off
if(is_active(7) && event_active(9)) toggle=!toggle;
if(toggle) {
set_val(STICK_2_X, sin(angle) * 100.0);
set_val(STICK_2_Y, cos(angle) * 100.0);
angle += circle_size; if(angle >= 2.0 * PI) angle = 0.0;
}
}
ConsoleTuner Support Team || ConsoleTuner Discord || InputSense Discord
- Mad
- Major General
- Posts: 4536
- Joined: Wed May 22, 2019 5:39 am
Re: run in circles script
Awesome! Thanks for the help
-
KnightSpartan - Private First Class
- Posts: 3
- Joined: Mon Nov 25, 2019 4:42 am
Re: run in circles script
- Code: Select all
#define SPEED 100 // <- Increase value to decrease speed.
#define SIZE 100 // <- 100 max size.
main {
fix32 a, m;
bool x, y, toggle;
// Hold ZL and tap Dpad UP to toggle on/off
if(is_active(7) && event_active(9)) toggle=!toggle;
if(toggle) {
a += (fix32)elapsed_time();
set_val(STICK_2_X, clamp(cos((a/(fix32)SPEED)+m)*(fix32)SIZE, -100f, 100f));
set_val(STICK_2_Y, clamp(sin((a/(fix32)SPEED)+m)*(fix32)SIZE, -100f, 100f));
if(get_val(STICK_2_X) < 0.00) {
if(!x) m += 0.131226; x = 1;
} else x = 0;
if(get_val(STICK_2_Y) < 0.00) {
if(!y) m += 0.131256; y = 1;
} else y = 0;
}
}
-
DontAtMe - Captain
- Posts: 502
- Joined: Tue Oct 02, 2018 4:49 am
6 posts
• Page 1 of 1
Return to GPC2 Script Programming
Who is online
Users browsing this forum: No registered users and 117 guests