Advertisement
Muzze77

Table

Oct 30th, 2014
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. shell.run("clear")
  2.  
  3.  
  4. black = colors.black
  5. red = colors.red
  6. green = colors.green
  7. white = colors.white
  8. blue = colors.blue
  9. bnorm = black
  10. tnorm = white
  11. brown = colors.brown
  12. cyan = colors.cyan
  13. orange = colors.orange
  14. yellow = colors.yellow
  15. pink = colors.pink
  16. purple = colors.purple
  17.  
  18. function cbut(cx, cy, text, bcol, tcol)
  19. term.setCursorPos(cx, cy)
  20. term.setBackgroundColor(bcol)
  21. term.setTextColor(tcol)
  22. print(text)
  23. term.setBackgroundColor(bnorm)
  24. term.setTextColor(tnorm)
  25. end
  26.  
  27. cbut(3,2, "               ", red, black)
  28. cbut(3,3, " Sludge Boiler ", red, black)
  29. cbut(3,4, "               ", red, black)
  30. sel = 1
  31.  
  32. while true do
  33. evt, side, x, y = os.pullEvent("monitor_touch")
  34.         if evt == "monitor_touch" then
  35.         for mx = 3, 17, 1 do
  36.         for my = 2, 4 , 1 do
  37.        
  38.         if mx == x then
  39.         if my == y then
  40.        
  41.         if sel == 1 then
  42.         cbut(3,2, "               ", green, black)
  43.         cbut(3,3, " Sludge Boiler ", green, black)
  44.         cbut(3,4, "               ", green, black)
  45.         sel = 0
  46.         rs.setBundledOutput("back", colors.red)
  47.        
  48.         elseif sel == 0 then
  49.         cbut(3,2, "               ", red, black)
  50.         cbut(3,3, " Sludge Boiler ", red, black)
  51.         cbut(3,4, "               ", red, black)
  52.         sel = 1
  53.         rs.setBundledOutput("back", colors.red)
  54.        
  55.        
  56.        
  57.        
  58.         end
  59.                    
  60.         end
  61.         end
  62.         end
  63.         end
  64.         end
  65. --------------------------------------------
  66.    
  67.        
  68.        
  69.        
  70.    
  71. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement