Giter Site home page Giter Site logo

ctf's Introduction

Regression Games Bot Template

This template demonstrates how to use advanced features of the rg-bot package to create a bot for the Regression Games: Ultimate Collector challenge.
Not sure what this is? Visit https://regression.gg for some programming fun!

Minimum Requirements for Regression Games

Every bot must have an index.js file with the following code:

const RGBot = require("rg-bot").RGBot;

/**
 * @param {RGBot} bot
 */
function configureBot(bot) {
  // Bot logic here
}

exports.configureBot = configureBot

This defines a configureBot function and exposes that function to Regression Games. Regression Games uses it as an entrypoint to your bot script, and passes a bot for you to interact with.

Here is an example of the configureBot function with some basic logic that will make your bot parrot back anything it sees in chat from other players.

function configureBot(bot) {

  // Every time a player says something in the game, 
  // do something with that player's username and their message
  bot.on('chat', (username, message) => { 
  
      // If the username of the speaker is equal to the username of this bot, 
      // don't do anything else. This is because we don't want the bot to repeat 
      // something that it says itself, or else it will spam the chat and be 
      // kicked from the game!
      if (username === bot.username()) return
      
      // make the bot chat with the same message the other player sent
      bot.chat("This is what I heard: " + message)
  })
  
}

exports.configureBot = configureBot

ctf's People

Contributors

pjrenzov avatar

Watchers

 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.