Basic readme and main.ts
This commit is contained in:
20
README.md
Normal file
20
README.md
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
# Screeps Typescript Starter
|
||||||
|
|
||||||
|
Screeps Typescript Starter is a starting point for a Screeps AI written in Typescript. It provides everything you need to start writing your AI whilst leaving `main.ts` as empty as possible.
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
You will need:
|
||||||
|
|
||||||
|
- Node.JS (Latest LTS is recommended)
|
||||||
|
- A Package Manager (Yarn or NPM)
|
||||||
|
|
||||||
|
Download the latest source [here](https://github.com/screepers/screeps-typescript-starter/archive/v3.0.zip) and extract it to a folder.
|
||||||
|
|
||||||
|
Open the folder in your terminal and run `npm install` (or `yarn`) to install the dependencies.
|
||||||
|
|
||||||
|
Fire up your preferred editor with typescript installed and you are good to go!
|
||||||
|
|
||||||
|
## Typings
|
||||||
|
|
||||||
|
The typings for Screeps comes from [typed-screeps](https://github.com/screepers/typed-screeps), if you have an issue with incorrect typings open an issue there.
|
||||||
@@ -1,3 +1,11 @@
|
|||||||
export function loop() {
|
export function loop() {
|
||||||
|
|
||||||
|
// Clear non-existing creep memory.
|
||||||
|
for(let name in Memory.creeps) {
|
||||||
|
if(!Game.creeps[name]) {
|
||||||
|
delete Memory[name];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
console.log(`Current tick is ${Game.time}`);
|
console.log(`Current tick is ${Game.time}`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user