3.0.0 • Published 1 year ago

steam-robot v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

steam-robot

Creating Steam bots 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

Using npm:

npm install steam-robot

Using yarn:

yarn add 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

ModuleDescriptionAuthor
steam-totpLightweight module to generate Steam-style TOTP auth codesDoctorMcKay
steam-userAllows interaction with the Steam network via the Steam client protocolDoctorMcKay
steamcommunityInteract with various interfaces on Steam Community from Node.jsDoctorMcKay
steam-tradeoffer-managerSimple and sane Steam trade offer managementDoctorMcKay
steam-marketSteam market API clientVladislav Puzyrev
steam-robot (YOU HERE)Creating Steam bots based on middlewaresVladislav Puzyrev