local main_loop = loadfile("squirrelscripts/main_ai_loop.nut");
dofile("squirrelscripts/ai_functions.nut");

function init() {
	local planet_pos = player_squads[0].get_pos();
	foreach(squad in my_squads) {
		type = squad.get_type();
		if (type == 2 || type == 3)
			squad.select();
	}
	order_move(planet_pos[0], planet_pos[1]);
	
	timer <- 500;
}

function run_ai() {
	check_for_launch_defence();
	if (world_frame_counter() > timer) {
		local player_pos = any_player_big_ship();
		launch_attack_wave(player_pos, 2);
		//1 minute
		timer = world_frame_counter() + 1800;
	}
}

main_loop();

