Hardware Automation with arduino devices

Aheago

Well-Known Member
OP
Member
Joined
Jan 4, 2021
Messages
505
Trophies
0
Age
33
XP
1,222
Country
United States
Im interested in making some simple bots of my own for various games using arduino projects similar to this. However, I can't quite figure out how these developers are figuring out the button timings.

for example in this instance. What are the values, 200, 1250, 500, and 5. From my understanding, this isn't like a "sleep" function so they aren't miliseconds or seconds. Correct?

I appreciate any/all help, thank you!
Code:
#include <Arduino.h>
#include <NintendoSwitchControlLibrary.h>

const int _buttonDelay = 200;
const int _dialogDelay = 1250;

void setup() {
  // Connect controller
  pushButton(Button::B, 500, 5);

  // Open boxes
  pushButton(Button::X, _buttonDelay);
 

hippy dave

BBMB
Member
Joined
Apr 30, 2012
Messages
9,919
Trophies
2
XP
29,992
Country
United Kingdom
It'll be milliseconds, in this kind of context it's always milliseconds.

E: the 5 might not be milliseconds, it's an additional 3rd argument after the time value (2nd argument) and button ID (1st argument), so idk what it represents, probably entirely unrelated to time. But the others are milliseconds.

EE: actually googled the included NintendoSwitchControlLibrary.h which I didn't read before because it's not in the above GitHub, so here's the answer, the 5 is a loop value.

https://github.com/lefmarna/Nintend...lob/master/src/NintendoSwitchControlLibrary.h

Code:
void pushButton(uint16_t button, unsigned long delay_time = 0, unsigned int loop = 1);
 
Last edited by hippy dave,

Aheago

Well-Known Member
OP
Member
Joined
Jan 4, 2021
Messages
505
Trophies
0
Age
33
XP
1,222
Country
United States
It'll be milliseconds, in this kind of context it's always milliseconds.

E: the 5 might not be milliseconds, it's an additional 3rd argument after the time value (2nd argument) and button ID (1st argument), so idk what it represents, probably entirely unrelated to time. But the others are milliseconds.

EE: actually googled the included NintendoSwitchControlLibrary.h which I didn't read before because it's not in the above GitHub, so here's the answer, the 5 is a loop value.

https://github.com/lefmarna/Nintend...lob/master/src/NintendoSwitchControlLibrary.h

Code:
void pushButton(uint16_t button, unsigned long delay_time = 0, unsigned int loop = 1);
I guess I could have looked a bit deeper. Seems like my Google fu skills need to be brushed up on!

Nevertheless this is super helpful information thank you for taking the time to clarify!
 
  • Like
Reactions: hippy dave

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • BigOnYa @ BigOnYa:
    I'd rather spend like $150 more for a surround receiver.
  • K3Nv2 @ K3Nv2:
    I bought the game at launch never fucked with it until recently
  • BigOnYa @ BigOnYa:
    Its fun, I like it, even tho I'm not a big harry potter fan. Like a wizard rpg. Flying around on a broomstick is cool.
  • K3Nv2 @ K3Nv2:
    Flying sucks ass on it
  • BigOnYa @ BigOnYa:
    Nuh just takes a min to get used to. I think you can upgrade or buy new broomstick also that are better.
    +1
  • K3Nv2 @ K3Nv2:
    I weirdly like inverted controls on all flying type games
  • BigOnYa @ BigOnYa:
    Prob can change it, inverted flying controls.
  • K3Nv2 @ K3Nv2:
    Only thing that annoys me is trying to find wtf to do in it
    +1
  • BigOnYa @ BigOnYa:
    Alright off to the store, later gators.
    +1
  • K3Nv2 @ K3Nv2:
    Some places amaze me were not in network with your insurance would you still like an appointment
    +1
  • AncientBoi @ AncientBoi:
    uhhh, I think I'll just stick with my PSP 3001
  • AncientBoi @ AncientBoi:
    lol, Now I gotta go to the store for more Coffee Mate n other stuff.
  • Xdqwerty @ Xdqwerty:
    i downloaded final fantasy vii into my tv stick
  • Xdqwerty @ Xdqwerty:
    i mean, the game was already there but its the japanese version
  • Xdqwerty @ Xdqwerty:
    and i only downloaded disc 1 so far bc of storage stuff
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, yeah the patty on McDs burger is 1/10th of a pound now and I think that's the pre cooked weight lol
  • Psionic Roshambo @ Psionic Roshambo:
    I use the app for the 20% off coupon and it's still over priced
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, why is mcdonalds overpriced if their food is bad?
  • Xdqwerty @ Xdqwerty:
    i mean why is mcdonalds food overpriced
  • Psionic Roshambo @ Psionic Roshambo:
    Inflation and greed
    +1
  • ZeroT21 @ ZeroT21:
    it's just fries, make 'em at home
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I make potato wedges at home with spices and stuff lol
    Psionic Roshambo @ Psionic Roshambo: I make potato wedges at home with spices and stuff lol