OpenComputers Von Neumann Machine Programs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
430 B

1 year ago
  1. local computer = computer or require("computer")
  2. local net = net or require("net")
  3. local WEB_FLASH_PORT = 30
  4. local function webflash(bytes, label)
  5. if label == nil then
  6. net.broadcast(WEB_FLASH_PORT, "/flash", bytes)
  7. else
  8. net.broadcast(WEB_FLASH_PORT, "/flash", bytes, label)
  9. end
  10. local pkt, err = net.recv{WEB_FLASH_PORT}
  11. return pkt.data[1], tostring(pkt.data[2])
  12. end
  13. return webflash