Advertisement
thatparadox

SpatialDiscChecker

May 2nd, 2015
403
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.95 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.       while ioPort.pushItem("down", 2) == 0 do
  27.         rs.setAnalogOutput("right", 1)
  28.       end
  29.       rs.setOutput("right", false)
  30.       ECInput.setFrequency(freqRange + freq)
  31.       rs.setOutput("front", true)
  32.       sleep(5)
  33.       rs.setOutput("front", false)
  34.     end
  35.   end
  36. sleep(0.05)
  37. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement