Game.time
Read the current game tick number for scheduling, logs, and cross-tick state decisions.
API QUICK REFERENCE
Find common APIs by object, method, or keyword, or start from Creep, Room, Spawn, Controller, Market, Link, Tower, Terminal, Lab, PathFinder, and Store hubs. This page remains a practical navigation and recall layer rather than a replacement for the official API Reference. For state-changing actions, record return codes and verify later-tick state.
API COVERAGE
This counts the site's own quick-reference entries, object/practice hubs, and P0 evidence paths. It is not a claim that every official Screeps API is documented here.
OBJECT HUBS
Use these hubs when you already know the object you are working with. Each hub connects the shared API reference to existing guides, return codes, tools, and accepted runtime verification.
A focused hub for Creep movement, harvesting, hauling, Controller upgrading, return codes, guides, and tools.
6 API entries · 7 return-code pathsRoomA focused hub for room visibility, Construction Sites, Event Log, and room-level diagnostics.
3 API entries · 4 return-code pathsStructureSpawnA focused hub for spawnCreep(), renewCreep(), recycleCreep(), Spawn return codes, and capacity planning.
3 API entries · 6 return-code pathsStructureControllerA focused hub for Controller upgrading, downgrade risk, Safe Mode, reservation, claiming, tools, and return codes.
1 API entries · 5 return-code pathsGame.marketA focused hub for Game.market deals, order creation, Terminal transport budgeting, and Market tools.
3 API entries · 3 return-code pathsStructureLinkA focused hub for Link Energy transfer, cooldown, capacity, room logistics, and Controller supply debugging.
1 API entries · 5 return-code pathsStructureTowerA focused hub for Tower attack, heal, repair, range falloff, Energy budgeting, and defense planning.
1 API entries · 4 return-code pathsStructureTerminalA focused hub for Terminal sends, transaction Energy, stock, cooldown, and Market cost planning.
1 API entries · 4 return-code pathsStructureLabA focused hub for Lab reactions, Boosts, mineral and Energy prerequisites, cooldown, and production planning.
2 API entries · 7 return-code pathsPathFinderA focused hub for tile-level PathFinder, room-level routes, ERR_NO_PATH, CostMatrix, and movement debugging.
2 API entries · 2 return-code pathsStoreA practical hub for Store used, free, and total capacity semantics across Creep hauling, Storage, Containers, and room economy.
0 API entries · 2 return-code pathsShowing 29 / 29 entries
Game.timeRead the current game tick number for scheduling, logs, and cross-tick state decisions.
Game.rooms[roomName]Read currently visible Rooms. A Room without vision is not present and may evaluate to undefined.
Game.getObjectById(id)Restore a currently accessible game object from its ID. Returns null when the object cannot be resolved.
Game.notify(message, groupInterval)Queue an account notification for Controller risk, colony failures, and other events that matter outside the Console.
Game.cpu.getUsed()Read CPU used so far in the current tick and compare before/after samples around a code section.
Game.map.findRoute(from, to, opts)Plan a room-level route between rooms and inspect exit directions plus the next-room sequence.
creep.moveTo(target, opts)Schedule Creep movement. OK means the movement request was accepted, not that the position already changed.
creep.harvest(target)Harvest from an allowed Source, Mineral, or other resource target when the Creep has the required body parts.
creep.transfer(target, resourceType, amount?)Transfer a resource from the Creep Store to a target that can receive it.
creep.withdraw(target, resourceType, amount?)Withdraw a resource from a Structure, Tombstone, or Ruin Store.
creep.pickup(resource)Pick up a dropped Resource object. Stored resources in Containers and similar targets use withdraw instead.
creep.upgradeController(controller)Spend carried Energy through WORK parts to add progress to an owned Controller.
creep.build(target)消耗 Creep 携带的 Energy 推进 Construction Site 建造进度,需要有效 WORK 部件并满足动作距离。
creep.repair(target)消耗 Creep 携带的 Energy 修复可维修结构,需要有效 WORK 部件并满足动作距离。
room.createConstructionSite(x, y, structureType)Submit a Construction Site request at a position and use the return code as the authoritative immediate result.
room.getEventLog(raw?)Read the previous tick's room events for follow-up evidence around attacks, repairs, construction, and other actions.
spawn.spawnCreep(body, name, opts?)Submit a Creep spawn request. Validate name, body, Energy, dryRun, and the final return code.
spawn.renewCreep(creep)Use an owned Spawn to extend an eligible normal Creep's lifetime while accounting for Spawn occupancy and Boost limits.
spawn.recycleCreep(creep)Recycle a Creep you no longer need. The target must be near your Spawn and should be treated as an explicit one-way task.
link.transferEnergy(target, amount?)Transfer Energy between Links in the same room after checking cooldown, stock, free capacity, and transfer loss.
tower.attack() / heal() / repair()Use a Tower's attack, heal, or repair action. These actions share the tick's action opportunity and scale with range.
terminal.send(resourceType, amount, destination, description?)Send resources across rooms while the sender pays transaction Energy. Check cooldown, stock, and destination first.
lab.runReaction(inputLab1, inputLab2)Run a reaction in an output Lab using minerals from two input Labs to produce a compound.
lab.boostCreep(creep, bodyPartsCount?)Spend a Lab's compound and Energy to boost matching Creep body parts.
factory.produce(resourceType)Produce a commodity from COMMODITIES recipes after checking components, capacity, level, and cooldown.
observer.observeRoom(roomName)Request vision for a remote room and read that Room from Game.rooms on a later tick.
Game.market.deal(orderId, amount, roomName?)Execute a real market deal after checking the order, Credits, resource stock, and Terminal transaction cost.
Game.market.createOrder(params)Create your own market buy or sell order and account for the order creation fee.
PathFinder.search(origin, goal, opts?)Run tile-level pathfinding and inspect path, cost, ops, and incomplete rather than treating the path alone as the result.