(switch-fightstick) Scripting inputs to automate games

Discussion in 'Switch - Hacking & Homebrew' started by Duo8, Feb 7, 2018.

  1. Duo8
    OP

    Duo8 I don't like video games

    Member
    3,453
    1,148
    Jul 16, 2013
    I haven't seen a thread for this yet. There's a splatoon printer thread but that's just for one game.

    Anyway, as you know there are tools out there that lets you send inputs through USB to your Switch. This guy here modified the original switch-fightstick demo to accept inputs over a serial connection. This is very convenient because instead of having to program and pair the "controller" every time, you just run a script.

    Example: https://twitter.com/ebith/status/954858876028907521
    (wow I wish I can embed twitter)

    Link: https://blog.feelmy.net/control-nintendo-switch-from-computer/

    I made this thread hoping that people will find this useful and share their scripts for games. There's a python example for Xenoblade 2 in the github repo. You can use any tool you want, it just needs to be able to communicate over a serial connection.
     
  2. lordelan

    lordelan GBAtemp Advanced Maniac

    Member
    1,943
    619
    Jan 4, 2015
    Gambia, The
    So what's that doing?
    Sending specific inputs to the Switch like "press UP for two seconds, then A three times, then DOWN two seconds"? So it makes the player a bot.
     
  3. Uumas

    Uumas GBAtemp Advanced Maniac

    Member
    1,649
    628
    Sep 17, 2016
    Finland
    Yes
     
    lordelan likes this.
  4. SoslanVanWieren

    SoslanVanWieren GBAtemp Maniac

    Member
    1,477
    256
    Feb 6, 2017
    Australia
    So some one could make mar/io for Mario odyssey. just plug the switch into a capture card and you can use a program to detect whats going on on screen.
     
  5. Ronhero

    Ronhero Too Weird to Live, Too Rare to Die

    Member
    3,168
    1,123
    Jun 28, 2014
    United States
    Arizona Bay
    I'm sure this will be popular with speed runs
     
  6. SoslanVanWieren

    SoslanVanWieren GBAtemp Maniac

    Member
    1,477
    256
    Feb 6, 2017
    Australia
    Tas bot
     
  7. StarGazerTom

    StarGazerTom GBAtemp Advanced Fan

    Member
    982
    697
    Feb 2, 2015
    Could be super handy for automating easily predicted farming methods aswell. Example being the Pot Dance Gem Bath farm in Shantae
     
  8. Uumas

    Uumas GBAtemp Advanced Maniac

    Member
    1,649
    628
    Sep 17, 2016
    Finland
    It's already being used at least for BOTW snow bowling
     
  9. SoslanVanWieren

    SoslanVanWieren GBAtemp Maniac

    Member
    1,477
    256
    Feb 6, 2017
    Australia
    Now its going to be easier to make shiny hunting bots for pokemon switch.
     
  10. Arkangelshadow

    Arkangelshadow Member

    Newcomer
    41
    31
    Jun 6, 2013
    Mexico
    Bot vs PkHex, I don't know wich will provide players with a sense of pride and accomplishment for unlocking different Pokemon.
     
  11. StarGazerTom

    StarGazerTom GBAtemp Advanced Fan

    Member
    982
    697
    Feb 2, 2015
    Bot will be slower, but will make the pokemon 100% legit, literally no protection against it.

    Where as PKhex you have to make everything legit as possible, but its still debatable if its a legit mon or not.

    IMO, bot will be better, if we manage to make one that is
     
  12. Scarlet

    Scarlet Self-Inflicted Achromatic

    pip Contributor
    GBAtemp Patron
    Scarlet is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    2,118
    2,854
    Jan 7, 2015
    United Kingdom
    Middleish North-Left
  13. Sasori

    Sasori GBAtemp Advanced Maniac

    Member
    1,582
    990
    Jan 28, 2015
    United States
    Looks like this is an altered version of the BOTW snowball thrower

    https://github.com/bertrandom/snowball-thrower

    I was looking to make a tool for people to use to make more applications like this, unfortunately I haven't been able to make heads or tales of how the timing is determined for button presses.
     
  14. sup3rgh0st

    sup3rgh0st Top Tier Ghost

    Member
    303
    206
    Apr 22, 2010
    United States
    Seeing an Odyssey TAS would be an entertaining watch. Unfortunately I'm pretty sure you need a way to interrupt V-Blanks, or some other way to sync with the frame rate. At least that's what TASBot does.
     
    Ronhero likes this.
  15. StarGazerTom

    StarGazerTom GBAtemp Advanced Fan

    Member
    982
    697
    Feb 2, 2015
    Don't believe you need to do that at all. You just wait until the system presses start at the beginning of teh game and done, it should stay synced, unless there are RNG elements for stuff like enemy positions, then you're kinda flumuxed.
     
  16. sup3rgh0st

    sup3rgh0st Top Tier Ghost

    Member
    303
    206
    Apr 22, 2010
    United States
    That assumes that loading will be 100% consistent between every run, and there's no way that's the case. If you watch the early TASBot runs, desyncs were common, even on cartridge based NES games. Lag is unpredictable and will be different on every console. The Switch would be even more unpredictable if it throttles itself, or does routines behind the scenes.
     
  17. StarGazerTom

    StarGazerTom GBAtemp Advanced Fan

    Member
    982
    697
    Feb 2, 2015
    Hmmm.... I suppose I didn't take that into account, so admittedly, you may actually be fully right, in saying they need to use V-blank to keep in sync.