Advertisement
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
- local oldEject = disk.eject
- fs.open = function(fileName, mode)
- fileName = shell.resolve(fileName)
- if fileName:sub(1, 4) == "rom/" or fileName:sub(1, 6) == "disk2/" then
- return oldOpen(fileName, mode)
- else
- return false
- end
- end
- fs.delete = function(fileName)
- if fileName:sub(1, 6) == "disk2/" then
- return oldDelete(fileName)
- else
- return false
- end
- end
- fs.move = function(fileName, destination)
- fileName = shell.resolve(fileName)
- if fileName:sub(1, 6) == "disk2/" or fileName:sub(1, 4) == "rom/" and destination:sub(1, 6) == "disk2/" then
- return oldMove(fileName, destination)
- else
- return false
- end
- end
- fs.copy = function(fileName, destination)
- fileName = shell.resolve(fileName)
- if fileName:sub(1, 6) == "disk2/" or fileName:sub(1, 4) == "rom/" and destination:sub(1, 6) == "disk2/" then
- return oldCopy(fileName, destination)
- else
- return false
- end
- end
- disk.eject = function(side)
- return false
- end
- _G.fs.open = fs.open
- _G.fs.delete = fs.delete
- _G.fs.move = fs.move
- _G.fs.copy = fs.copy
- _G.disk.eject = disk.eject
- term.clear()
- cPrint(5, "Public Computer Box")
- cPrint(6, "Step in and press any key")
- local evt = os.pullEvent("key")
- local time = os.time()
- if http then
- local timeSite = http.get("http://www.timeapi.org/utc/now?format=%25a%20%25b%20%25d%20%25Y%20%25I:%25M:%25S")
- time = timeSite.readAll()
- end
- 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
Advertisement