https://github.com/etherealengine/ee-bot
The official AI enabled bot for XREngine built on puppeteer.
https://github.com/etherealengine/ee-bot
bot
Last synced: 10 months ago
JSON representation
The official AI enabled bot for XREngine built on puppeteer.
- Host: GitHub
- URL: https://github.com/etherealengine/ee-bot
- Owner: EtherealEngine
- License: other
- Archived: true
- Created: 2021-11-21T07:05:45.000Z (about 4 years ago)
- Default Branch: dev
- Last Pushed: 2024-08-18T06:35:22.000Z (over 1 year ago)
- Last Synced: 2025-04-30T15:27:56.191Z (10 months ago)
- Topics: bot
- Language: JavaScript
- Size: 380 KB
- Stars: 5
- Watchers: 9
- Forks: 14
- Open Issues: 14
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Bot API
```ts
import { Vector3 } from 'three'
import { EtherealEngineBot } from '@ir-engine/ir-bot/src/bot'
import { BotHooks } from '@ir-engine/ir-bot/src/bot/enums/BotHooks'
const maxTimeout = 10 * 1000
const bot = new EtherealEngineBot({ 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
})
})
```