# Start AI

Grammar — Start AI for player player in mode mode with APM Actions Per Minute
FlagsNative | Action

Starts the AI for a player in either campaign or melee mode, limiting the computer’s actions per minute to the specified number.

# Arguments

  • int — Player
  • bool [ preset::AIMode ] — Mode
  • int — APM

Returns — void

native void AIStart(int player, bool isCampaign, int apm);

Category: AI Advanced / Utility / Actions

# Examples

# mods/core.sc2mod

BaseAI.galaxy

// L107
AIStart(player, false, DifficultyAPM(diff))
// L244
AIStart(player, true, DifficultyAPM(diff))
// L143
AIStart(player, false, DifficultyAPM(diff))
// L287
AIStart(player, true, DifficultyAPM(diff))