Questions tagged [screeps]

Screeps is a JavaScript based, programmable web browser MMO RTS.

Screeps is a JavaScript based, programmable web browser massively multiplayer online real-time strategy game.

139 questions
5
votes
3 answers

Game Screeps - creep.room.find(Game.CONSTRUCTION_SITES); not working

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); …
webecreative
  • 197
  • 1
  • 3
  • 10
5
votes
3 answers

Screeps - Where to find constants of Game Object?

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/
Lapu
  • 77
  • 1
  • 3
4
votes
1 answer

ts-jest - declare const from typing (.d.ts) values are undefined when running jest

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…
Toolmaker
  • 554
  • 6
  • 22
4
votes
2 answers

How to list my Walls [Screeps]

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…
gaurav
  • 365
  • 5
  • 14
4
votes
1 answer

Why does screeps.com require access to code in public and private repos during sign-in via github?

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…
qlonik
  • 43
  • 3
4
votes
2 answers

How to iterate structures properly

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…
Gwen
  • 354
  • 1
  • 2
  • 10
4
votes
1 answer

Is there a way to calculate the number of ticks it will take for a creep to get from A to B?

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…
muirbot
  • 2,061
  • 1
  • 20
  • 29
4
votes
3 answers

Game Screeps - IDE Integration

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…
Lucas Azevedo
  • 1,097
  • 15
  • 36
4
votes
2 answers

C.walls and Roads missing from Game.structures

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…
4
votes
1 answer

Finding a room through it's name

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…
user3629714
4
votes
4 answers

Is it possible to assign function hooks to game objects, e.g. run function on init, death, etc?

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.)
btd
  • 684
  • 6
  • 15
4
votes
3 answers

Game Screeps. Error during simulation. CPU limit reached

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 =…
4
votes
1 answer

Error when running Screeps game script

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?
dFionov
  • 129
  • 10
3
votes
1 answer

Deflate string C#

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[]…
3
votes
1 answer

How do you mock & extend an external defined class and it's prototypes?

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…
thmsn
  • 1,976
  • 1
  • 18
  • 25
1
2
3
9 10