I have the following code from the tutorial, except in simulation mode it isn't working..
if(creep.memory.role == 'builder') {
if(creep.energy === 0) {
creep.moveTo(Game.spawns.Spawn1);
Game.spawns.Spawn1.transferEnergy(creep);
…
Where can I find a list of the constants for the Game object like Game.HOSTILE_CREEPS, Game.MOVE and Game.ATTACK?
I cannot find it on http://screeps.com/docs/
I'm relatively new to use Typescript and Jest and I've been running into an issue where I have a whole bunch of ambient declarations in a typings files (index.d.ts) in @types/screeps. These look like this:
declare const OK: 0;
declare const…
When I build a new wall using Creep.build(), it creates wall with 1 hit point. Now I am trying to create a creep which repairs these newly constructed walls. But I am not able to figure a good way to list and iterate on these wall…
Screeps.com allow to sign-in using github account, however it requests permissions which seem to be too high: full access to both public and private repos (code, issues, pull requests and so on). What is the purpose of it? Is it possible to sign-in…
I'd like to iterate found structures but I don't know what way is the best for this.
I've tried this one:
for (var ext in creep.room.find(FIND_MY_STRUCTURES, {filter: { structureType: STRUCTURE_EXTENSION }})){
console.log(ext.energy);
}
but it…
I know how to get the distance from A to B, but with all the terrain factors, its very difficult to calculate how long it will take a creep to travel that path. Is there a built-in way of doing this that I'm missing? Here's what I'm wishing…
I'm playing Screeps (http://screeps.com/) Simulation Room mode. I've been testing some scripts and I don't want to only save them to my local browser, I want to use an IDE to develop the code and push it to my github account. Is it possible to do…
I'm not sure if I am missing something, but roads and constructed walls are not appearing in Game.structures while ramparts and extensions show up fine. Is this a bug or am I doing something wrong.
Here is the code i am using
for(var i in…
Let us suppose i save in memory the name of a room - "1-1". How would i go around to access that room object without having access to any creep/structure in that room? Something like:
function(roomName){
var room = Game.rooms.roomName; //what…
I haven't found any way to assign hooks to anything, and if I could it would be very useful. Also, how can I check whether a game object still exists? (i.e. hasn't died of age, and wasn't destroyed by an enemy.)
I'm going throw Screeps (http://screeps.com/) simulation. I've stick on stage when I need to send worker to harvest resources. So I put code from the tip to the script tab, code is:
var creep = Game.creeps.Worker1;
var sources =…
Don't know about "Screeps"? Visit screeps.com
It's a second line in main script:
var spawnController = require('spawnController');
It's error:
SyntaxError: Unexpected token )
at __evalCode:1:10622
at h:1:12286
at main:2:23
Any suggestions?
I tried to deflate a string I got from a websocket connection, but everytime I try to run this code I get an Error. I also tried to get the bytes directly from the string with an ascii encoding but it didn't work either.
public static byte[]…
Backstory
I'm playing a game called screeps the game allows you to write a bot / ai that performs actions in the game. The way this is accomplished is by uploading code that is run in an environment with available constants, classes and…