here’s my shitty code if anyone wants to replicate the system
homePos = vector.new(14,61,40)
radar = peripheral.wrap("left")
azimuth = peripheral.wrap("right")
elevation = peripheral.wrap("bottom")
result = radar.scan(50)[1]
if not (result == "no ships") then
--real code moment
for i=1,#result do
aimPos = vector.new(result[i].position.x,result[i].position.y,result[i].position.z)
aimOffset = homePos:sub(aimPos)
print(aimOffset:tostring())
aimAngle = math.deg(math.atan2(aimOffset.z,aimOffset.x))
print(aimAngle)
--that bitch pythagoras won't see this coming
aimDist = math.sqrt((aimOffset.x^2)+(aimOffset.z^2))
elevAngle = math.deg(math.atan2(aimOffset.y,aimDist))
print("lv"..elevAngle)
--flip check
if aimAngle <=0 then flipX = 1 else flipX = -1 end
if elevAngle <=0 then flipY = 1 else flipY = -1 end
--Test Fire
redstone.setBundledOutput("top",colors.orange)
azimuth.rotate(aimAngle*7.65,flipX)
elevation.rotate(elevAngle*7.65,flipY)
sleep(1)
redstone.setBundledOutput("top",colors.orange+colors.white)
sleep(4)
redstone.setBundledOutput("top",0)
sleep(.1)
end
end```