Guest User

test

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