Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon={peripheral.wrap("monitor_0"),peripheral.wrap("monitor_1"),peripheral.wrap("monitor_2"),peripheral.wrap("monitor_3")}
- function Pixel(x,y,color,a)
- a.setTextScale(0.5)
- a.setCursorPos(x,y)
- a.setBackgroundColor(color)
- a.write(" ")
- end
- function Box(w,x,y,z,color,a)
- -- w, x = x1, y1
- -- y, z = x2, y2
- -- a = monitor
- for g=0,z-x do
- for i=0,y-w do
- Pixel(w+i,x+g,color,a)
- end
- end
- end
- function Elevator(x,y,color,a)
- --x,y = x,y
- --color = color
- --a = monitor
- Box(x-3,y,x+3,y+1,color,a)
- Box(x-1,y,x+1,y+11,color,a)
- end
- function Button(w,x,y,z,a,b,c)
- -- w,x = x1 y1
- -- y,z = x2 y2
- -- a,b,c = side, PosX , Pos Y
- if (a == "monitor_0" or a == "monitor_1" or a == "monitor_2" or "monitor_3") and b>=w and b<=y and c>=x and c<=z then
- return true
- else return false
- end
- end
- --16,11
- function Draw(x,i,j,a)
- --1<x<10
- -- a= monitor
- --i,j == color 1, color 2
- Box(1,1,7,5,i,a)
- Box(1,6,7,6,colors.black,a)
- Box(1,7,7,11,j,a)
- Box(8,1,8,11,colors.black,a)
- Box(9,1,16,11,colors.gray,a)
- Elevator(12,x,colors.black,a)
- end
- for i=1,#mon do
- mon[i].setTextScale(0.5)
- mon[i].setBackgroundColor(colors.black)
- mon[i].setCursorPos(1,1)
- mon[i].clear()
- Draw(10,colors.lime,colors.red,mon[i])
- end
- BAS=true
- while true do
- event,side,xPos,yPos= os.pullEvent("monitor_touch")
- if (Button(1,1,8,5,side,xPos,yPos) == true) and (BAS==true) then
- rs.setBundledOutput("back",colors.yellow)
- BAS=false
- sleep(2)
- for a=1,10 do
- for i=1,#mon do
- Draw(10-a,colors.lime,colors.red,mon[i])
- end
- sleep(0.3)
- if a == 10 then
- sleep(2)
- for i = 1, #mon do
- Draw(10-a,colors.red,colors.lime,mon[i])
- end
- end
- end
- elseif (Button(1,7,8,11,side,xPos,yPos) == true) and (BAS==false) then
- rs.setBundledOutput("back",0)
- BAS=true
- sleep(2)
- for a=1,10 do
- for i=1,#mon do
- Draw(a,colors.red,colors.lime,mon[i])
- end
- sleep(0.3)
- if a == 10 then
- sleep(2)
- for i = 1,#mon do
- Draw(10-a,colors.lime,colors.red,mon[i])
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement