Advertisement
Guest User

startup

a guest
Aug 26th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.42 KB | None | 0 0
  1. mon = peripheral.wrap("front")
  2. mon.clear()
  3. mon.setTextScale(1.5)
  4.  
  5. mon.setCursorPos(2,1)
  6. mon.write("Cobblestone")
  7. mon.setCursorPos(2,3)
  8. mon.write("Stone")
  9. mon.setCursorPos (2,5)
  10. mon.write("Sand")
  11. mon.setCursorPos(2,7)
  12. mon.write("Silicon")
  13. mon.setCursorPos(2,9)
  14. mon.write("Glass")
  15.  
  16.  
  17. while true do
  18.     event,side,x,y = os.pullEvent("monitor_touch")
  19.    
  20.    
  21.     if x > 1 and x < 13 and y == 1 and rs.getOutput("left") == false then  
  22.             rs.setOutput("left",true)
  23.             mon.setCursorPos(2,1)
  24.             mon.clearLine()
  25.             mon.blit("Cobblestone","00000000000","ddddddddddd")
  26.        
  27.     elseif x > 1 and x < 13 and y == 1 and rs.getOutput("left") == true then   
  28.             rs.setOutput("left",false)
  29.             mon.setCursorPos(2,1)
  30.             mon.clearLine()
  31.             mon.write("Cobblestone")
  32.            
  33.         elseif x > 1 and x < 13 and y == 3 and rs.getOutput("right") == false then 
  34.                 rs.setOutput("right",true)
  35.                     mon.setCursorPos(2,3)
  36.                 mon.clearLine()
  37.                 mon.blit("Stone      ","00000000000","ddddddddddd")
  38.                
  39.         elseif x > 1 and x < 13 and y == 3 and rs.getOutput("right") == true then  
  40.                 rs.setOutput("right",false)
  41.                 mon.setCursorPos(2,3)
  42.                 mon.clearLine()
  43.                 mon.write("Stone")
  44.                
  45.             elseif x > 1 and x < 13 and y == 5 and rs.getOutput("bottom") == false then
  46.                     rs.setOutput("bottom",true)
  47.                     mon.setCursorPos(2,5)
  48.                     mon.clearLine()
  49.                     mon.blit("Sand       ","00000000000","ddddddddddd")
  50.                    
  51.             elseif x > 1 and x < 13 and y == 5 and rs.getOutput("bottom") == true then 
  52.                     rs.setOutput("bottom",false)
  53.                     mon.setCursorPos(2,5)
  54.                     mon.clearLine()
  55.                     mon.write("Sand")
  56.                
  57.                 elseif x > 1 and x < 13 and y == 7 and rs.getOutput("back") == false then  
  58.                         rs.setOutput("back",true)
  59.                         mon.setCursorPos(2,7)
  60.                         mon.clearLine()
  61.                         mon.blit("Silicon    ","00000000000","ddddddddddd")
  62.                    
  63.                 elseif x > 1 and x < 13 and y == 7 and rs.getOutput("back") == true then   
  64.                         rs.setOutput("back",false)
  65.                         mon.setCursorPos(2,7)
  66.                         mon.clearLine()
  67.                         mon.write("Silicon")
  68.                    
  69.                     elseif x > 1 and x < 13 and y == 9 and rs.getOutput("front") == false then 
  70.                             rs.setOutput("front",true)
  71.                             mon.setCursorPos(2,9)
  72.                             mon.clearLine()
  73.                             mon.blit("Glass      ","00000000000","ddddddddddd")
  74.                    
  75.                     elseif x > 1 and x < 13 and y == 9 and rs.getOutput("front") == true then  
  76.                             rs.setOutput("front",false)
  77.                             mon.setCursorPos(2,9)
  78.                             mon.clearLine()
  79.                             mon.write("Glass")
  80.     end
  81. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement