Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Basic side determination for wrapping
- function getDeviceSide(deviceType)
- deviceType = deviceType:lower()
- for i, side in pairs(rs.getSides()) do
- if (peripheral.isPresent(side)) then
- if (string.lower(peripheral.getType(side)) == deviceType) then
- return side;
- end
- end
- end
- return nil;
- end
- -- Peripheral wrapping function
- function wrapThis(thing, f)
- local wrapped = nil
- while wrapped == nil and f <= 100 do
- wrapped = peripheral.wrap(thing.."_"..f)
- f = f + 1
- end
- if wrapped == nil then
- side = getDeviceSide(thing)
- if side ~= nil then
- return peripheral.wrap(side)
- else
- return nil
- end
- else
- return wrapped
- end
- end
- security = "HiPass"
- override = "Open House"
- monitor=wrapThis("monitor",0)
- if monitor ~= nil then
- monitor.clear()
- monitor.setTextScale(.5)
- monitor.setCursorPos(1,1)
- monitor.write('Welcome to...')
- monitor.setCursorPos(21,2)
- monitor.write('___')
- monitor.setCursorPos(12,3)
- monitor.write('! ! ^ T !\\')
- monitor.setCursorPos(12,4)
- monitor.write('! ! ! !_! ! !/')
- monitor.setCursorPos(13,5)
- monitor.write('T T ! ! ! !\\')
- monitor.setCursorPos(1,7)
- monitor.write('Current Announcments:')
- monitor.setCursorPos(2,8)
- monitor.write('-Lord DoomRater will be on vacation')
- monitor.setCursorPos(1,9)
- monitor.write('from September 1 to September 17.')
- monitor.setCursorPos(2,10)
- monitor.write('-Open House starts September 1st!')
- end
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print(" ___")
- print(" ! ! ^ T !\\")
- print(" ! ! ! !_! ! !/")
- print(" T T ! ! | !\\")
- print(" Weapons and")
- print(" Tactics Research")
- term.setCursorPos(1,9)
- print("Security Clearance Required")
- term.write("> ")
- pass = read("x")
- if pass == security then
- rs.setOutput("top",false)
- sleep(.2)
- rs.setOutput("back",false)
- sleep(4)
- rs.setOutput("top",true)
- sleep(.2)
- rs.setOutput("back",true)
- end
- if pass == override then
- rs.setOutput("top",false)
- sleep(.2)
- rs.setOutput("back",false)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement