Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- EEPROM Bootloader for Kino Drone (Minimalist)
- local drone = component.list("drone")()
- drone = drone and component.proxy(drone)
- local function boot()
- local e = {} -- Event buffer
- local m = component.list("modem")()
- if not m then return end -- No modem found, exit
- local modem = component.proxy(m)
- modem.open(123) -- Open the wireless communication port
- drone.setStatusText("Waiting for Software Update")
- while true do
- local _, _, sender, _, _, message = computer.pullSignal()
- if message == "upload" then
- local program = ""
- while true do
- local _, _, _, _, _, chunk = computer.pullSignal()
- if chunk == "end" then break end -- End of transmission
- program = program .. chunk
- end
- local func, err = load(program)
- if func then
- func() -- Run the Kino script
- else
- modem.broadcast(123, "kino_update_error: " .. err)
- end
- end
- end
- end
- boot()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement