Giter VIP home page Giter VIP logo

steam-robot's Introduction

steam-robot

Steam bots creating based on middlewares, that are called indefinitely for a given delay. Internally he uses modules from the See also section.

TypeDoc documentation is available on wiki.

Install

npm install steam-robot

Usage

Middlewares style

import SteamRobot from 'steam-robot'

// Account object for creating a bot
const account = {
  // Required properties
  username: 'username',
  password: 'password',
  sharedSecret: 'sharedSecret',
  // Optional properties
  identitySecret: 'identitySecret',
  options: {
    key: 'You can specify additional options'
  },
  headers: {
    key: 'You can specify additional headers'
  },
  proxy: null // Format protocol://username:password@host:port
}

const bot = new SteamRobot(account)

bot.use(async (steam, account, next) => {
  console.log('First middleware')

  // The steam object contains:
  // - totp (steam-totp)
  // - client (steam-user)
  // - community (steamcommunity)
  // - manager (steam-tradeoffer-manager)
  // - market (steam-market)

  // The account object is a copy of the bot creation object
  // You can specify your own account.options and get them inside middleware

  // Call to move to the next middlware
  await next()
})

bot.use(async (steam, account, next) => {
  console.log('Second middleware')
  await next()
})

// Run at 60 seconds interval (default)
await bot.start(60 * 1000)

// Stop middlewares and exit Steam
bot.stop()

Manual style

import SteamRobot from 'steam-robot'

// Account object for creating a bot
const account = {
  // Required properties
  username: 'username',
  password: 'password',
  sharedSecret: 'sharedSecret',
  // Optional properties
  identitySecret: 'identitySecret',
  options: {
    key: 'You can specify additional options'
  },
  headers: {
    key: 'You can specify additional headers'
  },
  proxy: null // Format protocol://username:password@host:port
}

const bot = new SteamRobot(account)

// You can work with the Steam object directly without using use()
const steam = await bot.start()

// The steam object contains:
// - totp (steam-totp)
// - client (steam-user)
// - community (steamcommunity)
// - manager (steam-tradeoffer-manager)
// - market (steam-market)

// An example of using the steam object
const search = await steam.market.search(730)
console.log('search', search.success)

// Exit Steam
bot.stop()

See also

Module Description Author
steam-totp Lightweight module to generate Steam-style TOTP auth codes DoctorMcKay
steam-user Allows interaction with the Steam network via the Steam client protocol DoctorMcKay
steamcommunity Interact with various interfaces on Steam Community from Node.js DoctorMcKay
steam-tradeoffer-manager Simple and sane Steam trade offer management DoctorMcKay
steam-market Steam market API client Vladislav Puzyrev
steam-robot (YOU HERE) Steam bots creating based on middlewares Vladislav Puzyrev

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.