Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- openSide="left"
- lockSide="right"
- openTime=3
- term.setBackgroundColor(colors.white)
- term.clear()
- term.setBackgroundColor(colors.lightGray)
- term.setTextColor(colors.blue)
- term.setCursorPos(21,6)
- write(" O P E N ")
- term.setTextColor(colors.red)
- term.setCursorPos(21,8)
- write(" L O C K ")
- term.setTextColor(colors.green)
- term.setCursorPos(19,10)
- write(" U N L O C K ")
- if redstone.getOutput(lockSide) then
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.red)
- term.setCursorPos(21,8)
- write(" L O C K ")
- else
- term.setBackgroundColor(colors.gray)
- term.setTextColor(colors.green)
- term.setCursorPos(19,10)
- write(" U N L O C K ")
- end
- term.setCursorPos(1,1)
- term.setTextColor(colors.purple)
- term.setBackgroundColor(colors.black)
- write("edit code")
- term.setBackgroundColor(colors.red)
- term.setTextColor(colors.black)
- term.setCursorPos(48,1)
- write("quit")
- event,n,x,y=os.pullEvent("mouse_click")
- if x>47 and y==1 then
- error()
- end
- if x<10 and y==1 then
- c=shell.getRunningProgram()
- shell.run("edit "..c)
- shell.run(c)
- error()
- end
- if y==6 then
- if redstone.getOutput(lockSide)==false then
- rs.setOutput(openSide, true)
- sleep(openTime)
- rs.setOutput(openSide, false)
- end
- end
- if y==8 then
- rs.setOutput(lockSide, true)
- end
- if y==10 then
- rs.setOutput(lockSide, false)
- end
- end
Add Comment
Please, Sign In to add comment