D
Deleted User
Guest
OP
Hello!
So, I recently picked up a teensy myself, and am having a wonderful time learning how to use it, and found some awesome public "bots" for the Nintendo Switch that people can use. However I am noticing one trend thus far. I am seeing that the documentation on a lot of these "bots" is few and far between, and would like to try to make an application to make it easier for anyone in the community to make things like this for other games.
However that leads me to the one big issue that I can't seem to wrap my head around, nor some of my other friends that took a look at this and I was wondering if anyone here could ELI5.
The example code I would like to use for this is the Snowball thrower by bertrandom here. More specifically line 44 to 147. How is he determining how long to hold each button press for? Unless I'm having as massive brain fart he isn't using MS to determine the timing.
For everyones convenience I will also share the code in question here.
Admitting my programming experience is minimalistic to say the least however I do know just enough to get basic things done. So I would like to apologize if this is something very basic that anyone with actual knowledge should know.
The only other thing I could think of personally that this code uses to determine timing is that it goes off of cycles. However won't the teensy need to monitor more than it does to determine a cycle?
And of course like usual, if nothing here makes sense or my question isn't clear. I would like to apologize beforehand. Feel free to call me an idiot, and I would be more than happy to reword/elaborate further
So, I recently picked up a teensy myself, and am having a wonderful time learning how to use it, and found some awesome public "bots" for the Nintendo Switch that people can use. However I am noticing one trend thus far. I am seeing that the documentation on a lot of these "bots" is few and far between, and would like to try to make an application to make it easier for anyone in the community to make things like this for other games.
However that leads me to the one big issue that I can't seem to wrap my head around, nor some of my other friends that took a look at this and I was wondering if anyone here could ELI5.
The example code I would like to use for this is the Snowball thrower by bertrandom here. More specifically line 44 to 147. How is he determining how long to hold each button press for? Unless I'm having as massive brain fart he isn't using MS to determine the timing.
For everyones convenience I will also share the code in question here.
Admitting my programming experience is minimalistic to say the least however I do know just enough to get basic things done. So I would like to apologize if this is something very basic that anyone with actual knowledge should know.
The only other thing I could think of personally that this code uses to determine timing is that it goes off of cycles. However won't the teensy need to monitor more than it does to determine a cycle?
And of course like usual, if nothing here makes sense or my question isn't clear. I would like to apologize beforehand. Feel free to call me an idiot, and I would be more than happy to reword/elaborate further
Code:
static const command step[] = {
// Setup controller
{ NOTHING, 250 },
{ TRIGGERS, 5 },
{ NOTHING, 150 },
{ TRIGGERS, 5 },
{ NOTHING, 150 },
{ A, 5 },
{ NOTHING, 250 },
// Talk to Pondo
{ A, 5 }, // Start
{ NOTHING, 30 },
{ B, 5 }, // Quick output of text
{ NOTHING, 20 }, // Halloo, kiddums!
{ A, 5 }, // <- I'll try it!
{ NOTHING, 15 },
{ B, 5 },
{ NOTHING, 20 },
{ A, 5 }, // <- OK!
{ NOTHING, 15 },
{ B, 5 },
{ NOTHING, 20 }, // Aha! Play bells are ringing! I gotta set up the pins, but I'll be back in a flurry
{ A, 5 }, // <Continue>
{ NOTHING, 325 }, // Cut to different scene (Knock 'em flat!)
{ B, 5 },
{ NOTHING, 20 },
{ A, 5 }, // <Continue> // Camera transition takes place after this
{ NOTHING, 50 },
{ B, 5 },
{ NOTHING, 20 }, // If you can knock over all 10 pins in one roll, that's a strike
{ A, 5 }, // <Continue>
{ NOTHING, 15 },
{ B, 5 },
{ NOTHING, 20 }, // A spare is...
{ A, 5 }, // <Continue>
{ NOTHING, 100 }, // Well, good luck
{ A, 5 }, // <Continue>
{ NOTHING, 150 }, // Pondo walks away
// Pick up Snowball (Or alternatively, run to bail in case of a non-strike)
{ A, 5 },
{ NOTHING, 50 },
{ LEFT, 42 },
{ UP, 80 },
{ THROW, 25 },
// Non-strike alternative flow, cancel bail and rethrow
{ NOTHING, 30 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 }, // I have to split dialogue (It's nothing)
{ NOTHING, 15 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 450 },
{ B, 5 }, // Snowly moly... there are rules!
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 }, // Second dialogue
{ NOTHING, 20 },
{ DOWN, 10 }, // Return to snowball
{ NOTHING, 20 },
{ A, 5 }, // Pick up snowball, we just aimlessly throw it
{ NOTHING, 50 },
{ UP, 10 },
{ THROW, 25 },
// Back at main flow
{ NOTHING, 175 }, // Ater throw wait
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 }, // To the rewards
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 }, // Wait for 450 cycles by bashing B (Like real players do!)
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 },
{ B, 5 },
{ NOTHING, 20 } // Saving, intermission
};