bencbartlett / creep-tasks Goto Github PK
View Code? Open in Web Editor NEWScreeps plugin for a flexible method of controlling creep actions
License: The Unlicense
Screeps plugin for a flexible method of controlling creep actions
License: The Unlicense
In documentation it's said
import { Tasks } from 'creep-tasks'
For me it worked via
import { default as Tasks } from 'creep-tasks'
as you have defined:
const Tasks_1 = require("./creep-tasks/Tasks");
exports.default = Tasks_1.Tasks;
Hi, i have problems with types property in tsconfig.json while compiling, it throws error.
"types": [
"lodash",
"typed-screeps"
]
If i remove theese lines, typings works just fine (using Intellij idea) and project compiles successfully.
They are also correctly installed in node_modules
(for the record, same problem with Overmind)
rpt2: options error TS2688 Cannot find type definition file for 'typed-screeps'.
[!] (rpt2 plugin) Error: D:/git/creep-tasks/src/creep-tasks/prototypes.ts(6,23): semantic error TS2693 'Creep' only refers to a type, but is being used as a value here.
creep-tasks
version: 1.0.0
creep-tasks
with: {TypeScript}creep-tasks/examples/JavaScript/creep-tasks.js is still 1.0.0 rather than the latest version. This caused an exception because Task.chain is missing from 1.0.0
run the Example code as is and wait for it to create a Patroller
// Console output:
at Object.newTask (role.patroller:11:28)
at Object.module.exports.loop (main:40:27)
at __mainLoop:1:52
at __mainLoop:2:3
at Object.exports.evalCode (<isolated-vm>:15343:76)
at Object.exports.run (<isolated-vm>:20768:24)
I installed the package as described in README.md (by navigating into the root folder of my AI and running npm install creep-tasks
). Afterwards, I require
'd it in my scripts but Screeps said it could not find the module named creep-tasks
.
Looking at the files installed by npm, only the type definitions were installed. The error might come from this line inside package.json , though I am not at all familiar with npm. I believe "files"
within package.json should contain "src/**/*"
as opposed to "dist/**/*"
.
npm install creep-tasks
Try to run AI using creep-tasks
Failure!
Error: Unknown module 'creep-tasks'
at Object.requireFn (<runtime>:30185:23)
at role.patroller:1:49
at role.patroller:15:3
at Object.exports.evalCode (<runtime>:15727:76)
at Object.requireFn (<runtime>:30203:28)
at main:8:21
at main:184:3
at Object.exports.evalCode (<runtime>:15727:76)
at Object.requireFn (<runtime>:30203:28)
creep-tasks
version: 1.2.0 {You can find this in package.json}
creep-tasks
with: JavaScriptWhen a creep is switching from one task to another the new task is logging the error 'No creep executing taskname!'. Transfers and pickup are sometimes completely skipped by this causing the creep to only properly execute the goTo task.
It seems that the issue is caused because the creep name is undefined when the new task is executed.
Assign multiple tasks to a creep.task with Tasks.chain().
N/A
No creep executing harvest!
No creep executing pickup!
creep-tasks
version: 1.3.0
creep-tasks
with: TypeScripthttps://github.com/bencbartlett/creep-tasks/blob/master/src/creep-tasks/prototypes.ts#L39
It looks like when you assign creep.task, the only thing that gets set is the creep's memory, which then needs to get read again and instantiate a new Task object. What's the reason for this?
Seems odd that the steps are essentially:
// Instantiate new Task object to assign
creep.task = new TaskHarvest();
// Under the hood, this sets
creep.memory.task = task.proto;
// Then when creep,task is read
creep._task = new TaskHarvest() // via the prototask
Why not just set creep._task = task
in the initial setter?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.