skypop

CC Farce

Jun 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. term.setCursorPos(1,1)
  2. term.clear()
  3. print("CraftOS 1.8")
  4. term.write("> ")
  5. term.setCursorBlink(true)
  6.  
  7. local continue = true
  8. local x, y = term.getCursorPos()
  9. local w,h = term.getSize()
  10. local e,p
  11.  
  12. while continue do
  13.     e = os.pullEventRaw()
  14.     if e == "char" then
  15.         term.write(string.char(math.random(1,255)))
  16.         x = x+1
  17.         if x > w then
  18.            if y >= h then
  19.                term.scroll(1)
  20.            else
  21.                y = y+1
  22.            end
  23.            x = 1
  24.        end
  25.        term.setCursorPos(x,y)
  26.    elseif e == "terminate" then
  27.        print(" ")
  28.        printError("Tu m'as cru patate crue ?")
  29.        print("Y/N")
  30.        term.write("> ")
  31.        while true do
  32.            e,p = os.pullEventRaw()
  33.            if e == "key" and p == keys.y then
  34.                print("Y")
  35.                continue = false
  36.                sleep(.1)
  37.                fs.move(shell.getRunningProgram(), ".startup.lua")
  38.                shell.run("clear")
  39.            elseif e == "key" then
  40.                x,y = term.getCursorPos()
  41.                break
  42.            end
  43.        end
  44.    end
  45. end
Add Comment
Please, Sign In to add comment