From 40b5f9f86c4353e1b490962913ee97e4a6883f80 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Sun, 18 Nov 2018 00:33:30 +0800 Subject: [PATCH] Update Drone Bios --- drone_bios.lua | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/drone_bios.lua b/drone_bios.lua index 2fef908..0a0eafe 100644 --- a/drone_bios.lua +++ b/drone_bios.lua @@ -1,25 +1,3 @@ -local drone=component.proxy(component.list("drone")()) -local network=component.proxy(component.list("tunnel")()) - -while true do - local evt,_,sender,port,dist,cmd=computer.pullSignal() - if(evt=="modem_message") then - local xok,xresult=pcall(function() - local ok,result=pcall(load(cmd)) - if(ok) then - network.send(result) - else - network.send("Command Execute Failed: " .. result) - end - end) - if(not xok) then - network.send("Internal Error: " .. xresult) - end - end -end - ------------------------------------- - drone=component.proxy(component.list("drone")()) drone.setStatusText("Drone v3.0") modem=component.proxy(component.list("modem")()) @@ -66,27 +44,4 @@ end while true do handle_event(table.pack(computer.pullSignal())) -end - -------------------------- ---- sleep implementation for drone -------------------------- - -sleep=function(sec) - local deadline=computer.uptime() + sec - while true do - local raw_event=table.pack(computer.pullSignal(deadline-computer.uptime())) - if(raw_event[1]==nil) then break - else handle_event(raw_event) - end - end -end - ------------------------------------- --- Wireless ADS Sender (Running on Computer) ------------------------------------- - -while true do - component.modem.broadcast(101,"ads_tower","MainCity") - os.sleep(1) end \ No newline at end of file