This persists across ticks, but disappears when the code is reloaded in a global reset. Heap: A general term for data stored outside the scope of the main loop. Memory: A global object provided by Screeps to store data that is persisted across ticks and global resets.
![screeps container screeps container](https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/clans/25169494/66be0376006169ca2204d535da96c9f4947bb529.png)
If the running processes you are attaching to accepts input, you can send instructions to it. To detach from the container without stopping it, use the CTRL-p CTRL-q key combination. change target in the middle of the room.Ĭ = highestContainer. Screeps: an MMO strategy sandbox game for programmers. To get access to the container logs you should prefer using the docker logs command. set the target in memory so the creep dosen't Here's the code its running: if ((source = (FIND_STRUCTURES, ) Ĭonsole.log( 'Going for the container id "' + highestContainer.id + '" at ' + highestContainer.energyPercent + '% full.' ) Energy is overwhelmingly gathered through the mining of Sources. Then, it can be used by worker creeps to perform tasks in your rooms. It can be harvested from Sources and transported using creeps with CARRY parts.
Screeps container upgrade#
It is used to spawn creeps, build structures, fill towers, and upgrade controllers.
![screeps container screeps container](https://upload-images.jianshu.io/upload_images/13523736-8bc436e9006d7d4f.png)
I need a way for the creep to determine the container with the highest energy and fill up from there. Energy is the most basic resource in Screeps. The problem I have is if I lower the threshold, the storer will run back and forth to the same containers, ignoring any containers further in the room and letting them fill up.Īnd raising the threshold will make him sit out and wait for too long, not giving him enough time to empty containers and thus the storage will be empty almost all the time. However, currently, it finds the container closest by Path and with an energy level greater to a certain threshold so that it doesn't wait there for hours every time a miner refills the container. So I have this creep role called storer that is supposed to go fetch energy from containers and bring it to the storage.