vreezer

Gammel_HDs Prog

Aug 8th, 2014
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.17 KB | None | 0 0
  1. mon = peripheral.wrap("top")
  2. mon.setTextScale(0.5)
  3. mon.setTextColor(colors.red)
  4. mon.setBackgroundColor(colors.red)
  5. mon.clear()
  6. mon.setBackgroundColor(colors.black)
  7. Buttons = 0
  8. firstX = {}
  9. firstY= {}
  10. secondX = {}
  11. secondY = {}
  12. B1 = 1
  13. B2 = 1
  14. B3 = 1
  15. B4 = 1
  16. B5 = 1
  17. B6 = 1
  18.  
  19. function unset()
  20.     redstone.setBundledOutput("back", 0)
  21. end
  22.  
  23. function writeButton(Name,x,y,Bg,Txt)
  24.      Buttons = Buttons+1
  25.      mon.setBackgroundColor(colors[Bg])
  26.      mon.setTextColor(colors[Txt])
  27.      mon.setCursorPos(x,y)
  28.      i = #Name
  29.      while i>0 do
  30.         mon.write(" ")
  31.         i = i-1
  32.      end
  33.      y = y+1
  34.      mon.setCursorPos(x,y)
  35.      mon.write(Name)
  36.      y = y+1
  37.      mon.setCursorPos(x,y)
  38.      i = #Name
  39.      while i>0 do
  40.         mon.write(" ")
  41.         i = i-1
  42.      end
  43. end
  44.  
  45. writeButton("     Haupttor    ",3,3,"black","red")
  46. writeButton("    Dispenser    ",21,3,"black","red")
  47. writeButton("   Teslas Hoch   ",39,3,"black","red")
  48.  
  49. --mon.setBackgroundColor(colors.black)
  50. --mon.setCursorPos(1,1)
  51. --mon.write("                                                         ")
  52. --mon.setCursorPos(1,11)
  53. --mon.write("                                                         ")
  54. --mon.setCursorPos(1,17)
  55. --mon.write("                                                         ")
  56.  
  57. while true do
  58. event,top,x,y=os.pullEvent("monitor_touch")
  59.  
  60. if x>2 and x<20 and y>2 and y<6 then
  61.     if B1==1 then
  62.        writeButton("     Haupttor    ",3,3,"gray","red")
  63.        B1 = 0
  64.        i = 10
  65.        while i>0 do
  66.           redstone.setBundledOutput("back", colors.black)
  67.           sleep(0.2)
  68.           unset(back)
  69.           i = i-1
  70.           sleep(0.9)
  71.        end
  72.        
  73.     else
  74.        writeButton("     Haupttor    ",3,3,"black","red")
  75.        B1 = 1
  76.        i = 10
  77.        while i>0 do
  78.           redstone.setBundledOutput("back", colors.white)
  79.           sleep(0.2)
  80.           unset(back)
  81.           i = i-1
  82.           sleep(0.9)
  83.        end
  84.     end  
  85.  
  86. elseif x>20 and x<38 and y>2 and y<6 then
  87.     if B2==1 then
  88.        writeButton("    Dispenser    ",21,3,"gray","red")
  89.        B2 = 0
  90.        i = 3
  91.        while i>0 do
  92.           redstone.setBundledOutput("back", colors.red)
  93.           sleep(0.2)
  94.           unset(back)
  95.           i = i-1
  96.           sleep(0.9)
  97.        end
  98.     else
  99.        writeButton("    Dispenser    ",21,3,"black","red")
  100.        B2 = 1
  101.        i = 3
  102.        while i>0 do
  103.           redstone.setBundledOutput("back", colors.yellow)
  104.           sleep(0.2)
  105.           unset(back)
  106.           i = i-1
  107.           sleep(0.9)
  108.        end
  109.     end  
  110.  
  111. elseif x>38 and x<46 and y>2 and y<6 then
  112.     if B3==1 then
  113.        writeButton("  Teslas Runter  ",39,3,"gray","pink")
  114.        B3 = 0
  115.        i = 18
  116.        while i>0 do
  117.           redstone.setBundledOutput("back", colors.blue)
  118.           sleep(0.2)
  119.           unset(back)
  120.           i = i-1
  121.           sleep(0.9)
  122.        end
  123.     else
  124.        writeButton("   Teslas Hoch   ",39,3,"black","pink")
  125.        B3 = 1
  126.        i = 18
  127.        while i>0 do
  128.           redstone.setBundledOutput("back", colors.lightBlue)
  129.           sleep(0.2)
  130.           unset(back)
  131.           i = i-1
  132.           sleep(0.9)
  133.        end
  134.     end  
  135.  
  136. end
  137. end
Advertisement
Add Comment
Please, Sign In to add comment