diff --git a/.gitignore b/.gitignore index ce84fb9..b4ac082 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /typings # Screeps Config -screeps.json +.screeps.yml # ScreepsServer data from integration tests /server diff --git a/.screeps.example.yml b/.screeps.example.yml new file mode 100644 index 0000000..17ba4a6 --- /dev/null +++ b/.screeps.example.yml @@ -0,0 +1,16 @@ +servers: + main: + host: screeps.com + secure: true + token: {TOKEN} + ptr: + host: screeps.com + secure: true + token: {TOKEN} + ptr: true + + +configs: + screepsconsole: + maxHistory: 20000 + maxScroll: 20000 \ No newline at end of file diff --git a/package.json b/package.json index 99d08bd..8fedfba 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,10 @@ "version": "3.0.0", "description": "", "scripts": { - "format": "prettier --config .prettierrc 'src/**/*.ts' --write && eslint --fix src/", - "build": "node esbuild.config.mjs" + "build": "node esbuild.config.mjs", + "push:main": "npm run build && screeps-api --server main upload dist/*", + "push:sim": "npm run build && screeps-api --server main upload --branch sim dist/*", + "format": "prettier --config .prettierrc 'src/**/*.ts' --write && eslint --fix src/" }, "repository": { "type": "git", @@ -42,6 +44,7 @@ "lodash": "^4.17.21", "mocha": "^11.7.1", "prettier": "^3.6.2", + "screeps-api": "^1.7.2", "shelljs": "^0.10.0", "sinon": "^21.0.0", "sinon-chai": "^4.0.0", diff --git a/screeps.sample.json b/screeps.sample.json deleted file mode 100644 index ed6c04c..0000000 --- a/screeps.sample.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "main": { - "token": "YOUR_TOKEN", - "protocol": "https", - "hostname": "screeps.com", - "port": 443, - "path": "/", - "branch": "main" - }, - "sim": { - "token": "YOUR_TOKEN", - "protocol": "https", - "hostname": "screeps.com", - "port": 443, - "path": "/", - "branch": "sim" - }, - "season": { - "token": "YOUR_TOKEN", - "protocol": "https", - "hostname": "screeps.com", - "port": 443, - "path": "/season", - "branch": "main" - }, - "pserver": { - "email": "username", - "password": "Password", - "protocol": "http", - "hostname": "1.2.3.4", - "port": 21025, - "path": "/", - "branch": "main" - } -} diff --git a/src/main.ts b/src/main.ts index 94e4401..eabdd83 100644 --- a/src/main.ts +++ b/src/main.ts @@ -41,4 +41,5 @@ declare global { // }); export const loop = () => { console.log(`Current game tick is ${Game.time}`); + console.log(`Current game CPU is ${Game.cpu.getUsed()}`); }; diff --git a/tsconfig.json b/tsconfig.json index fe256ff..62457f4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "es2018", - "lib": ["es2018"], + "lib": ["es2018", "dom"], "module": "commonjs", "moduleResolution": "node", "outDir": "dist",