Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function cPrint(y, text)
- size = term.getSize()
- term.setCursorPos(size/2-math.floor(#text/2), y)
- write(text)
- end
- local oldOpen = fs.open
- local oldDelete = fs.delete
- local oldMove = fs.move
- local oldCopy = fs.copy
- fs.open = function(fileName, mode)
- if fileName:sub(1, 3) == "rom" or fileName:sub(1, 5) == "disk2" then
- return oldOpen(fileName, mode)
- else
- return false
- end
- end
- fs.delete = function(fileName)
- if fileName:sub(1, 5) == "disk2" then
- return oldDelete(fileName)
- else
- return false
- end
- end
- fs.move = function(fileName, destination)
- if fileName:sub(1, 5) == "disk2" then
- return oldMove(fileName, destination)
- else
- return false
- end
- end
- fs.copy = function(fileName, destination)
- if fileName:sub(1, 5) == "disk2" then
- return oldCopy(fileName, destination)
- else
- return false
- end
- end
- term.clear()
- cPrint(5, "Public Computer Box")
- cPrint(6, "Step in and press any key")
- local evt = os.pullEvent("key")
- local timeSite = http.get("http://www.timeapi.org/utc/now?format=%25a%20%25b%20%25d%20%25Y%20%25I:%25M:%25S")
- local time = timeSite.readAll()
- local logTable = {"Computer Box login", time}
- local logString = textutils.serialize(logTable)
- rednet.open("back")
- rednet.send(118, logString)
- rednet.close("back")
- term.clear()
- term.setCursorPos(1,1)
- print("BoxOS 1.4")
Advertisement
Add Comment
Please, Sign In to add comment