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

NEXUS.infiltrate.js

Infiltrate commonly used Warzone JS API events.

 

Infiltrations

This subroutine will infiltrate the following standard JS API Events & Timers, triggering a task whenever the infiltrated event is triggered.

Task IDs are determined with the following formula:

taskID = prefix + objectKey

The 'prefix' associated with an event is shown in the table below.

The 'objectKey' is optional – if you have installed a Classify Subroutine it will be whatever the routine returns, otherwise it will be omitted.

Infiltrated EventAutomaticTask ID prefixNotes
eventAttacked()(tick)attacked 
eventDestroyed()(tick)destroyedIt should be noted that the ".player" property for destroyed FEATURE objects will always be the value of "me".
eventDroidBuilt()(tick)droidBuilt 
eventGameInit()(tick)gameInit

Will only be called once, when the scripting engine is initialised.

NEXUS must infiltrate the event prior to this point for the event to be absorbed.

eventObjectSeen()(tick)objectSeen 
eventObjectTransfer()(tick)objectTransfer

(info) A custom taskID is used for this event (see below).

eventResearched()(tick)researched 
eventStartLevel()(tick)startLevel

Will only be called once, when all players are ready to engage in battle.

NEXUS must infiltrate the event prior to this point for the event to be absorbed.

eventStructureBuilt()(tick)structureBuilt 
eventStructureReady()(tick)structureReadyThis usually refers to the Laser Satellite being ready for action.

Custom events

Two custom tasks are defined for object transfers:

  • objectTransfer.droid.from – you have gained a droid
  • objectTransfer.droid.to – you have lost a droid

The .player property of the object associated with the event will indicate who the droid was taken from or who it was given to. There is no separate "from" argument (like there is in the JS API) because the event key in combination with the .player property provides all required information about the transfer.

Note that the droid object will not be further classified, even if you have a Classify Subroutine installed. If you want to get the object key for the transferred droid, you can call .classify() separately.

If you have installed NEXUS.suffix.js, or some other similar suffix, you will get more descriptive event keys such as:

  • objectTransfer.droid.from.Enemy – you stole a droid from an enemy using Nexus Link. Dr. Reed will be pleased.
  • objectTransfer.droid.from.Ally – an ally gifted you a droid
  • objectTransfer.droid.to.Enemy – an enemy stone a droid from you using Nexus link
  • objectTransfer.droid.to.Ally – you gifted an ally a droid

Examples

Assuming you've installed NEXUS.classify.js and NEXUS.suffix.js, you can register event listeners as follows:

 // example to follow
Requires latest version of Util.js to be included prior to including this file.

Contents

Assimilate:

Subroutines

Absorb:

Memory Banks

Observe: