SHOW:
|
|
- or go back to the newest paste.
| 1 | local component = require("component")
| |
| 2 | local event = require("event")
| |
| 3 | local serialization= require("serialization")
| |
| 4 | local computer= require("computer")
| |
| 5 | local thread= require("thread")
| |
| 6 | - | local term= require("term")
|
| 6 | + | |
| 7 | local Tn = component.navigation | |
| 8 | - | --local Tn = component.navigation |
| 8 | + | local Tr = component.radar |
| 9 | - | --local Tr = component.radar |
| 9 | + | |
| 10 | local SoldiersChannel = 2413 | |
| 11 | - | local QueensResponseChannel = 2402 |
| 11 | + | |
| 12 | - | local PawnsChannel = 2413 |
| 12 | + | |
| 13 | - | local PawnsResponseChannel = 2403 |
| 13 | + | |
| 14 | local q_firmware = require("queen_firmware")
| |
| 15 | - | local drone_is_queen = true |
| 15 | + | |
| 16 | modem.open(QueensChannel) | |
| 17 | ||
| 18 | q_firmware.broadcastFirmWare(QueensChannel) | |
| 19 | ||
| 20 | - | local flightform = require("flight_formation")
|
| 20 | + | modem.open(SoldiersChannel) |
| 21 | - | local radar_targeting = require("radar_targeting")
|
| 21 | + | modem.broadcast(SoldiersChannel,"Sr= component.proxy(component.list('radar')())")
|
| 22 | - | local GPS = require("GPS")
|
| 22 | + | modem.broadcast(SoldiersChannel,"Sn= component.proxy(component.list('navigation')())")
|
| 23 | - | local GPS_TRG = require("GPS_TRG")
|
| 23 | + | modem.broadcast(SoldiersChannel,"Sd= component.proxy(component.list('drone')())")
|
| 24 | - | local p_firmware = require("pawn_firmware")
|
| 24 | + | modem.broadcast(SoldiersChannel,"function sleep(timeout) checkArg(1, timeout, 'number', 'nil') local deadline = computer.uptime() + (timeout or 0) repeat computer.pullSignal(deadline - computer.uptime()) until computer.uptime() >= deadline end") |
| 25 | - | local formation_generator = require("formation_generator")
|
| 25 | + | |
| 26 | ||
| 27 | - | modem.open(QueensResponseChannel) |
| 27 | + | local pool={}
|
| 28 | - | modem.open(PawnsResponseChannel) |
| 28 | + | |
| 29 | flightformation={}
| |
| 30 | ffbook={flightformation}
| |
| 31 | ffbook[2]={}
| |
| 32 | ffbook[3]={}
| |
| 33 | form1 = {{3,2,-2},{-3,2,-2},{0,2,3}}
| |
| 34 | - | --form1 = {{13,2,-2},{-13,2,-2},{0,2,13}} --bad y gps value
|
| 34 | + | form2 = {{-2,2,2},{2,2,2}}
|
| 35 | - | --form1 = {{3,8,-2},{-3,14,-2},{0,20,3}} -- bad xz gps values
|
| 35 | + | form3 = {{-2,2,-2},{2,2,-2}}
|
| 36 | - | --form1 = {{10,8,-10},{-10,14,0},{5,20,10}}
|
| 36 | + | fbook={form1,form2,form3}
|
| 37 | - | --form1 = {{0,0,0},{5,5,0},{0,10,10},{-15,15,0},{0,20,-20}}
|
| 37 | + | |
| 38 | - | --form1 = {{0,0,0},{2,2,0},{0,4,4},{-8,8,0},{0,10,-10},{12,12,0},{0,14,14},{-16,16,0}}--golden ratio Spiral
|
| 38 | + | |
| 39 | - | actualSatForm = {{0,25,-3},{0,25,3},{3,22,0},{-3,22,0}}-- ComputerCraft Heresy --(Tetrahedron) -- it's actually good for xz coordinates
|
| 39 | + | function killEvent(e) |
| 40 | - | --satff={}
|
| 40 | + | if e then |
| 41 | - | --compensatedSatForm = {{0,25,-2},{0,25,3},{2,22,0},{-3,22,0}}
|
| 41 | + | event.cancel(e) |
| 42 | - | --form1 = {{0,35,-3},{0,30,3},{3,20,0},{-3,25,0}}
|
| 42 | + | |
| 43 | - | --form1 = {{0,35,-5},{0,30,2},{5,20,0},{-2,25,0}}
|
| 43 | + | |
| 44 | - | --form2 = {{-2,10,2},{2,15,2},{0,2,0}}
|
| 44 | + | |
| 45 | - | --form3 = {{-2,20,-2},{2,25,-2}}
|
| 45 | + | msg_reaction = {
|
| 46 | - | --form2 = {{-10,10,10},{10,12,10},{0,5,0}}
|
| 46 | + | ["pkme"] = function(l_add,r_add,port,dist,...) add2Pool(r_add) end, |
| 47 | - | --form3 = {{-10,14,-10},{10,16,-10}}
|
| 47 | + | ["actv"] = function(l_add,r_add,port,dist,...) setAsActive(r_add) end |
| 48 | - | form2 = {{3,0,0},{0,3,0},{0,0,3},{3,0,3},{-3,0,-3}}
|
| 48 | + | } |
| 49 | - | form3 = {{-3,0,0},{0,-3,0},{0,0,-3},{3,3,3},{-3,-3,-3}}
|
| 49 | + | |
| 50 | function msg_handler(evt,l_add,r_add,port,dist,msg,...) | |
| 51 | - | --*************-- |
| 51 | + | if msg_reaction[msg] then |
| 52 | - | --[[ |
| 52 | + | msg_reaction[msg](l_add,r_add,port,dist,...) |
| 53 | - | The radar has an inaccuracy where it recognises two blocks as zeroes in each axis. |
| 53 | + | |
| 54 | - | Drones positioned in coordinates with positive axis components around a target player are actually a block extra away from the origin |
| 54 | + | |
| 55 | - | the given formation array is thus compensated in the formUP function from the flight_formation library |
| 55 | + | |
| 56 | - | ]] |
| 56 | + | local reaction |
| 57 | - | --*************-- |
| 57 | + | function openFlighFormComms() |
| 58 | killEvent(reaction) | |
| 59 | - | fbook={actualSatForm,form2,form3}
|
| 59 | + | reaction = event.listen("modem_message",msg_handler)
|
| 60 | end | |
| 61 | function closeFlighFormComms() --**********************-- | |
| 62 | killEvent(reaction) | |
| 63 | - | print("Bingus30")
|
| 63 | + | |
| 64 | - | function printSwarmStats() |
| 64 | + | |
| 65 | - | term.clear() |
| 65 | + | function populatePool() --**********************-- |
| 66 | - | print("QUEENS:")
|
| 66 | + | --killEvent(reaction) |
| 67 | - | flightform.printDronePool(drone_is_queen) |
| 67 | + | --reaction = event.listen("modem_message",msg_handler)
|
| 68 | - | flightform.printFFAssignment(ffbook) |
| 68 | + | openFlighFormComms() |
| 69 | for i = 0,3 do modem.broadcast(QueensChannel,"inv") end | |
| 70 | os.sleep(1) | |
| 71 | end | |
| 72 | ||
| 73 | - | --local trgChannel = 3 |
| 73 | + | function refreshPool() |
| 74 | --print("refreshing..")
| |
| 75 | --killEvent(reaction) | |
| 76 | - | --trgPortBook = {}--{[trgport]="target"} multiple to fixed single relationship
|
| 76 | + | --reaction = event.listen("modem_message",msg_handler)
|
| 77 | - | trgPortBook = {[3]="Bingus",[4]="Floppa",[5]="FloppaMi",[7]="FloppaNi"}
|
| 77 | + | openFlighFormComms() |
| 78 | for addr,v in pairs(pool) do | |
| 79 | - | Pawnffbook = {}
|
| 79 | + | pool[addr][1] = false |
| 80 | - | Pawnffbook[1] = {}
|
| 80 | + | modem.send(addr,QueensChannel,"stop") |
| 81 | - | Pawnffbook[2] = {}
|
| 81 | + | |
| 82 | - | Pawnffbook[3] = {}
|
| 82 | + | modem.send(addr,QueensChannel,"uok") |
| 83 | - | Pawnffbook[4] = {}
|
| 83 | + | |
| 84 | - | Pawnffbook[5] = {}
|
| 84 | + | |
| 85 | - | Pawnffbook[6] = {}
|
| 85 | + | |
| 86 | - | dynamicTriangle = {{3,2,-2},{-3,2,-2},{0,2,3}}
|
| 86 | + | function add2Pool(addr) |
| 87 | - | --staticTriangle = {{3,2,-2},{-3,2,-2},{0,2,3}}
|
| 87 | + | if pool[addr] then return end |
| 88 | - | --staticTriangle = formation_generator.TriangleFormation("Y:spanX",4,8,2,{x=0,y=2,z=0})
|
| 88 | + | pool[addr]={true,true}
|
| 89 | - | staticTriangle = formation_generator.TriangleFormation("Y:spanX",8,10,2,{x=0,y=2,z=0})
|
| 89 | + | |
| 90 | - | staticTriangle = formation_generator.rotateFormation("X",math.pi/4,staticTriangle)
|
| 90 | + | |
| 91 | - | --staticOrbitTriangle = {{3,2,-2},{-3,2,-2},{0,2,3}}
|
| 91 | + | function setAsActive(addr) |
| 92 | - | --staticOrbitSquare = {{1,1,0},{-1,1,0},{0,1,1},{0,1,-1}}
|
| 92 | + | if pool[addr][1] then return end --if isActive or nil {return}
|
| 93 | - | staticOrbitSquare = formation_generator.hollowSquareFormation("Z",5,5,7,{x=-2,y=0,z=0})
|
| 93 | + | pool[addr][1]=true |
| 94 | - | dynamicOrbitSquareMe = {{1,3,0},{-1,3,0},{0,3,1},{0,3,-1}}
|
| 94 | + | |
| 95 | - | dynamicTriangleMe = {{3,4,-2},{-3,4,-2},{0,4,3}}
|
| 95 | + | |
| 96 | - | --Pawnform1 = {{0,2,0}}
|
| 96 | + | function add2FF(ff,f,addr) |
| 97 | - | Pawnfbook = {dynamicTriangle,staticTriangle,staticOrbitSquare,dynamicOrbitSquareMe,dynamicTriangleMe}
|
| 97 | + | if not next(f) then return end |
| 98 | - | Pawndynamic_fbook = Pawnfbook |
| 98 | + | if ff[addr] then return end |
| 99 | ff[addr] = table.remove(f) | |
| 100 | - | ring = formation_generator.circleFormation("Y",10,{x=0,y=0,z=7})
|
| 100 | + | modem.send(addr,QueensChannel,"commit") |
| 101 | - | ring2 = formation_generator.circleFormation("Y",10,{x=0,y=0,z=7})
|
| 101 | + | pool[addr][2]=false |
| 102 | - | hollow_square = formation_generator.hollowSquareFormation("Y",3,3,7,{x=-1,y=0,z=-1})
|
| 102 | + | |
| 103 | - | triangle = formation_generator.TriangleFormation("Y:spanX",2,4,2,{x=0,y=2,z=0})
|
| 103 | + | |
| 104 | - | rotated_hsqr = formation_generator.rotateFormation("Z",math.pi/4,hollow_square)
|
| 104 | + | function populateFF(ff,f) |
| 105 | for addr,v in pairs(pool) do | |
| 106 | - | dynamicTriangle = formation_generator.TriangleFormation("X:spanZ",1,2,3,{x=-1,y=1,z=0})
|
| 106 | + | if v[1] and v[2] then add2FF(ff,f,addr) end |
| 107 | - | dynamicTriangle2 = formation_generator.TriangleFormation("X:spanZ",1,2,3,{x=-1,y=-1,z=0})
|
| 107 | + | if not next(f) then return end |
| 108 | - | for k,v in ipairs(dynamicTriangle2) do |
| 108 | + | |
| 109 | - | table.insert(dynamicTriangle,v) |
| 109 | + | |
| 110 | - | end |
| 110 | + | |
| 111 | function pruneFF(ff,f) | |
| 112 | - | --numbering must be the same with ffbook, can't regen otherwise: |
| 112 | + | for addr,v in pairs(ff) do |
| 113 | - | PawnGeneratedFormBook = {{},{},{},ring,ring2,dynamicTriangle,hollow_square,triangle,rotated_hsqr}
|
| 113 | + | if pool[addr] then |
| 114 | - | dynamicPawnPyramidBook = PawnGeneratedFormBook |
| 114 | + | if not pool[addr][1] then |
| 115 | table.insert(f,1,ff[addr]) | |
| 116 | - | --[[ |
| 116 | + | ff[addr] = nil |
| 117 | - | For Floppa: |
| 117 | + | modem.send(addr,QueensChannel,"uncommit") |
| 118 | - | Pawnffbook[1] = Pawndynamic_fbook[1] = dynamicTriangle |
| 118 | + | pool[addr][2]=true |
| 119 | - | Static: |
| 119 | + | end |
| 120 | - | Pawnffbook[2] = Pawndynamic_fbook[2] = staticTriangle |
| 120 | + | |
| 121 | - | Pawnffbook[3] = Pawndynamic_fbook[3] = staticOrbitSquare |
| 121 | + | |
| 122 | - | Follow Me: |
| 122 | + | |
| 123 | - | Pawnffbook[4] = PawnGeneratedFormBook[4] = ring |
| 123 | + | |
| 124 | - | Pawnffbook[5] = PawnGeneratedFormBook[5] = ring2 |
| 124 | + | function refreshFF(ff,f) --**********************-- |
| 125 | - | Pawnffbook[6] = PawnGeneratedFormBook[6] = dynamicTriangle |
| 125 | + | print("refreshingFF..")
|
| 126 | - | ]] |
| 126 | + | refreshPool() |
| 127 | - | trgPortBookME = {[11]="ph0",[12]="ph0",[13]="ph0"}
|
| 127 | + | os.sleep(1) |
| 128 | - | StaticFormationtrgPortBook = {[8]="team1",[10]="team2"}
|
| 128 | + | pruneFF(ff,f) |
| 129 | populateFF(ff,f) | |
| 130 | - | function printSwarmStatsPawn() |
| 130 | + | |
| 131 | - | term.clear() |
| 131 | + | |
| 132 | - | print("PAWNS:")
|
| 132 | + | function formFF(ff,f) --**********************-- |
| 133 | - | flightform.printDronePool(false) |
| 133 | + | populateFF(ff,f) |
| 134 | - | flightform.printFFAssignment(Pawnffbook) |
| 134 | + | refreshFF(ff,f) |
| 135 | end | |
| 136 | function formUP(e_name,ff,f) --**********************-- | |
| 137 | for addr,pos in pairs(ff) do | |
| 138 | modem.send(addr,QueensChannel,"formup",e_name,pos[1],pos[2],pos[3]) | |
| 139 | end | |
| 140 | - | |
| 140 | + | |
| 141 | - | -- QUEEN Commands |
| 141 | + | |
| 142 | - | if(cmd == "F") then |
| 142 | + | function breakFormation(ff,f) --**********************-- |
| 143 | - | q_firmware.broadcastFirmWare(QueensChannel) |
| 143 | + | for addr,pos in pairs(ff) do |
| 144 | table.insert(f,1,ff[addr]) | |
| 145 | - | elseif(cmd == "G") then |
| 145 | + | ff[addr]=nil |
| 146 | modem.send(addr,QueensChannel,"uncommit") | |
| 147 | pool[addr][2]=true | |
| 148 | end | |
| 149 | refreshPool() | |
| 150 | end | |
| 151 | print("Bingus28")
| |
| 152 | ||
| 153 | ||
| 154 | local gpsChannel = 2 | |
| 155 | local trgChannel = 2472 | |
| 156 | ||
| 157 | ||
| 158 | function gpsBroadcast(gps_port) | |
| 159 | while true do | |
| 160 | - | flightform.populatePool(QueensChannel,drone_is_queen) |
| 160 | + | modem.broadcast(gps_port,"gps",0,0,0) |
| 161 | --print("broadcasting..")
| |
| 162 | - | printSwarmStats() |
| 162 | + | os.sleep() |
| 163 | end | |
| 164 | end | |
| 165 | ||
| 166 | - | flightform.refreshFFT(ffbook,dynamic_fbook,QueensChannel,drone_is_queen) |
| 166 | + | local gpsThread |
| 167 | - | flightform.formFF(ffbook[1],dynamic_fbook[1],QueensChannel,drone_is_queen) |
| 167 | + | local sat_mode = false |
| 168 | - | flightform.QformUP("ph0",ffbook[1],QueensChannel)
|
| 168 | + | function toggleGPSBroadCast(channel) --**********************-- |
| 169 | - | printSwarmStats() |
| 169 | + | sat_mode = not sat_mode |
| 170 | print("sat_mode: "..tostring(sat_mode))
| |
| 171 | if sat_mode then | |
| 172 | - | flightform.refreshFFT(ffbook,dynamic_fbook,QueensChannel,drone_is_queen) |
| 172 | + | print("creating GPS Thread..")
|
| 173 | - | flightform.formFF(ffbook[2],dynamic_fbook[2],QueensChannel,drone_is_queen) |
| 173 | + | gpsThread = thread.create(function(port) gpsBroadcast(port) end,channel) |
| 174 | - | flightform.formFF(ffbook[3],dynamic_fbook[3],QueensChannel,drone_is_queen) |
| 174 | + | |
| 175 | - | flightform.QformUP("ph0",ffbook[2],QueensChannel)
|
| 175 | + | gpsThread:kill() |
| 176 | - | flightform.QformUP("ph0",ffbook[3],QueensChannel)
|
| 176 | + | |
| 177 | - | printSwarmStats() |
| 177 | + | |
| 178 | ||
| 179 | function getPlayerCoord(e_name) | |
| 180 | checkArg(1,e_name,'string','nil') | |
| 181 | - | flightform.breakFormation(ffbook[i],dynamic_fbook[i],QueensChannel,drone_is_queen) |
| 181 | + | for k,v in ipairs(Tr.getPlayers()) do |
| 182 | if v.name == e_name then | |
| 183 | - | printSwarmStats() |
| 183 | + | return {v.x,v.y,v.z},v.distance
|
| 184 | end | |
| 185 | end | |
| 186 | - | flightform.refreshFFT(ffbook,dynamic_fbook,QueensChannel,drone_is_queen) |
| 186 | + | return {0,0,0},0
|
| 187 | - | printSwarmStats() |
| 187 | + | |
| 188 | ||
| 189 | - | elseif(cmd == "PRINTQ") then --printGroup |
| 189 | + | function trgBroadcast(e_name) |
| 190 | - | printSwarmStats() |
| 190 | + | while true do |
| 191 | local player_co = getPlayerCoord(e_name) | |
| 192 | player_co = s_utils.vec_trunc(player_co) | |
| 193 | modem.broadcast(trgChannel,"trg",player_co[1],player_co[2],player_co[3]) | |
| 194 | --print("broadcasting target..")
| |
| 195 | os.sleep() | |
| 196 | - | elseif(cmd == "HUSH") then |
| 196 | + | |
| 197 | - | modem.broadcast(QueensChannel,"HUSH") |
| 197 | + | |
| 198 | local trgThread | |
| 199 | - | |
| 199 | + | local send_trg = false |
| 200 | - | elseif(cmd == "GPS") then -- activate QUEEN satellite GPS broadcasting |
| 200 | + | function toggleTargetBroadCast(target) --**********************-- |
| 201 | - | for addr,c in pairs(ffbook[1]) do |
| 201 | + | send_trg = not send_trg |
| 202 | - | print(addr,c) |
| 202 | + | print("send_trg: "..tostring(send_trg))
|
| 203 | - | modem.send(addr,QueensChannel,"setgpspos",_,c[1],c[2],c[3]) |
| 203 | + | if send_trg then |
| 204 | print("creating GPS Thread..")
| |
| 205 | - | modem.broadcast(QueensChannel,"startgps") |
| 205 | + | trgThread = thread.create(function(t) trgBroadcast(t) end,target) |
| 206 | else | |
| 207 | trgThread:kill() | |
| 208 | - | |
| 208 | + | |
| 209 | - | --PAWN Commands |
| 209 | + | |
| 210 | - | |
| 210 | + | |
| 211 | - | |
| 211 | + | |
| 212 | - | elseif(cmd == "K") then -- terminate GPS targeting thread |
| 212 | + | |
| 213 | - | GPS_TRG.killGPSTRGThread(gpsChannel) |
| 213 | + | |
| 214 | ||
| 215 | if(cmd == "G") then | |
| 216 | - | elseif(cmd == "A") then -- form triangle on Floppa with PAWNS |
| 216 | + | |
| 217 | - | local targetingChannel = 4 |
| 217 | + | |
| 218 | - | --flightform.refreshFFT(Pawnffbook,Pawndynamic_fbook,PawnsChannel,false)-- use RPE |
| 218 | + | |
| 219 | - | flightform.formFF(Pawnffbook[1],Pawndynamic_fbook[1],PawnsChannel,false) |
| 219 | + | |
| 220 | - | flightform.PformUP(targetingChannel,Pawnffbook[1],PawnsChannel) |
| 220 | + | |
| 221 | - | printSwarmStatsPawn() |
| 221 | + | |
| 222 | os.sleep(0.5) | |
| 223 | - | |
| 223 | + | |
| 224 | - | elseif(cmd == "TRG") then -- start entity (Floppa) targeting broadcast |
| 224 | + | |
| 225 | - | local targetingChannel = 4 |
| 225 | + | |
| 226 | - | GPS_TRG.updateGPSTRGsPRINT(trgPortBook,gpsChannel,{[targetingChannel]=0},{[targetingChannel]="Y"},{[targetingChannel]=0})
|
| 226 | + | |
| 227 | elseif(cmd == "P") then --refreshFormation | |
| 228 | - | |
| 228 | + | populatePool() |
| 229 | - | elseif(cmd == "SFP") then -- Static Formation PAWNS |
| 229 | + | os.sleep(0.5) |
| 230 | - | local targetingChannel = 8 |
| 230 | + | |
| 231 | - | --modem.broadcast(targetingChannel,"stop") |
| 231 | + | formFF(ffbook[1],dynamic_fbook[1]) |
| 232 | - | --flightform.refreshFFT(Pawnffbook,Pawndynamic_fbook,PawnsChannel,false)-- use RPE |
| 232 | + | formUP("ph0",ffbook[1],dynamic_fbook[1])
|
| 233 | - | flightform.formFF(Pawnffbook[2],Pawndynamic_fbook[2],PawnsChannel,false) |
| 233 | + | |
| 234 | - | flightform.PformUP(targetingChannel,Pawnffbook[2],PawnsChannel) |
| 234 | + | |
| 235 | - | --flightform.POrbit(targetingChannel,Pawnffbook[2],PawnsChannel) |
| 235 | + | formFF(ffbook[2],dynamic_fbook[2]) |
| 236 | formFF(ffbook[3],dynamic_fbook[3]) | |
| 237 | - | |
| 237 | + | formUP("ph0",ffbook[2],dynamic_fbook[2])
|
| 238 | - | elseif(cmd == "USFP") then -- Update Static Formation PAWNS |
| 238 | + | formUP("ph0",ffbook[3],dynamic_fbook[3])
|
| 239 | - | local targetingChannel = 8 |
| 239 | + | |
| 240 | - | modem.broadcast(targetingChannel,"color",0xBC18FB) |
| 240 | + | |
| 241 | - | GPS_TRG.updateStaticGPS(targetingChannel,gpsChannel,{[targetingChannel]=0},{[targetingChannel]="Y"},{[targetingChannel]=0})
|
| 241 | + | |
| 242 | breakFormation(ffbook[i],dynamic_fbook[i]) | |
| 243 | end | |
| 244 | - | elseif(cmd == "SRFP") then -- Static Rotating Formation PAWNS |
| 244 | + | killEvent(reaction) |
| 245 | - | local targetingChannel = 10 |
| 245 | + | |
| 246 | - | --modem.broadcast(targetingChannel,"stop") |
| 246 | + | |
| 247 | - | --flightform.refreshFFT(Pawnffbook,Pawndynamic_fbook,PawnsChannel,false)-- use RPE |
| 247 | + | |
| 248 | - | flightform.formFF(Pawnffbook[3],Pawndynamic_fbook[3],PawnsChannel,false) |
| 248 | + | refreshFF(ffbook[i],dynamic_fbook[i]) |
| 249 | - | flightform.POrbit(targetingChannel,Pawnffbook[3],PawnsChannel) |
| 249 | + | |
| 250 | - | os.sleep(0.5) |
| 250 | + | |
| 251 | - | |
| 251 | + | elseif(cmd == "PRINT") then --printGroup |
| 252 | - | elseif(cmd == "USRFP") then -- Update Static Rotating Formation PAWNS |
| 252 | + | for k,v in pairs(pool) do |
| 253 | - | local targetingChannel = 10 |
| 253 | + | print(k.." :: "..tostring(v[1]).." "..tostring(v[2])) |
| 254 | - | local rotationAngleInterval = math.pi/8 |
| 254 | + | |
| 255 | - | local tiltAngle = math.pi/4 |
| 255 | + | print(tostring(groupSize)) |
| 256 | - | modem.broadcast(targetingChannel,"color",0xF78E1E) |
| 256 | + | |
| 257 | - | GPS_TRG.updateStaticGPS(targetingChannel,gpsChannel,{[targetingChannel]=rotationAngleInterval},{[targetingChannel]="X"},{[targetingChannel]=tiltAngle})
|
| 257 | + | print("ffbook["..i.."]:")
|
| 258 | - | os.sleep(0.5) |
| 258 | + | for k,v in pairs(ffbook[i]) do |
| 259 | - | |
| 259 | + | print(k.." :: "..tostring(v[1]).." "..tostring(v[2]).." "..tostring(v[3])) |
| 260 | - | elseif(cmd == "RM") then -- Rotating on Me |
| 260 | + | end |
| 261 | - | local targetingChannel1 = 11 |
| 261 | + | |
| 262 | - | local targetingChannel2 = 12 |
| 262 | + | |
| 263 | - | local targetingChannel3 = 13 |
| 263 | + | elseif(cmd == "GPS") then |
| 264 | - | --modem.broadcast(targetingChannel1,"stop") |
| 264 | + | toggleGPSBroadCast(gpsChannel) |
| 265 | - | --modem.broadcast(targetingChannel2,"stop") |
| 265 | + | |
| 266 | - | --modem.broadcast(targetingChannel3,"stop") |
| 266 | + | elseif(cmd == "TRG") then |
| 267 | - | |
| 267 | + | toggleTargetBroadCast("ph0")
|
| 268 | - | --flightform.refreshFFT(Pawnffbook,dynamicPawnPyramidBook,PawnsChannel,false) -- use RPM |
| 268 | + | |
| 269 | - | |
| 269 | + | |
| 270 | - | --[[ |
| 270 | + | |
| 271 | - | flightform.formFF(Pawnffbook[4],Pawndynamic_fbook[4],PawnsChannel,false) |
| 271 | + | |
| 272 | - | flightform.POrbit(targetingChannel,Pawnffbook[4],PawnsChannel) |
| 272 | + | |
| 273 | - | |
| 273 | + | |
| 274 | - | flightform.formFF(Pawnffbook[5],Pawndynamic_fbook[5],PawnsChannel,false) |
| 274 | + | closeFlighFormComms() |
| 275 | - | flightform.PformUP(targetingChannel,Pawnffbook[5],PawnsChannel) |
| 275 | + | |
| 276 | - | ]] |
| 276 | + | |
| 277 | - | ----flightform.formFF(Pawnffbook[4],dynamicPawnPyramidBook[2],PawnsChannel,false) |
| 277 | + | |
| 278 | - | flightform.formFF(Pawnffbook[4],dynamicPawnPyramidBook[4],PawnsChannel,false) |
| 278 | + | |
| 279 | - | flightform.formFF(Pawnffbook[5],dynamicPawnPyramidBook[5],PawnsChannel,false) |
| 279 | + | |
| 280 | - | flightform.formFF(Pawnffbook[6],dynamicPawnPyramidBook[6],PawnsChannel,false) |
| 280 | + |