Instructions
Download and install SCAIEdit 3.1 and an MPQ editor from the Internet. WinMPQ and MPQ Editor are used for viewing and editing the game's MPQ archive files. SCAIEdit is a "StarCraft" AI compiler needed to write AI script files to import into "StarCraft."
Make a backup copy of :Patch_rt.mpq" in your StarCraft directory. The backup ensures that your "StarCraft" install is not ruined in case you make a mistake.
Open your MPQ editor and load "Patch_rt.mpq" from your "StarCraft" directory. Find and extract "scripts\aiscript.bin" to your computer.
Open SCAIEdit to begin writing a new script file. Each line of the script corresponds to an order the AI must complete, such making buildings, upgrades, making units, attacking, and defending.
Enter the line "build 1 nexus 150" for to order the AI to build a Nexus, the most basic Protoss building. If you wish to create a Terran or Zerg AI script, simply change the name of the building. The number "150" refers to the priority of the command, a figure that ranges from 0 to 150.
Enter the line "wait_build 1 nexus" to order the AI to stop doing anything until the Nexus is complete. The line "build 4 probe 150" then orders the AI to build four more Probes as fast as possible. You can add more lines building as many Probes as you feel the computer needs. For future units and buildings, you can use the command "wait_buildstart" instead of "wait_build" to order the AI to continue when a building or unit is started, as opposed to waiting for it to finish. You can also use lower priority values for regular units and buildings and save the "150" value for crucial things like the Nexus and Probes.
Enter the line "train 1 zealot" for unit production. The "train" command refers to attack units, and the AI will take advantage of all of its buildings to train those units. Make sure you order the AI to build enough buildings to support the army size you intend for it to train.
Use this sequence of commands to launch an attack: "attack_add 6 zealot", "attack_prepare", "attack_do" and "attack_clear". These commands first add Zealots to an attack group, then order the attack group to gather in one place and attack. The last command ends the attack once the attacking group is dead. You can order the AI to repeat an attack sequence indefinitely with a GOTO statement. To do this, place a GOTO tag such as ":repeatrush" before your attack commands, and "goto repeatrush" after. The AI will loop the attack over and over again. Make sure you place an order to train more units in your attack loop.
Compile your script in SCAIEdit when you are finished. Name the file "Protoss Expansion Custom Level.asc3" and replace "Protoss" with the race you are using.
Open "aiscript.bin" in SCAIEdit. Find and remove "Protoss Expansion Custom Level" and replace it with your custom-made file. Compile and close the file.
Open "Patch_rt.mpq" in your MPQ editor and find "scripts\aiscript.bin" once again. Remove it and replace it with your edited "aiscript.bin" file. Make sure you add the "scripts\" path to match the old file.
Run "StarCraft" and try playing a map that uses "Protoss Expansion Custom Level" as its primary AI. Your custom AI script should take effect.