- #SCREEPS FILTER STRUCTURES INSTALL#
- #SCREEPS FILTER STRUCTURES CODE#
- #SCREEPS FILTER STRUCTURES SIMULATOR#
Used to store scripts, allowing them to be executed later.Usable by AI.get(target, options) or Room.get(target, options) for getting objects.Collects or filters to get certain type of objects.When false it means it has not been able to do the routine.When true it means it has successfully completed its routine.Place to store routines that can be shared to multiple roles of creeps.Called by stage_creeps, the plugin with the corresponding will be executed.Module.exports keys are accessible as AI.Second parameter is a function to spawn something, simply pass a type or a creep memory object.noSpawn: Called when a spawn has nothing to spawn.Since an event can trigger multiple hooks, the new role will only be accepted when the received role is non-conflicting (multiple hooks returning the same result is fine, undefined means withold, all undefined means no role).noRole: Called when a creep has no role.postController: Called before shutting down the AI.preController: Called before giving spawns and creepers orders.firstTurn: Called when the AI is doing its first turn.Used when called by extensions/tools/hooks/flags or AI.exec(.This is how it ends up using the AI.extensions. When generating the extensions, all packages are virtually merged into a single package. thisFileWillBeIgnoredAnyway.js or located in directories starting with a '.'. These files are coming from the extensions/ directory with a structure as _generated is a generated file that only exists in the build/deployįolder when using grunt deploy or grunt codegen Extensions folder structureĪfter using require('_generated') it will expose the extensions as
#SCREEPS FILTER STRUCTURES CODE#
It also includes code from extensions accessible from AI.extensions. The AI object has _settings included as AI.settings, so there is no need to include this file. When the autogenerated main.js gets executed, it will expose an AI object in global scope. _settings.js Drain for global AI settings.All creeps must have a role, or receive a role after being triggered by the noRole event.The private ai code I deploy are just other extensions. Its being executed once a tick in the screeps sandbox.Īlso note that not all code of my current ai are included in this repo. Scripts/main.js is the boot file and is the first user code to be executed, The second file contains settings, allowing to fine tune settings in-game. The first file is an auto generated main.js, which is the compiled version ofĪll the extension directories sticked together. In the current structure there are only 2 files generated for deployment. Grunt test: To make sure that the code is passing the checks
#SCREEPS FILTER STRUCTURES SIMULATOR#
Grunt run: Run the bot in a fake and incomplete simulator
#SCREEPS FILTER STRUCTURES INSTALL#
Then run npm install to install dependencies. Make now sure the terminal is pointing to this project.If you are familiar with git, you can clone from Otherwise you can get the latest code from github.Open a terminal and install grunt with npm like this: npm install -g grunt-cli.
Go to or you could try ? ?.ws/ ? ? ? ? ? ? ? ? Install checklists First install The main goal of this project is to provide a flexible framework for the ai.