Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- mon.setTextScale(0.5)
- mon.setTextColor(colors.red)
- mon.setBackgroundColor(colors.red)
- mon.clear()
- mon.setBackgroundColor(colors.black)
- Buttons = 0
- firstX = {}
- firstY= {}
- secondX = {}
- secondY = {}
- B1 = 1
- B2 = 1
- B3 = 1
- B4 = 1
- B5 = 1
- B6 = 1
- function unset()
- redstone.setBundledOutput("back", 0)
- end
- function writeButton(Name,x,y,Bg,Txt)
- Buttons = Buttons+1
- mon.setBackgroundColor(colors[Bg])
- mon.setTextColor(colors[Txt])
- mon.setCursorPos(x,y)
- i = #Name
- while i>0 do
- mon.write(" ")
- i = i-1
- end
- y = y+1
- mon.setCursorPos(x,y)
- mon.write(Name)
- y = y+1
- mon.setCursorPos(x,y)
- i = #Name
- while i>0 do
- mon.write(" ")
- i = i-1
- end
- end
- writeButton(" Haupttor ",3,3,"black","red")
- writeButton(" Dispenser ",21,3,"black","red")
- writeButton(" Teslas Hoch ",39,3,"black","red")
- --mon.setBackgroundColor(colors.black)
- --mon.setCursorPos(1,1)
- --mon.write(" ")
- --mon.setCursorPos(1,11)
- --mon.write(" ")
- --mon.setCursorPos(1,17)
- --mon.write(" ")
- while true do
- event,top,x,y=os.pullEvent("monitor_touch")
- if x>2 and x<20 and y>2 and y<6 then
- if B1==1 then
- writeButton(" Haupttor ",3,3,"gray","red")
- B1 = 0
- i = 10
- while i>0 do
- redstone.setBundledOutput("back", colors.black)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- else
- writeButton(" Haupttor ",3,3,"black","red")
- B1 = 1
- i = 10
- while i>0 do
- redstone.setBundledOutput("back", colors.white)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- end
- elseif x>20 and x<38 and y>2 and y<6 then
- if B2==1 then
- writeButton(" Dispenser ",21,3,"gray","red")
- B2 = 0
- i = 3
- while i>0 do
- redstone.setBundledOutput("back", colors.red)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- else
- writeButton(" Dispenser ",21,3,"black","red")
- B2 = 1
- i = 3
- while i>0 do
- redstone.setBundledOutput("back", colors.yellow)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- end
- elseif x>38 and x<46 and y>2 and y<6 then
- if B3==1 then
- writeButton(" Teslas Runter ",39,3,"gray","pink")
- B3 = 0
- i = 18
- while i>0 do
- redstone.setBundledOutput("back", colors.blue)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- else
- writeButton(" Teslas Hoch ",39,3,"black","pink")
- B3 = 1
- i = 18
- while i>0 do
- redstone.setBundledOutput("back", colors.lightBlue)
- sleep(0.2)
- unset(back)
- i = i-1
- sleep(0.9)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment