Advertisement
thatparadox

SpatialDiskChecker v1.1

Jul 28th, 2015
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.05 KB | None | 0 0
  1. --item.SpatialStorageCell.16Cubed
  2.  
  3. ECInput = peripheral.wrap("top")
  4. ECOutput = peripheral.wrap("bottom")
  5. ioPort = peripheral.wrap("right")
  6.  
  7. freqRange = 60
  8.  
  9. while fs.exists("freq") == false do
  10.   term.clear()
  11.   term.setCursorPos(1,1)
  12.   print("Frequency not set!")
  13. end
  14. file = fs.open("freq", "r")
  15. freq = file.readAll()
  16. file.close()
  17.  
  18. while true do
  19.   var1 = ECInput.getStackInSlot(1)
  20.   if var1 ~= nil then
  21.     print("something in chest")
  22.     if var1["name"] == "item.ItemSpatialStorageCell.16Cubed" and ECInput.getFrequency() == freqRange + freq then
  23.       print("found drive")
  24.       ECOutput.setFrequency(freqRange)
  25.       ECInput.pushItem("East",1)
  26.       var = ioPort.getStackInSlot(2)
  27.       while var == nil do
  28.         rs.setAnalogOutput("right", 1)
  29.         sleep(0.5)
  30.         rs.setOutput("right", false)
  31.         var = ioPort.getStackInSlot(2)
  32.         print("Attempting to deploy image")
  33.       end
  34.       rednet.broadcast("down",freq)
  35.       ioPort.pushItem("down",1)
  36.     else
  37.       rednet.broadcast("up",freq)
  38.     end
  39.   end
  40.   sleep(0.05)
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement