Mariomarco

Untitled

Apr 1st, 2013
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.06 KB | None | 0 0
  1. local monitor = peripheral.wrap("right")
  2. local redout = false
  3. term.write("Click to Stop")
  4. while(redstone.getInput("bottom") == false) do
  5.     monitor.setTextScale(1)
  6.     monitor.setCursorPos(1,1)      
  7.     monitor.write("() Solar Farm")
  8.     monitor.setCursorPos(1,3)
  9.     monitor.write("|--ON --|")
  10.     monitor.setCursorPos(1,4)
  11.     monitor.write("|--OFF--|")
  12.     monitor.setCursorPos(1,5)
  13.     monitor.write("|       |")
  14.     monitor.setCursorPos(1,6)
  15.     monitor.write("|       |")
  16.     monitor.setCursorPos(1,7)
  17.     if (redout == false) then
  18.         monitor.write("|__OFF__|")
  19.         redstone.setOutput("back", false)
  20.     else
  21.         monitor.write("|___ON__|")
  22.         redstone.setOutput("back", true)
  23.     end
  24.  
  25.     local event, side, xPos, yPos = os.pullEvent()
  26.  
  27.     if(event == "monitor_touch") then
  28.         if(yPos == 3 ) then
  29.             redout = true
  30.         end
  31.            
  32.         if(yPos == 4) then
  33.             redout = false
  34.         end
  35.  
  36.  
  37.         monitor.clear()
  38.    
  39.     elseif(event == "mouse_click") then
  40.             term.clear()
  41.             term.setCursorPos(1,1)
  42.             term.write("XPOS:" .. xPos .. " YPOS:" .. yPos .. " SIDE:" .. side)
  43.             sleep(1)
  44.             return
  45.     end
  46.     sleep(0.01)
  47. end
Advertisement
Add Comment
Please, Sign In to add comment