HubsBot

Main class for creating a HubsBot. Dynamically adds all methods from InBrowserBot, which can be called directly from a HubsBot instance.

new HubsBot(opt: Object)

Extends EventEmitter

Parameters
opt (Object = {}) See below
Name Description
opt.headless boolean (default true) Set this to false to have puppeteer spawn Chromium window.
opt.name string (default "HubsBot") Name for the bot to appear as ( setName )
opt.autoLog any (default true)
Related
InBrowserBot
Example
var bot = new HubsBot();
bot.goTo(0, 1, 0) // goTo is a InBrowserBot method, but can be called directly on the HubsBot
Instance Members
catchAndScreenShot(fn, path)
evaluate(fn, args)
exec(fn)
launchBrowser()
enterRoom(roomUrl, opts)
asBrowserBot(fn, args)
quit()

InBrowserBot

Functionality that executes in the context of the browser.

new InBrowserBot()

Extends EventTarget

Instance Members
enterRoom(room)
evaluate(fn, args)
setAttribute(attr, val)
spawnObject(opts)
goTo(x, y, z)
goTo(position)
setName(name)
setAvatar(url)
say(message)
changeScene(url)
controlHands()
setAvatarLocations(opts)

InBrowserBotBuilder

Converts a HubsBot into an InBrowserBot. This should not be used directly, but rather accessed through HubsBot.asBrowserBot

new InBrowserBotBuilder(baseBot: any, fn: any, args: ...any)
Parameters
baseBot (any)
fn (any)
args (...any)
Instance Members
toString($0)