This AI is still in early stages of development.
Players.scavenger
Returns the players object associated with the Scavenger faction, even if Scavengers are disabled.
Syntax
var scavs = Players.scavenger; // returns scav players objectReturn value
The Players Object associated with the Scavenger faction.
Notes
The Players Object will be returned even if Scavengers are not present on the map.
This is useful because the players object's .isAlive property is a much more accurate and concise way to determine if there are Scavengers roaming the map than using the native scavengers and scavengerPlayer globals:
It checks to see if Scavengers are enabled on the map first
If they are, it checks to see if they actually have any structures or droids
The result is cached to keep performance high
Scavengers don't have a start position, so:
Players.scavenger.position == undefined
Example
Are Scavengers roaming the map?
var scavsRoamingMap = Players.scavenger.isAlive;