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.

21 lines
484 B

2 years ago
2 years ago
2 years ago
  1. -- This file takes as input a script and a label
  2. -- it will ask the local eeprom machine to flash it to an eeprom
  3. local computer = computer or require("computer")
  4. local webflash = require("webflashlib")
  5. local args = {...}
  6. print("Reading " .. args[1])
  7. local file = assert(io.open(args[1], "rb"))
  8. local bios = file:read("*a")
  9. file:close()
  10. print("Sending " .. tostring(#bios) .. " bytes")
  11. resp, msg = webflash(bios, args[2])
  12. print("Reponse:")
  13. print(resp, msg)
  14. computer.beep(1000)