Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x,y = term.getSize()
- os.pullEvent = os.pullEventRaw
- local function cPrint(text)
- x2,y2 = term.getCursorPos()
- term.setCursorPos(math.ceil((x / 2) - (text:len() / 2)), y2)
- write(text.. "\n")
- end
- term.setBackgroundColour( colors.gray )
- term.clear()
- term.setCursorPos(1,3)
- cPrint("The Hardest Game Ever")
- cPrint("Level 1")
- sleep(1)
- term.clear()
- local maps = {
- ["map_0"] = {
- "",
- "",
- "XXXXXXXXX",
- "XZBBBBBRX",
- "XXXXXXXXX",
- }
- }
- local currentMap = ""
- local charX = 0
- local charY = 0
- local colorSet = {
- ["X"] = colors.lightGray,
- ["B"] = colors.black,
- ["Z"] = colors.cyan,
- ["R"] = colors.red,
- }
- function loadmap( map, offset )
- term.setBackgroundColour( colors.gray )
- term.clear()
- local theMap = maps[map]
- for i=1,#theMap do
- for iv=1,#(theMap[i]) do
- local pixel = string.sub( theMap[i], iv, iv )
- if colorSet[pixel] then
- paintutils.drawPixel( 3+iv, offset+i, colorSet[pixel] )
- if map ~= currentMap then --If first time loading then...
- if pixel == "Z" then
- charX = 3+iv
- charY = 3+i
- end
- end
- end
- end
- end
- if map ~= currentMap then
- currentMap = map
- end
- end
- function redraw( char, offset )
- loadmap( "map_0", offset )
- term.setCursorPos(charX, charY)
- term.setBackgroundColour( colors.black )
- term.setTextColour( colors.lime )
- write( char )
- end
- redraw( ">", 3 )
- repeat
- local event, key = os.pullEvent("key")
- until key == keys.right
- charX = charX +1
- redraw( ">", 3 )
- sleep(0.5)
- redraw( "v", 3 )
- sleep(0.5)
- redraw( "v", 2 )
- term.setCursorPos( 1, y )
- term.setBackgroundColour( colors.black )
- term.clearLine()
- term.setTextColour( colors.yellow )
- write("Press Ctrl to access menu")
- term.setCursorPos( x-#("Ln 957"), y )
- write("Ln 957")
- term.setTextColour( colors.white )
- term.setCursorPos( x-#("957"), y )
- write("957")
- sleep(0.5)
- for i=charY, y-3 do
- redraw( "v", 1 )
- term.setCursorPos( 1, y )
- term.setBackgroundColour( colors.black )
- term.clearLine()
- term.setTextColour( colors.yellow )
- write("Press Ctrl to access menu")
- term.setCursorPos( x-#("Ln 957"), y )
- write("Ln 957")
- term.setTextColour( colors.white )
- term.setCursorPos( x-#("957"), y )
- write("957")
- term.setCursorPos( 1, y-1 )
- term.setBackgroundColour( colors.black )
- term.clearLine()
- term.setTextColour( colors.white )
- write("end")
- charY = charY +1
- sleep(0.5)
- end
- term.setCursorBlink( true )
- term.setCursorPos( 1, y-1 )
- term.clearLine()
- textutils.slowPrint("error(\"Hacked\")")
- term.setCursorPos( 16, y-1 )
- sleep(1)
- term.setCursorPos( 1, y )
- term.clearLine()
- print( shell.getRunningProgram().. ":957: Hacked" )
- term.setCursorBlink( false )
- sleep(1)
- term.setCursorBlink( true )
- write("> ")
- textutils.slowPrint("lua")
- term.setCursorPos( 6, y-1 )
- sleep(1)
- print("\nInteractive Lua prompt.")
- print("Call exit() to exit.")
- write("lua> ")
- sleep(1)
- textutils.slowPrint("os = nil")
- term.setCursorBlink( false )
- sleep(1)
- print("error")
- sleep(3)
- for i=1,50 do
- for i=1,20 do
- term.setCursorPos( math.random( x ), math.random( y ) )
- local color = math.random( 1, 5 )
- if color == 1 then
- term.setTextColour( colors.white )
- elseif color == 2 then
- term.setTextColour( colors.green )
- elseif color == 3 then
- term.setTextColour( colors.red )
- elseif color == 4 then
- term.setTextColour( colors.lime )
- else
- term.setTextColour( colors.blue )
- end
- write("bios:32: Attempt to call nil")
- end
- sleep(0)
- end
- term.setBackgroundColour( colors.blue )
- term.clear()
- term.setBackgroundColour( colors.white )
- term.setTextColour( colors.blue )
- term.setCursorPos(1, 4)
- cPrint(" Error ")
- term.setCursorPos(1, 6)
- term.setBackgroundColour( colors.blue )
- term.setTextColour( colors.black )
- cPrint("Your computer has crashed because")
- cPrint("you never got a antivirus, but hey")
- cPrint("atleast we made you your own realistic")
- cPrint("BSoD, I don't know how long i'll have to")
- cPrint("type to make this as realistic as possible")
- print()
- sleep(3)
- cPrint("Press any key to continue")
- repeat
- local event, key = os.pullEvent("key")
- until key ~= 1
- print( "bios:32:Attempt to call nil (os.pullEvent)" )
- sleep(1)
- print("LOL JK :3")
- repeat
- write("> ")
- until read() ~= ""
- print("Hah! The virus is still going on...")
- write("> ")
- sleep(1)
- textutils.slowPrint( shell.getRunningProgram() )
- while true do
- for i=1,50 do
- for i=1,20 do
- term.setCursorPos( math.random( x ), math.random( y ) )
- local color = math.random( 1, 5 )
- if color == 1 then
- term.setTextColour( colors.white )
- elseif color == 2 then
- term.setTextColour( colors.green )
- elseif color == 3 then
- term.setTextColour( colors.red )
- elseif color == 4 then
- term.setTextColour( colors.lime )
- else
- term.setTextColour( colors.blue )
- end
- write("bios:32: Attempt to call nil")
- end
- sleep(0)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment