From 867205c1b6e96136b5fd0cf67e6c663ec0bf25e6 Mon Sep 17 00:00:00 2001 From: Innovation Inc Date: Thu, 7 Jan 2021 18:09:10 -0600 Subject: [PATCH] Update drone.lua --- drone.lua | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/drone.lua b/drone.lua index f9ef2e9..0a2b064 100644 --- a/drone.lua +++ b/drone.lua @@ -11,7 +11,7 @@ local str = string local fwaddress = "https://raw.githubusercontent.com/DremOSDeveloperTeam/opencomputers-drone/master/drone.lua" local commport = 6500 local idle_color = 0xFF00FF -local cmdrec_color = 0xFFFFFF +local cmdrec_color = 0xFF00FF local cmdacc_color = 0xFFFFFF t.open(6500) @@ -49,31 +49,39 @@ while true do t.broadcast(commport, "Update process done! Please reboot the drone for changes to take effect.") end if cmd == "gst" then -- Get Status Text - t.broadcast(commport, d.name(),"gst",d.getStatusText()) + t.broadcast(commport, d.name(),"up",d.getStatusText()) end if cmd == "sst" then -- Set Status Text - t.broadcast(commport, d.name(),"sst",d.setStatusText(a)) + t.broadcast(commport, d.name(),"up",d.setStatusText(a)) + end + if cmd == "gpn" then -- Get Port Number + t.broadcast(commport, d.name(),"up",commport) + end + if cmd == "spn" then -- Set Port Number + if a ~= nil and a ~= '' then + commport = a + end end if cmd == "mov" then -- MOVe d.move(a,b,c) end if cmd == "gos" then -- Get OffSet - t.broadcast(commport, d.name(),"gos",d.getOffset()) + t.broadcast(commport, d.name(),"up",d.getOffset()) end if cmd == "gve" then -- Get VElocity - t.broadcast(commport, d.name(),"gv",d.getVelocity()) + t.broadcast(commport, d.name(),"up",d.getVelocity()) end if cmd == "gmv" then -- Get Max Velocity - t.send(commport, d.name(),"gmv",d.getMaxVelocity()) + t.send(commport, d.name(),"up",d.getMaxVelocity()) end if cmd == "gac" then -- Get ACceleration - t.broadcast(commport, d.name(),"ga",d.getAcceleration()) + t.broadcast(commport, d.name(),"up",d.getAcceleration()) end if cmd == "sac" then -- Set ACceleration d.setAcceleration(a) end if cmd == "glc" then -- Get Light Color - t.broadcast(commport, d.name(),"glc",d.getLightColor()) + t.broadcast(commport, d.name(),"up",d.getLightColor()) end if cmd == "slc" then -- Set Light Color (RGB is important!) if b ~= nil and b ~= '' then @@ -90,31 +98,31 @@ while true do end if cmd == "eif" then -- External Inventory Find (Instead of detect) local b, s = d.detect(a) - t.broadcast(commport, d.name(),"dct",b,s) + t.broadcast(commport, d.name(),"up",b,s) end if cmd == "eco" then -- External inventory COmpare - t.broadcast(commport, d.name(),"c",d.compare(a)) + t.broadcast(commport, d.name(),"up",d.compare(a)) end if cmd == "esu" then -- External inventory SUck o = d.suck(a, b) - t.broadcast(commport, o) + t.broadcast(commport, d.name, "up", o) end if cmd == "edr" then -- External inventory DRop o = d.drop(a, b) - t.broadcast(commport, o) + t.broadcast(commport, d.name(), "up", o) end if cmd == "igs" then -- Internal inventory Get Slot - t.broadcast(commport, d.select()) + t.broadcast(commport, d.name(), "up", d.select()) end if cmd == "iss" then -- Internal inventory Set Slot - o = d.select(a) - t.broadcast(commport, o) + o = d.select(a) + --t.broadcast(commport, d.name(), "up", o) end if cmd == "gis" then -- Get Inventory Size - t.broadcast(commport, d.inventorySize()) + t.broadcast(commport, d.name(), "up", d.inventorySize()) end if cmd == "gsr" then -- Get Slot space Remaining - t.broadcast(commport, d.space(a)) + t.broadcast(commport, d.name(), "up", d.space(a)) end end end