0.5.6 • Published 2 years ago
@xrengine/bot v0.5.6
Bot API - WORK IN PROGRESS
Previously used agones for running inside an XREngine cluster - this is considered deprecated in favour of simplicitly.
Example
import { Vector3 } from 'three'
import { XREngineBot } from '@xrengine/bot/src/bot'
import { BotHooks } from '@xrengine/engine/src/bot/enums/BotHooks'
const maxTimeout = 10 * 1000
const bot = new XREngineBot({ name: 'bot-1', headless: false, verbose: false })
const vector3 = new Vector3()
const domain = process.env.APP_HOST
const locationName = 'test'
const sqrt2 = Math.sqrt(2)
describe('My Bot Tests', () => {
beforeAll(async () => {
await bot.launchBrowser()
await bot.enterLocation(`https://${domain}/location/${locationName}`)
await bot.delay(1000)
await bot.runHook(BotHooks.InitializeBot)
}, maxTimeout)
afterAll(async () => {
await bot.delay(1000)
await bot.quit()
}, maxTimeout)
test('Can spawn in the world', async () => {
expect(
vector3.copy(await bot.runHook(BotHooks.GetPlayerPosition)).length()
).toBeLessThan(sqrt2 * 2) // sqrt2 * 2 is the default size of our spawn area
})
})
0.5.3
2 years ago
0.5.6
2 years ago
0.5.2
2 years ago
5.0.0-beta3
2 years ago
5.0.0-beta2
2 years ago
5.0.0-beta1
2 years ago
0.5.0
2 years ago
0.5.1
2 years ago
0.4.9
3 years ago
0.4.10
3 years ago
0.4.8
3 years ago
0.4.7-beta1
3 years ago
0.4.7
3 years ago
0.4.6
3 years ago
0.4.5-beta4
3 years ago
0.4.5-beta2
3 years ago
0.4.5-beta3
3 years ago
0.4.5-beta1
3 years ago
0.4.5
3 years ago
0.4.4
3 years ago
0.4.1
3 years ago
0.4.3
3 years ago
0.4.2
3 years ago
0.3.37
3 years ago
0.3.36
3 years ago
0.3.35
3 years ago
0.3.35-pre.3
3 years ago
0.3.35-pre.2
3 years ago
0.3.35-pre.1
3 years ago
0.4.0
3 years ago
0.3.33-test3
3 years ago
0.3.33-test
3 years ago
0.3.33-test2
3 years ago
0.3.33-test4
3 years ago
0.3.34
3 years ago
0.3.33
3 years ago
0.2.27
3 years ago