pickShipTarget

open fun pickShipTarget(source: ShipAPI, seeks: MagicTargeting.targetSeeking, maxRange: Integer, searchCone: Integer, fighterWeight: Integer, frigateWeight: Integer, destroyerWeight: Integer, cruiserWeight: Integer, capitalWeight: Integer): ShipAPI

Select a proper target from a ship

Return

ShipAPI target

Parameters

source

The ship concerned.

seeks

Does the ship find a random target or tries to hit its selected one?

NO_RANDOM, If the ship has a valid target, the script will return it. If there is no target, it will check for an unselected cursor target. If there is none, it will return its closest valid threat.

LOCAL_RANDOM, If the ship has a target, the script will pick a random valid threat around that one. If the ship has none, the script will pick a random valid threat around the cursor, If none are found, the script will pick a random valid threat around itself, Can produce strange behavior if used with a limited search cone.

FULL_RANDOM, The script will always return a random valid threat around the ship itself.

IGNORE_SOURCE, The script will pick the closest target of interest.

maxRange

Range within which the script seeks a target in game units.

searchCone

Angle within which the script will seek the target. Set to 360 or more to ignore.

fighterWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

frigateWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

destroyerWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

cruiserWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.

capitalWeight

Target priority, set to 0 to ignore that class. Other values only used for random targeting.