DRONES
Posted: Tue Mar 18, 2014 11:46 pm
DRONE
IT'S ALIVE!11!!!!12@#!21
- Code:
- ---------DRONE
---------work of Thomas of Hilo, pseudonym tazinator
---------based on Trollbot by fordcars
---------follows PLAYER ships only!
---------change ship to core if you want to play Mothership :)
items = { }
function getName() -- Called once
return("Drone")
end
function main() -- This is the first code ran, after loose code
targetShip = nil
speed = .8
end
function onTick()
table.clear(items)
targetShip = findClosest(findAllObjects(items, ObjType.Ship))
if(targetShip ~= nil) then
local targetShiploc = targetShip:getLoc()
local angle = targetShip:getAngle()
if(bot:canSeePoint(targetShiploc)) then
bot:setThrust(0.6, targetShiploc ) --moves .8 speed toward point
bot:setAngle(angle)
bot:fireWeapon(Weapon.Phaser)
else
bot:setAngle(angle)
bot:fireWeapon(Weapon.Phaser)
end
end
end
IT'S ALIVE!11!!!!12@#!21