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,986
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
  • K3Nv2 @ K3Nv2:
    My gaming stick can finally get use
  • K3Nv2 @ K3Nv2:
    I did see Walmart got new electric scooters now ab won't run out of juice in the middle of the parking lot
    +1
  • AncientBoi @ AncientBoi:
    :O:O:O $12. Cool
  • K3Nv2 @ K3Nv2:
    Yeah but one two ports
    +1
  • K3Nv2 @ K3Nv2:
    I'd rather spend like $15 more for double
    +1
  • K3Nv2 @ K3Nv2:
    Lol hogwarts legacy has a Arachnophobia setting to turn on
  • 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
    Xdqwerty @ Xdqwerty: and i only downloaded disc 1 so far bc of storage stuff