Advertisement
thatparadox

Spatial IO Tp

Jun 29th, 2014
1,026
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.44 KB | None | 0 0
  1. tess = peripheral.wrap("tile_thermalexpansion_tesseract_name_3")
  2. mon = peripheral.wrap("monitor_0")
  3. mon2 = peripheral.wrap("monitor_1")
  4. chest = peripheral.wrap("back")
  5. ec = peripheral.wrap("bottom")
  6.  
  7. function display()
  8. x,y = mon.getSize()
  9. mon.setBackgroundColor(colors.black)
  10. mon.clear()
  11. mon.setTextColor(colors.black)
  12. for i = 1, y, 2 do
  13.   mon.setCursorPos(x/2,i)
  14.   mon.setBackgroundColor(colors.purple)
  15.   mon.write(" "..i.." ")
  16.   mon.setCursorPos(x/2,i+1)
  17.   mon.setBackgroundColor(colors.lightBlue)
  18.   mon.write(" "..(i+1).." ")
  19. end
  20. end
  21.  
  22. while true do
  23.   display()
  24.   event, param1, param2, level = os.pullEvent()
  25.   if event == "monitor_touch" and fs.exists(tostring(level)) then
  26.     file = fs.open(tostring(level),"r")
  27.     freq = file.readAll()
  28.     file.close()
  29.     print(freq)
  30.     if ec.pushItem("down",1) == 1 then
  31.       tess.setFrequency(tonumber(freq))
  32.       while chest.pushItem("up",1) == 0 do
  33.         print("nope")
  34.         os.sleep(0.1)
  35.       end
  36.     else
  37.       print("no drive")
  38.       mon.clear()
  39.       mon.setCursorPos(x/2, y/2)
  40.       mon.write("Try")
  41.       mon.setCursorPos(x/2-1, y/2+1)
  42.       mon.write("Again")
  43.       os.sleep(4)
  44.     end
  45.   elseif event == "redstone" then
  46.     chest.pushItem("down",1)
  47.     print("redstone")
  48.   else
  49.       mon.clear()
  50.       mon.setCursorPos(x/2, y/2)
  51.       mon.write("Try")
  52.       mon.setCursorPos(x/2-1, y/2+1)
  53.       mon.write("Again")
  54.       os.sleep(4)
  55.   end
  56.   print("done")
  57. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement