Advertisement
Plazter

Fluids

Sep 1st, 2016
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.63 KB | None | 0 0
  1. os.loadAPI("c")
  2.  
  3. mon = peripheral.find("monitor")
  4. sec = 2
  5. bc = colors.black
  6. tc = colors.red
  7. line = 6
  8. click = 6
  9. clickTwo = 6
  10. all = 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256 + 512 + 1024 + 8192 + 16384 + 32768
  11.  
  12.  
  13.  
  14. function NewLine()
  15.     line = line +1
  16.     mon.setCursorPos(1,line)
  17. end
  18.  
  19. function te(write)
  20.     c.mWrite(write)
  21.     NewLine()
  22.     NewLine()
  23. end
  24.  
  25. function buttonTwo()
  26.     local event, side, x , y = os.pullEvent("monitor_touch")
  27.     -- FIRST PAGE --
  28.     if x > 1 and x < 7 and y == 26 then
  29.         pageOne()
  30.     end
  31. end
  32.  
  33. function pageOne()
  34.     mon.setBackgroundColor(bc)
  35.     mon.setTextColor(tc)
  36.     mon.clear()
  37.     rs.setBundledOutput("back", all)
  38.     mon.setCursorPos(1,2)
  39.     c.mWrite("-----------------")
  40.     mon.setCursorPos(1,3)
  41.     c.mWrite("| Select Fluid: |")
  42.     mon.setCursorPos(1,4)
  43.     c.mWrite("-----------------")
  44.     mon.setCursorPos(23,26)
  45.     mon.write("Page 2")
  46.     mon.setCursorPos(1,26)
  47.     mon.write("      ")
  48.     mon.setCursorPos(1,6)
  49.     te("UUM")
  50.     te("Blood(BM)")
  51.     te("Bedrockium")
  52.     te("Coolant")
  53.     te("Draconium")
  54.     te("Primal Mana")
  55.     te("Liquid Ender")
  56.     te("Emerald")
  57.     te("Shiny")
  58.     te("XP")
  59.     te("Gold")
  60. end
  61.    
  62.  
  63.  
  64.  
  65. function pageTwo()
  66.     mon.setBackgroundColor(bc)
  67.     mon.setTextColor(tc)
  68.     rs.setBundledOutput("back", all)
  69.     mon.setCursorPos(1,2)
  70.     c.mWrite("-----------------")
  71.     mon.setCursorPos(1,3)
  72.     c.mWrite("| Select Fluid: |")
  73.     mon.setCursorPos(1,4)
  74.     c.mWrite("-----------------")
  75.     mon.setCursorPos(1,26)
  76.     mon.write("Page 1")
  77.     mon.setCursorPos(23,26)
  78.     mon.write("      ")
  79.  
  80.     buttonTwo()
  81. end
  82.  
  83. function setBk()
  84.     mon.setBackgroundColor(bc)
  85.     mon.clear()
  86.     pageOne()
  87. end
  88.  
  89. function setBkk()
  90.     mon.setBackgroundColor(bc)
  91.     mon.clear()
  92.     pageTwo()
  93. end
  94.  
  95. function bClick()
  96.     click = click + 2
  97. end
  98. function buttonOne()
  99.     local event, side, x , y = os.pullEvent("monitor_touch")
  100.  
  101.     if x > 1 and x < 40 and y == click then
  102.         for i = 1, 26 do
  103.         mon.setCursorPos(1,i)      
  104.         mon.setBackgroundColor(bc)
  105.         end
  106.         print("UUM")
  107.         mon.setCursorPos(1,click)
  108.         mon.setBackgroundColor(colors.lime)
  109.         c.mWrite("UUM")
  110.         rs.setBundledOutput("back", all - colors.purple)
  111.     end
  112.  
  113.   bClick()
  114.  
  115.     if x > 1 and x < 40 and y == click then
  116.         for i = 1, 26 do
  117.         mon.setCursorPos(1,i)      
  118.         mon.setBackgroundColor(bc)
  119.         end
  120.         mon.setCursorPos(1,click)
  121.         mon.setBackgroundColor(colors.lime)
  122.         c.mWrite("Blood(BM)")  
  123.         print("Blood")
  124.         rs.setBundledOutput("back", all - colors.red)
  125.     end
  126.    
  127.   bClick()
  128.  
  129.     if x > 1 and x < 40 and y == click then
  130.         for i = 1, 26 do
  131.         mon.setCursorPos(1,i)      
  132.         mon.setBackgroundColor(bc)
  133.         end
  134.         mon.setCursorPos(1,click)
  135.         mon.setBackgroundColor(colors.lime)
  136.         c.mWrite("Bedrockium")
  137.         print("Bedrockium")
  138.         rs.setBundledOutput("back", all - colors.black)
  139.     end
  140.    
  141.   bClick()
  142.  
  143.     if x > 1 and x < 40 and y == click then
  144.         for i = 1, 26 do
  145.         mon.setCursorPos(1,i)      
  146.         mon.setBackgroundColor(bc)
  147.         end
  148.         mon.setCursorPos(1,click)
  149.         mon.setBackgroundColor(colors.lime)
  150.         c.mWrite("Coolant")
  151.         print("Coolant")
  152.         rs.setBundledOutput("back", all - colors.cyan)
  153.     end
  154.    
  155.   bClick()
  156.  
  157.     if x > 1 and x < 40 and y == click then
  158.         for i = 1, 26 do
  159.         mon.setCursorPos(1,i)      
  160.         mon.setBackgroundColor(bc)
  161.         end
  162.         mon.setCursorPos(1,click)
  163.         mon.setBackgroundColor(colors.lime)
  164.         c.mWrite("Draconium")
  165.         print("Draconium")
  166.         rs.setBundledOutput("back", all - colors.white)
  167.     end
  168.    
  169.   bClick()
  170.  
  171.     if x > 1 and x < 40 and y == click then
  172.         for i = 1, 26 do
  173.         mon.setCursorPos(1,i)      
  174.         mon.setBackgroundColor(bc)
  175.         end
  176.         print("Primal Mana")
  177.         rs.setBundledOutput("back", all - colors.magenta)
  178.         mon.setCursorPos(1,click)
  179.         mon.setBackgroundColor(colors.lime)
  180.         c.mWrite("Primal Mana")
  181.     end
  182.    
  183.   bClick()
  184.  
  185.     if x > 1 and x < 40 and y == click then
  186.         for i = 1, 26 do
  187.         mon.setCursorPos(1,i)      
  188.         mon.setBackgroundColor(bc)
  189.         end
  190.         mon.setCursorPos(1, click)
  191.         mon.setBackgroundColor(colors.lime)
  192.         c.mWrite("Liquid Ender")
  193.         rs.setBundledOutput("back", all - colors.green)
  194.     end
  195.    
  196.   bClick()
  197.  
  198.     if x > 1 and x < 40 and y == click then
  199.         for i = 1, 26 do
  200.         mon.setCursorPos(1,i)      
  201.         mon.setBackgroundColor(bc)
  202.         end
  203.         mon.setCursorPos(1, click)
  204.         mon.setBackgroundColor(colors.lime)
  205.         c.mWrite("Emerald")
  206.         rs.setBundledOutput("back", all - colors.orange)
  207.     end
  208.    
  209.   bClick()
  210.  
  211.     if x> 1 and x < 40 and y == click then
  212.         for i = 1, 26 do
  213.         mon.setCursorPos(1,i)      
  214.         mon.setBackgroundColor(bc)
  215.         end
  216.         mon.setCursorPos(1,click)
  217.         mon.setBackgroundColor(colors.lime)
  218.         c.mWrite("Shiny")
  219.         rs.setBundledOutput("back", all - 8)
  220.     end
  221.    
  222.     -- NEXT PAGE BUTTON --
  223.     if x > 23 and x < 26 and y == 26 then  
  224.         pageTwo()
  225.     end
  226.  
  227. end
  228.  
  229.  
  230.  
  231.  
  232.  
  233. setBk()
  234. while true do
  235.     pageOne()
  236.    
  237.     buttonOne()
  238.     sleep(sec)
  239. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement