Coder Social home page Coder Social logo

retrobot's Introduction

Retrobot

Retrobot is a Discord bot that allows you to play NES/SNES/GB/GBA games with your friends over chat! Think "TwitchPlaysPokemon", but with GIFs. It accepts button presses, emulates the result, and encodes a GIF to view.

Example

Input Assist

Retrobot simplifies control by auto-forwarding through idle parts of games, such as conversations or battle animations.

Additionally, numbered buttons are added to automatically repeat button presses. This is useful for walking in a specific direction for a long period.

How to Use

Create a bot in the Discord Developer Portal, and obtain a token for your bot. Also, ensure "Message Content Intent" is enabled for your bot.

Message Content Intent screenshot

Create a file name exactly .env in your clone of this repository with the following contents:

DISCORD_TOKEN=YOUR DISCORD TOKEN HERE

Run these commands:

yarn install
yarn start

Then invite the bot to a server with the following URL. Be sure to update the OAuth Client ID.

https://discord.com/api/oauth2/authorize?client_id=YOUR_OAUTH_CLIENT_ID_HERE&permissions=68608&scope=bot

Once the bot has joined your Discord server, drop an uncompressed ROM file into a channel. The bot will automatically find the ROM file, and begin emulation. Note: only server "administrators" can start new games.

Running as a Daemon

If you'd like a simple way to run the bot as a background service, there's a helper yarn script. It will fire up the bot as a background service, and record logs to ./forever/retrobot.log

yarn service:start

And to stop:

yarn service:stop

Running via Docker Compose

Requires Docker and Docker Compose is installed on the machine.

  • Rename docker-compose.yml.example to docker-compose.yml
  • Edit docker-compose.yml and your Discord bot token.
  • Run docker-compose build
  • Run docker-compose up -d

Technical Notes

Retrobot is built on libretro, the code that powers RetroArch. Several libretro cores have been cross-compiled to WASM to be used in Node.js. Since WASM modules have independent memory spaces, it means several cores of the same type can be instanced. This allows parallelism.

License

The bot source code here is licensed as MIT. The libretro core each have their own licenses.

retrobot's People

Contributors

obezuk avatar rossimo avatar sedand avatar zikes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.