-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add bot? #46
Comments
There's no utility to do this right now but I'd definitely accept a player management patch. The "scrape-world" utility is a good place to start. It collects all the information from the vanilla Screeps lokidb and dumps it into xxscreeps: This is a little skeleton to get you started if you're interested. import { RoomPosition } from 'xxscreeps/game/position';
import * as CodeSchema from 'xxscreeps/engine/db/user/code';
import * as User from 'xxscreeps/engine/db/user';
import { Database, Shard } from 'xxscreeps/engine/db';
import { Room } from 'xxscreeps/game/room/room';
import * as Spawn from 'xxscreeps/mods/spawn/spawn';
const shard = await Shard.connect(db, 'shard0');
const { data } = shard;
const userId = generateId(12);
const user = await User.create(db, userId, 'bot');
const room = await shard.loadRoom('W1N1');
const spawn = Spawn.create(new RoomPosition(25, 25, 'W1N1'), userId, 'Spawn1');
room['#insertObject'](spawn);
await shard.saveRoom(room);
await shard.save();
const modules = ...;
await CodeSchema.saveContent(db, userId, 'main', modules);
db.disconnect(); |
thank you, where do the bot scripts locate, can I modify them? |
So a search in the screeps org after bot gives us the following places I think are relevant.
@laverdet I assume we would need something listening on the CLI host and an actual CLI implementation to get something in place for adding/removing bots? seems like it is backend-local that is responsible for starting both the gameserver and the cli server in vanilla screeps |
I found there are four default bots inside xxscreeps, how can I add and delete the bot?
The text was updated successfully, but these errors were encountered: