// Redesinged script copied from AlienKiller by Yenz // This code almost entirely copied from the AlienKiller script // made by Yenz. I wanted to make a simple cyborg script where // a bot is manually piloted, but has precision aiming. Just run // this script instead of hitting the fire button and the bot // will aim and fire once at the closest alien in front of it. // Dan Newman (daniel_newman@email.com) // // The following changes have been made: // Entire category list fed into radar function // Scan area limited to forward quadrant // Adjusts for pitch gives better accuracy on non-winged bots // Provides warnings for overtemp, shield and energy level extern void object::RoboAim() { object alien; float angle; int alienList[], nr; nr = 0; alienList[nr++] = AlienWasp; alienList[nr++] = AlienAnt; alienList[nr++] = AlienSpider; alienList[nr++] = AlienWorm; alienList[nr++] = AlienEgg; alien = radar(alienList,0,90,0,40); //scan the forward quandrant if(alien != null) //if there still is a alien left { if(distance(position, alien.position) < 35) { turn(direction(alien.position)); angle = atan(((topo(alien.position)+alien.altitude)-(topo(position)+altitude))/distance2d(position, alien.position)); aim(angle-pitch); //aim at the target fire(0.1); //kill it } } else message("No target"); if(temperature > 0.8) message("Engines getting hot"); if(shieldLevel < 0.2) message("Warning-Shield status critical!"); if(energyCell.energyLevel < 0.2) message("Warning-Energy level low!"); }