(lightbulb) Looking for info on the NEXUS faction in the game? It's in the Warzone Encyclopaedia

Infiltrate Subroutines

Hook in to external events and functions.

 

Purpose

When a system is infiltrated, NEXUS will automatically trigger tasks whenever the infiltrated system is called.

The most common scenario is where NEXUS will infiltrate standard JS API Events & Timers, and automatically generate a Task ID and then trigger that task.

The subroutines to the left provide some ready-made infiltration routines.

Build your own

If you don't care about re-usability, you could just consider calling NEXUS() directly to trigger tasks.

However, if you want to do things in a more consistent, sharable way, you'll need to make a subroutine like this:

void (function() {
 
  // /////////////////////////////////////////////////////////////////
  // PRIVATE VARS

  var chimp = "hairy"; // just an example :p
 
  // /////////////////////////////////////////////////////////////////
  // SYSTEM DATA & INFILTRATION CODE

  var system = {};
 
  system.name = "whatever"; // the name of the system to be infiltrated
 
  system.manual = true; // if present, NEXUS.infiltrate() will skip this system          
 
  // in following functions:
  //  * systemName = system.name (useful if reusing same functions for multiple systems)
  //  * obj = (optional) object associated with the system
 
  // functions will be scoped to NEXUS instance (this == NEXUS)
  system.test = function(systemName, obj) { // optional test function
    // code here to determine if we can infiltrate
    // return true if we can/should connect
  }
 
  system.connect = function(systemName, obj) { // connect/infiltrate function
    // connect to and infiltrate the system here
    // return true if success
  }
 
  system.disconnect = function(systemName, obj) { // optional disconnect function
    // disconnect from system here
    // return true if success
  }
 
  // /////////////////////////////////////////////////////////////////
  // PRIVATE FUNCTIONS
 
  var isFoo = function(foo) { // just an example :p
    return (foo != "bar");
  }
 
  // install the uplink
  NEXUS.infiltrate[system.name] = system;
 
})(); 

The "obj" argument of the test(), connect() and disconnect() functions is optional, and will only be passed in when doing manual infiltrations. For more information on manual vs. automatic infiltration, see .infiltrate().

If you want to be super-helpful to other people looking at your code:

  1. Make it easy to understand!
  2. Provide sample code to do the infiltration
  3. Specify the event keyword used by the infiltration
  4. Show an example of handing such an event

File name convention

Classify mods use the following naming convention: "NEXUS.infiltrate_modName.js", where "modName" is the name of your mod.

If you are creating lots of small infiltration routines, you could replace modName with the name of the system being infiltrated.

Subroutines

Absorb:

Memory Banks

Observe: