Advertisement
Guest User

test.bios

a guest
Aug 2nd, 2015
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 KB | None | 0 0
  1. --Network Drone
  2. --For OC
  3. --Kirara Hardcore Black Team
  4. --test version not for relese
  5.  
  6. local function proxyFor(name, required)
  7.   local address = component and component.list(name)()
  8.   if not address and required then
  9.     error("missing component '" .. name .. "'")
  10.   end
  11.   return address and component.proxy(address) or nil
  12. end
  13.  
  14. local drone = proxyFor("drone", true)
  15. local eeprom = proxyFor("eeprom", true)
  16.  
  17. -- Colors used to indicate different states of operation.
  18. local colorCharing = 0xFF0000
  19. local colorSearching = 0xFF0000
  20. local colorDelivering = 0x0000FF
  21.  
  22. local i = 1
  23. local data = nil
  24. while true do
  25.   data = eeprom.getData()
  26.   drone.setStatusText(tostring(data))
  27.   computer.pullSignal(2)
  28.   i = i + 1
  29.   if data ~= nil then
  30.     drone.setLightColor(colorSearching)
  31.     data = tostring(i+tonumber(data))
  32.     eeprom.setData(data)
  33.   else
  34.     drone.setLightColor(colorDelivering)
  35.     data = tostring(i)
  36.     eeprom.setData(data)
  37.   end
  38.   drone.setStatusText(i.." | "..data)
  39. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement