Screeps Harvest Energy: Your First Creep Script
Make one named Screeps Creep find a Source, move into range, and harvest Energy with a small script you can verify across later ticks.
TOPIC · 16 GUIDES
Focused English articles connected to energy, organized with the same filters used by the main article library.
16 matching guides
Make one named Screeps Creep find a Source, move into range, and harvest Energy with a small script you can verify across later ticks.
Make one Creep transfer Energy to a named Spawn, preserve delivery mode across ticks, and complete its first Source-to-Spawn round trip.
Build one Upgrader1 loop that harvests from an active Source, moves within Controller range 3, spends Energy with upgradeController(), and switches state across ticks.
Learn what Screeps is, how JavaScript controls its persistent world, and how Rooms, Creeps, Sources, Spawns, and Controllers work together for new players.
Find the room Mineral, require a same-tile owned active Extractor, check mineralAmount, Extractor cooldown, active WORK parts, Creep capacity and range, handle harvest() return codes, and verify Store and regeneration state on later ticks.
Guard room.storage access, calculate withdrawable Energy above a configurable reserve, switch a hauler between withdrawal and delivery, select Spawn and Extension targets deterministically, handle action return codes, and verify same-tick capacity races.
Recover an owned active Power Spawn, calculate base and PWR_OPERATE_POWER processing amounts, require Power and POWER_SPAWN_ENERGY_RATIO Energy, preserve a configurable room reserve, store GPL and resource snapshots, handle return codes, and verify later deltas.
Recover source and target Links by fixed IDs, require ownership, different objects, the same room, active structures and zero source cooldown, calculate a conservative amount from source stock and target free capacity, estimate LINK_LOSS_RATIO only for logs, and verify Store changes later.
Recover a stored Source ID first, distinguish FIND_SOURCES from FIND_SOURCES_ACTIVE, build reachable path candidates, rank path length before assignment count and stable ID, store the selected identity, handle empty Sources according to a documented dynamic policy, and preserve harvest and movement results.
Find a Container that currently holds Energy, check the Creep's free capacity, call withdraw(), handle range and return codes, and keep the delivery task outside this focused guide.
Filter FIND_DROPPED_RESOURCES for Energy, rank valid piles by collectible amount and path length, handle decay and changing targets, and inspect pickup() and movement results.
Build a stable two-phase working state from Store boundaries, keep the previous state at partial Energy, handle initialization and invalid capacity, and separate harvesting from Controller upgrading.