[DEPRECATED] This sample project is deprecated. You can find actively updated starter kit in here: https://github.com/screepers/screeps-typescript-starter
This is a sample project to show how to start programming your Screep bots with Typescript.
This uses Typescript skeleton app: read more
After you create a spawn, this bot will create 4 creeps that are starting to harvest the closest source. The bots harvest, transfer energy back to Spawn. If creep's lifespan starts to end, it will refill in Spawn.
Screep API typescript type definitions are incuded as dependency. See their up to date status in here GitHUB link
Discussion in screep's community forum
Required dependencies:
NodeJS https://nodejs.org/en/
- `npm` command available in your CLI
Optional dependencies (only if you want to follow these installation instructions fully):
GIT https://git-scm.com/
- `git` command available in your CLI (if you want to follow these instructions)
$ git clone git@github.com:MarkoSulamagi/Screeps-typescript-skeleton.git
$ cd Screeps-typescript-skeleton
$ npm install
Rename secrets.default.js file to secrets.js
Fill "username" and "password" properties in just renamed secrets.js file with your Screep's username and email.
**NEVER COMMIT THIS FILE TO ANY VERSION CONTROL**
To run the compiler and uploader, navigate to your project folder and run this command
$ npm start
Now every time you edit your typescript files, main.js in ./dist folder is uploaded to your Screep scripts into "default" branch.
Project files are in ./src.
./src/main.ts - Application bootstrap. Don't change this file
./src/start/game-manager.ts - Your main module. This is where the program starts. There are instructive comments in the class file.
./src/screeps.d.ts - Typescript interfaces for Screep's API. This includes autocomplete and data types to your project. This file can get outdated if Screep's team adds new functionality or changes something.
./dist - Your compiled files. This will be created automatically. No need to change anything in here.
./typings - Lo-Dash Typescript interfaces. Created automatically and no need to change anything.
- Marko Sulamägi - Converted Cameron's work to quickly installable TS skeleton app - MarkoSulamagi
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE.md file for details