Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --numbers [must be (sn=totn) when pass typed to unlock rs signal]
- sn=0
- totn=15
- --code for door
- local pasp=peripheral.wrap("monitor_0")
- local pasd=peripheral.wrap("monitor_2")
- pasp.clear()
- pasd.clear()
- local widthp, heightp=pasp.getSize()
- local widthd, heightd=pasd.getSize()
- print("password input mon: "..widthp.." "..heightp)
- print("password display mon: "..widthd.." "..heightd)
- pasp.setCursorPos(1,1)
- pasp.write("1 2 3")
- pasp.setCursorPos(1,2)
- pasp.write("4 5 6")
- pasp.setCursorPos(1,3)
- pasp.write("7 8 9")
- pasp.setCursorPos(3,4)
- pasp.write("r")
- pasd.setCursorPos(1,5)
- function draw(x,y)
- --what will happen after click
- if(x==1 and y==1) then
- --1 number code (will activate when clicked on 1)
- sn=sn+1
- elseif(x==3 and y==1) then
- --2 number code
- sn=sn+2
- elseif(x==5 and y==1) then
- --3 number code
- sn=sn+3
- elseif(x==1 and y==2) then
- --4 number code
- sn=sn+4
- elseif(x==3 and y==2) then
- --5 number code
- sn=sn+5
- elseif(x==5 and y==2) then
- --6 number code
- sn=sn+6
- elseif(x==1 and y==3) then
- --7 number code
- sn=sn+7
- elseif(x==3 and y==3) then
- --8 number code
- sn=sn+8
- elseif(x==5 and y==3) then
- --9 number code
- sn=sn+9
- end
- print("player now has "..sn.." out of "..totn)
- if(sn==totn) then
- pasd.clear()
- print("player typed pass with + of "..sn.."/"..totn)
- sn=0
- print("reseting variable sn to "..sn.."/"..totn)
- end
- if(x==3 and y==4) then
- sn=0
- pasp.setCursorPos(1,5)
- pasp.write("reseting..")
- sleep(1)
- pasp.setCursorPos(1,5)
- pasp.write(" ")
- end
- pasd.setCursorPos(1,1)
- pasd.write("player sum "..sn.." ")
- end
- while true do
- local event, side, x, y=os.pullEvent("monitor_touch")
- draw(x,y)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement