Expand description
The main interface to objects in the Screeps game world.
This contains all functionality from the Game
object in Screeps. That
generally means all state which is true this tick throughout the world.
§Safety
All returned game objects must be used only during the tick they are retreived or resolved. They are considered “stale” on subsequent ticks, and the behavior of stale game objects is undefined.
Modules§
- cpu
- Information about, and functions to manage, your code’s resource utilization
- gcl
- Global Control Level information.
- gpl
- Global Power Level information.
- map
- Game map related functionality.
- market
- Access the in-game market to buy or sell resources.
- shard
- Information about the current shard.
Functions§
- construction_
sites - Get a
JsHashMap<ObjectId<ConstructionSite>, ConstructionSite>
with all of your construction sites. - creeps
- Get a
JsHashMap<String, Creep>
with all of your creeps, which has creep names as keys. - creeps_
jsstring - Get a
JsHashMap<JsString, Creep>
with all of your creeps, which has creep names as keys. - flags
- Get a
JsHashMap<String, Flag>
with all of your flags, which has flag names as keys. - flags_
jsstring - Get a
JsHashMap<JsString, Flag>
with all of your flags, which has flag names as keys. - get_
object_ by_ id_ erased - Get the
RoomObject
represented by a givenRawObjectId
, if it’s still alive and visible. - get_
object_ by_ id_ typed - Get the typed object represented by a given
ObjectId
, if it’s still alive and visible. - get_
object_ by_ js_ id_ typed - Get the typed object represented by a given
JsObjectId
, if it’s still alive and visible. - notify
- Send an email message to yourself with a given message.
- power_
creeps - Get a
JsHashMap<String, AccountPowerCreep>
with all of your power creeps, which has power creep names as keys. - power_
creeps_ jsstring - Get a
JsHashMap<JsString, AccountPowerCreep>
with all of your power creeps, which has power creep names as keys. - resources
- Get a
JsHashMap<IntershardResourceType, u32>
with all of your account resources. - rooms
- Get a
JsHashMap<RoomName, Room>
with the rooms visible for the current tick. - score
seasonal-season-2
- Your current score, as determined by the symbols you have decoded.
- spawns
- Get a
JsHashMap<String, StructureSpawn>
with all of your spawns, which has spawn names as keys. - spawns_
jsstring - Get a
JsHashMap<JsString, StructureSpawn>
with all of your spawns, which has spawn names as keys. - structures
- Get a
JsHashMap<ObjectId<Structure>, StructureObject>
with all of your owned structures. - symbols
seasonal-season-2
- The symbols you’ve decoded after multiplier adjustments, used to determine your score.
- time
- Get the current time, the number of ticks the game has been running.