Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mon = peripheral.wrap("top")
- rednet.open("left")
- mon.setTextScale(5)
- linkTurtle = 21
- levels = 8 --put in your number of levels. this can be a variable.
- function keyPad()
- count = 0
- mon.setTextScale(5)
- mon.setBackgroundColour(colours.red)
- mon.clear()
- mon.setCursorPos(2,3)
- mon.write("1 ")
- mon.setCursorPos(5,3)
- mon.write("2 ")
- mon.setCursorPos(8,3)
- mon.write("3 ")
- mon.setCursorPos(2,5)
- mon.write("4 ")
- mon.setCursorPos(5,5)
- mon.write("5 ")
- mon.setCursorPos(8,5)
- mon.write("6 ")
- mon.setCursorPos(2,7)
- mon.write("7 ")
- mon.setCursorPos(5,7)
- mon.write("8 ")
- mon.setCursorPos(8,7)
- mon.write("9 ")
- mon.setCursorPos(3,8)
- mon.write("Enter")
- mon.setBackgroundColour(colours.black)
- event, click, p1, p2 = os.pullEvent("monitor_touch")
- if p1 >= 2 and p1 <=3 and p2 == 3 then
- count = count + 1
- end
- event, click, p1, p2 = os.pullEvent("monitor_touch")
- if p1 >= 8 and p1 <=9 and p2 == 7 then
- count = count + 1
- end
- event, click, p1, p2 = os.pullEvent("monitor_touch")
- if p1 >= 5 and p1 <=6 and p2 == 7 then
- count = count + 1
- end
- if count ~= 3 then
- pass = false
- end
- enter = false
- while enter == false do
- event, click, p1, p2 = os.pullEvent("monitor_touch")
- if p2 == 8 then
- enter = true
- end
- end
- end
- function display()
- x,y = mon.getSize()
- --mt = {}
- mon.setBackgroundColor(colors.black)
- mon.clear()
- mon.setTextColor(colours.black)
- mon.setTextScale(5)
- digi = levels
- p = 0
- for i = 1, levels, 2 do
- p = p + 1
- mon.setCursorPos(x/2-1,digi)
- digi = digi - 1
- mon.setBackgroundColor(colors.blue)
- p = tostring(p)
- mon.write(" "..p.." ")
- p = tonumber(p)
- p = p + 1
- mon.setCursorPos(x/2,digi)
- digi = digi - 1
- mon.setBackgroundColor(colors.lightBlue)
- p = tostring(p)
- mon.write(" "..p.." ")
- p = tonumber(p)
- end
- end
- while true do
- pass = true
- display()
- event, side, xPos, yPos = os.pullEvent("monitor_touch")
- Floor = levels - yPos + 1
- print(Floor)
- if Floor == 1 then
- mon.clear()
- mon.setCursorPos(1,3)
- mon.write("Empty your")
- mon.setCursorPos(1,5)
- mon.write("Inventory")
- mon.setCursorPos(1,7)
- mon.write("touch when")
- mon.setCursorPos(4,8)
- mon.write("ready")
- wait = os.pullEvent()
- keyPad()
- end
- if Floor > 0 and pass == true then
- print("correct")
- rednet.send(linkTurtle, Floor)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement