Guest User

hacking

a guest
Feb 25th, 2016
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 23.85 KB | None | 0 0
  1. os.loadAPI("/flib")
  2.  
  3. local tArgs = {...}
  4. local server1 = false
  5. local foundFirewall = false
  6. local foundProxy = false
  7. local foundUI2 = false
  8. local playerBalance = 100
  9. local ownsFirewallBypass = false
  10. local firewallBypassPrice = 100
  11.  
  12. function clear()
  13.     term.clear()
  14.     term.setCursorPos(1,1)
  15. end
  16.  
  17. function achievement(name)
  18.     if flib.exists("/achievements") then
  19.         achievements = "/achievements"
  20.         contents = flib.getTable(achievements)
  21.         flib.fappend(achievements, name)
  22.     else
  23.         error("Error code 003")
  24.     end
  25. end
  26.  
  27. function displayServer(UItype, company)
  28.     term.setBackgroundColor(colors.black)
  29.     Server1Login = paintutils.loadImage("/server1login")
  30.     paintutils.drawImage(Server1Login, 1, 1)
  31.     term.setCursorPos(18, 12)
  32.     print("Username")
  33.     term.setCursorPos(18, 15)
  34.     print("Password")
  35.     term.setBackgroundColor(colors.black)
  36.     clear()
  37.     w, h = term.getSize()
  38.     if company == nil then
  39.         company = "Blocksburg"
  40.     end
  41.     if UItype == nil then
  42.         UItype = 1
  43.     end
  44.     local UItype = tostring(UItype)
  45.     local serverName = tostring(company)
  46.     local serverPasswords = {"block", "blocks", "dogsandcats", "serverpass"}
  47.     local sPassSec = math.random(1, #serverPasswords)
  48.     local cSPassword = serverPasswords[sPassSec]
  49.     local serverBackground = paintutils.loadImage("/server1login")
  50.     paintutils.drawImage(serverBackground, 1, 1)
  51.     term.setTextColor(colors.white)
  52.     term.setBackgroundColor(colors.gray)
  53.     term.setCursorPos(18, 12)
  54.     print("Username")
  55.     term.setCursorPos(18, 15)
  56.     print("Password")
  57.     term.setBackgroundColor(colors.black)
  58.     term.setCursorPos(1,1)
  59.     term.setTextColor(colors.green)
  60.     textutils.slowPrint("Connected to server 'Blocksburg Incorporated'...")
  61.     term.setTextColor(colors.white)
  62.     term.setCursorPos(1, math.floor(h - 1))
  63.     write("> ")
  64.     comm = read()
  65.     string.lower(comm)
  66.     if comm == "crack" then
  67.         term.setTextColor(colors.green)
  68.         term.setCursorPos(1,1)
  69.         term.clearLine()
  70.         textutils.slowPrint("Cracking password...")
  71.         sleep(0.5)
  72.         term.setCursorPos(1,1)
  73.         term.clearLine()
  74.         textutils.slowPrint("Password found: '"..cSPassword.."'")
  75.         term.setTextColor(colors.white)
  76.         term.setCursorPos(1, math.floor(h - 1))
  77.         term.clearLine()
  78.         write("> ")
  79.         comm = read()
  80.         clear()
  81.         term.setCursorPos(1,1)
  82.         term.setTextColor(colors.green)
  83.         if string.find(comm, "login ") and string.find(comm, cSPassword) then
  84.             if UItype == "1" or UItype == "filelist" then
  85.                 term.setCursorPos(1,1)
  86.                 term.clearLine()
  87.                 textutils.slowPrint("Password Entered: '"..cSPassword.."'...")
  88.                 sleep(0.5)
  89.                 clear()
  90.                 term.setCursorPos(1,1)
  91.                 term.clearLine()
  92.                 textutils.slowPrint("Login Attempt Success")
  93.                 term.setTextColor(colors.white)
  94.                 term.setCursorPos(1, 3)
  95.                 print("File List:")
  96.                 term.setCursorPos(3, 4)
  97.                 print("os.properties")
  98.                 term.setCursorPos(3, 5)
  99.                 print("Documents")
  100.                 term.setCursorPos(1, math.floor(h - 1))
  101.                 term.clearLine()
  102.                 write("> ")
  103.                 comm = read()
  104.                 if comm == "del os.properties" then
  105.                     term.setCursorPos(1,1)
  106.                     term.setTextColor(colors.green)
  107.                     term.clearLine()
  108.                     textutils.slowPrint("Deleting file 'os.properties'...")
  109.                     sleep(0.5)
  110.                     term.setCursorPos(1,1)
  111.                     term.clearLine()
  112.                     textutils.slowPrint("Done.")
  113.                     term.setTextColor(colors.white)
  114.                     term.setCursorPos(3, 4)
  115.                     term.clearLine()
  116.                     print("<Deleted>")
  117.                     term.setCursorPos(1, math.floor(h - 1))
  118.                     term.clearLine()
  119.                     write("> ")
  120.                     comm = read()
  121.                     if comm == "reboot -i" then
  122.                         clear()
  123.                         sleep(0.5)
  124.                         term.setCursorPos(1,3)
  125.                         term.setTextColor(colors.red)
  126.                         print("Internal Server Error: No such file")
  127.                         sleep(2)
  128.                         map()
  129.                     end
  130.                 end
  131.             elseif UItype == "2" or UItype == "information" then
  132.                 clear()
  133.                 term.setCursorPos(1, 3)
  134.                 term.setTextColor(colors.white)
  135.                 for i=1,w do
  136.                     write("-")
  137.                 end
  138.                 term.setCursorPos(1, 4)
  139.                 term.setTextColor(colors.white)
  140.                 print("Company: "..company)
  141.                 print(" ")
  142.                 balance = math.random(2000, 20000)
  143.                 print("Current Balance: ÂĽA3"..balance)
  144.                 employees = math.random(100, 300)
  145.                 print("Number of Employees: "..employees)
  146.                 term.setCursorPos(1, math.floor(h - 1))
  147.                 term.clearLine()
  148.                 write("> ")
  149.                 term.setCursorPos(1, math.floor(h - 1))
  150.                 term.clearLine()
  151.                 write("> ")
  152.                 comm = read()
  153.                 if comm == "bal "..balance then
  154.                     clear()
  155.                     term.setTextColor(colors.green)
  156.                     textutils.slowPrint("Accessing Financial Screen...")
  157.                     sleep(1)
  158.                     clear()
  159.                     textutils.slowPrint("Done.")
  160.                     term.setTextColor(colors.white)
  161.                     term.setCursorPos(1, math.floor(h - 1))
  162.                     term.clearLine()
  163.                     write("> ")
  164.                     term.setCursorPos(1,3)
  165.                     for i=1,w do
  166.                         write("-")
  167.                     end
  168.                     term.setCursorPos(1,4)
  169.                     print("Balance: "..balance)
  170.                     financeID = math.random(100000, 999999)
  171.                     print("Finance ID: "..financeID)
  172.                     term.setCursorPos(1, math.floor(h - 1))
  173.                     term.clearLine()
  174.                     write("> ")
  175.                     comm = read()
  176.                     if comm == "fid "..financeID then
  177.                         term.setCursorPos(1, math.floor(h - 1))
  178.                         term.clearLine()
  179.                         write("> ")
  180.                         term.setCursorPos(1,1)
  181.                         term.clearLine()
  182.                         term.setTextColor(colors.green)
  183.                         textutils.slowPrint("Overflowing financial buffer...")
  184.                         sleep(1)
  185.                         clear()
  186.                         textutils.slowPrint("Done.")
  187.                         term.setCursorPos(1, 3)
  188.                         term.setTextColor(colors.white)
  189.                         for i=1,w do
  190.                             write("-")
  191.                         end
  192.                         term.setCursorPos(1, 4)
  193.                         term.setTextColor(colors.red)
  194.                         print("Internal Server Error: Financial Buffer Error")
  195.                         sleep(2)
  196.                         map()
  197.                     end
  198.                 end
  199.             end
  200.         end
  201.     end
  202. end
  203.  
  204. function map()
  205.     w, h = term.getSize()
  206.     clear()
  207.     term.setTextColor(colors.green)
  208.     textutils.slowPrint("Initializing Server Map...")
  209.     sleep(1)
  210.     term.setCursorPos(1,1)
  211.     term.clearLine()
  212.     textutils.slowPrint("Done.")
  213.     term.setTextColor(colors.white)
  214.     term.setCursorPos(1, 2)
  215.     for i=1,w do
  216.         write("-")
  217.     end
  218.     term.setCursorPos(3, 4)
  219.     write("F #1")
  220.     term.setCursorPos(15, 4)
  221.     write("S #2")
  222.     term.setCursorPos(1, math.floor(h - 4))
  223.     print("Shop")
  224.     term.setCursorPos(1, math.floor(h - 2))
  225.     print("Enter the number you wish to select. 1 is freeroam.")
  226.     term.setCursorPos(math.floor(w - string.len(playerBalance.." Cr") + 1), 1)
  227.     print(playerBalance.." Cr")
  228.     term.setCursorPos(1, math.floor(h - 1))
  229.     write("> ")
  230.     comm = read()
  231.     string.lower(comm)
  232.     if comm == "1" then
  233.         freeroam(1)
  234.     elseif comm == "2" then
  235.         clear()
  236.         term.setCursorPos(1,2)
  237.         for i=1,w do
  238.             write("-")
  239.         end
  240.         term.setTextColor(colors.green)
  241.         term.setCursorPos(1,1)
  242.         textutils.slowPrint("Selected Server Number 2")
  243.         term.setTextColor(colors.white)
  244.         term.setCursorPos(1,4)
  245.         textutils.slowPrint("Server Owner: Blocksburg Inc.")
  246.         textutils.slowPrint("Security: Password")
  247.         textutils.slowPrint("Server UI: File List")
  248.         print(" ")
  249.         textutils.slowPrint("Type 'connect' to connect to the server.")
  250.         textutils.slowPrint("Type 'back' to exit to the map.")
  251.         term.setCursorPos(1, math.floor(h - 1))
  252.         write("> ")
  253.         comm = read()
  254.         string.lower(comm)
  255.         if comm == "connect" then
  256.             displayServer(1, "Blocksburg")
  257.         elseif comm == "back" then
  258.             map()
  259.         else
  260.             map()
  261.         end
  262.     elseif comm == "shop" then
  263.         shop()
  264.     elseif comm == "exit" then
  265.         clear()
  266.         shell.run("/shiftos")
  267.     end
  268. end
  269.  
  270. function shop()
  271.     clear()
  272.     term.setTextColor(colors.green)
  273.     textutils.slowPrint("Connecting to shop...")
  274.     sleep(1)
  275.     term.setCursorPos(1,1)
  276.     term.clearLine()
  277.     textutils.slowPrint("Done.")
  278.     term.setTextColor(colors.white)
  279.     term.setCursorPos(1, math.floor(h - 2))
  280.     print("Type 'exit' to enter the map.")
  281.     while true do
  282.         term.setTextColor(colors.white)
  283.         term.setCursorPos(math.floor(w - string.len(playerBalance.." Cr") + 1), 1)
  284.         print(playerBalance.." Cr")
  285.         term.setTextColor(colors.white)
  286.         term.setCursorPos(1, 2)
  287.         for i=1,w do
  288.             write("-")
  289.         end
  290.         term.setCursorPos(2, 4)
  291.         if ownsFirewallBypass == false then
  292.             write("(1) Firewall Bypass: "..firewallBypassPrice)
  293.         else
  294.             term.clearLine()
  295.         end
  296.         term.setCursorPos(1, math.floor(h - 1))
  297.         term.clearLine()
  298.         write("> ")
  299.         comm = read()
  300.         string.lower(comm)
  301.         if comm == "1" then
  302.             if ownsFirewallBypass == false then
  303.                 if playerBalance >= firewallBypassPrice then
  304.                     playerBalance = playerBalance - firewallBypassPrice
  305.                     ownsFirewallBypass = true
  306.                     term.setCursorPos(1,1)
  307.                     term.clearLine()
  308.                     term.setTextColor(colors.green)
  309.                     textutils.slowPrint("Successfully Purchased Firewall Bypass")
  310.                 else
  311.                     term.setCursorPos(1,1)
  312.                     term.setTextColor(colors.green)
  313.                     term.clearLine()
  314.                     textutils.slowPrint("You do not have enough money.")
  315.                 end
  316.             elseif ownsFirewallBypass == true then
  317.                 term.setTextColor(colors.green)
  318.                 term.setCursorPos(1,1)
  319.                 term.clearLine()
  320.                 textutils.slowPrint("You already own this item")
  321.             end
  322.         elseif comm == "exit" then
  323.             map()
  324.         end
  325.     end
  326. end
  327.  
  328. function server2()
  329.     clear()
  330.     w, h = term.getSize()
  331.     local serverName = "Blocksburg"
  332.     local serverPasswords = {"block", "blocks", "dogsandcats", "serverpass"}
  333.     local sPassSec = math.random(1, #serverPasswords)
  334.     local cSPassword = serverPasswords[sPassSec]
  335.     local serverBackground = paintutils.loadImage("/server1login")
  336.     paintutils.drawImage(serverBackground, 1, 1)
  337.     term.setTextColor(colors.white)
  338.     term.setBackgroundColor(colors.gray)
  339.     term.setCursorPos(18, 12)
  340.     print("Username")
  341.     term.setCursorPos(18, 15)
  342.     print("Password")
  343.     term.setBackgroundColor(colors.black)
  344.     term.setCursorPos(1,1)
  345.     term.setTextColor(colors.green)
  346.     textutils.slowPrint("Connected to server 'Blocksburg Incorporated'...")
  347.     term.setTextColor(colors.white)
  348.     term.setCursorPos(1, math.floor(h - 1))
  349.     write("> ")
  350.     comm = read()
  351.     string.lower(comm)
  352.     if comm == "crack" then
  353.         term.setTextColor(colors.green)
  354.         term.setCursorPos(1,1)
  355.         term.clearLine()
  356.         textutils.slowPrint("Cracking password...")
  357.         sleep(0.5)
  358.         term.setCursorPos(1,1)
  359.         term.clearLine()
  360.         textutils.slowPrint("Password found: '"..cSPassword.."'")
  361.         term.setTextColor(colors.white)
  362.         term.setCursorPos(1, math.floor(h - 1))
  363.         term.clearLine()
  364.         write("> ")
  365.         comm = read()
  366.         clear()
  367.         term.setCursorPos(1,1)
  368.         term.setTextColor(colors.green)
  369.         if string.find(comm, "login ") and string.find(comm, cSPassword) then
  370.             term.setCursorPos(1,1)
  371.             term.clearLine()
  372.             textutils.slowPrint("Password Entered: '"..cSPassword.."'...")
  373.             sleep(0.5)
  374.             clear()
  375.             term.setCursorPos(1,1)
  376.             term.clearLine()
  377.             textutils.slowPrint("Login Attempt Success")
  378.             term.setTextColor(colors.white)
  379.             term.setCursorPos(1, 3)
  380.             print("File List:")
  381.             term.setCursorPos(3, 4)
  382.             print("os.properties")
  383.             term.setCursorPos(3, 5)
  384.             print("Documents")
  385.             term.setCursorPos(1, math.floor(h - 1))
  386.             term.clearLine()
  387.             write("> ")
  388.             comm = read()
  389.             if comm == "del os.properties" then
  390.                 term.setCursorPos(1,1)
  391.                 term.setTextColor(colors.green)
  392.                 term.clearLine()
  393.                 textutils.slowPrint("Deleting file 'os.properties'...")
  394.                 sleep(0.5)
  395.                 term.setCursorPos(1,1)
  396.                 term.clearLine()
  397.                 textutils.slowPrint("Done.")
  398.                 term.setTextColor(colors.white)
  399.                 term.setCursorPos(3, 4)
  400.                 term.clearLine()
  401.                 print("<Deleted>")
  402.                 term.setCursorPos(1, math.floor(h - 1))
  403.                 term.clearLine()
  404.                 write("> ")
  405.                 comm = read()
  406.                 if comm == "reboot -i" then
  407.                     clear()
  408.                     sleep(0.5)
  409.                     term.setCursorPos(1,3)
  410.                     term.setTextColor(colors.red)
  411.                     print("Internal Server Error: No such file")
  412.                     sleep(2)
  413.                     map()
  414.                 end
  415.             end
  416.         end
  417.     end
  418. end
  419.  
  420. function freeroam(diff)
  421.     tonumber(diff)
  422.     while true do
  423.         w, h = term.getSize()
  424.         if diff == 1 then
  425.             local possibleSecurity = {}
  426.         elseif diff == 2 then
  427.             local possibleSecurity = {"firewall"}
  428.             local security = "firewall"
  429.         elseif diff == 0 or diff == nil then
  430.             error("Error code 002")
  431.         end
  432.         local serverNames = {"Blocksburg", "Intek. Inc"}
  433.         local serverPasswords = {"spass", "dogdog66", "intek", "verygoodpassword", "password"}
  434.         term.setBackgroundColor(colors.black)
  435.         term.setTextColor(colors.white)
  436.         clear()
  437.         background = paintutils.loadImage("/server1login")
  438.         paintutils.drawImage(background, 1, 1)
  439.         term.setCursorPos(19, 7)
  440.         sNameSec = math.random(1, #serverNames)
  441.         sPassSec = math.random(1, #serverPasswords)
  442.         sUISec = math.random(1, 2)
  443.         cServerName = serverNames[sNameSec]
  444.         cServerPass = serverPasswords[sPassSec]
  445.         term.setBackgroundColor(colors.black)
  446.         print(cServerName)
  447.         term.setCursorPos(1,1)
  448.         term.setTextColor(colors.green)
  449.         term.clearLine()
  450.         if sNameSec == 1 then
  451.             textutils.slowPrint("Connected to server 'Blocksburg Incorporated'...")
  452.         else
  453.             textutils.slowPrint("Connected to server 'Intek. Incorporated'...")
  454.         end
  455.         term.setTextColor(colors.white)
  456.         term.setBackgroundColor(colors.gray)
  457.         term.setCursorPos(18, 12)
  458.         print("Username")
  459.         term.setCursorPos(18, 15)
  460.         print("Password")
  461.         term.setBackgroundColor(colors.black)
  462.         term.setCursorPos(1, math.floor(h - 1))
  463.         term.clearLine()
  464.         write("> ")
  465.         comm = read()
  466.         string.lower(comm)
  467.         if comm == "crack" then
  468.             term.setTextColor(colors.green)
  469.             term.setCursorPos(1,1)
  470.             term.clearLine()
  471.             textutils.slowPrint("Cracking password...")
  472.             sleep(0.5)
  473.             term.setCursorPos(1,1)
  474.             term.clearLine()
  475.             textutils.slowPrint("Password found: '"..cServerPass.."'")
  476.             term.setTextColor(colors.white)
  477.             term.setCursorPos(1, math.floor(h - 1))
  478.             term.clearLine()
  479.             write("> ")
  480.             comm = read()
  481.             if true then
  482.                 clear()
  483.                 term.setCursorPos(1,1)
  484.                 term.setTextColor(colors.green)
  485.                 if string.find(comm, "login ") and string.find(comm, cServerPass) then
  486.                     term.setCursorPos(1,1)
  487.                     term.clearLine()
  488.                     textutils.slowPrint("Password Entered: '"..cServerPass.."'...")
  489.                     sleep(0.5)
  490.                     clear()
  491.                     term.setCursorPos(1,1)
  492.                     term.clearLine()
  493.                     textutils.slowPrint("Login Attempt Success")
  494.                     if sUISec == 1 then
  495.                         term.setTextColor(colors.white)
  496.                         term.setCursorPos(1, 3)
  497.                         print("File List:")
  498.                         term.setCursorPos(3, 4)
  499.                         print("os.properties")
  500.                         term.setCursorPos(3, 5)
  501.                         print("Documents")
  502.                         term.setCursorPos(1, math.floor(h - 1))
  503.                         term.clearLine()
  504.                         write("> ")
  505.                         comm = read()
  506.                         if comm == "del os.properties" then
  507.                             term.setCursorPos(1,1)
  508.                             term.setTextColor(colors.green)
  509.                             term.clearLine()
  510.                             textutils.slowPrint("Deleting file 'os.properties'...")
  511.                             sleep(0.5)
  512.                             term.setCursorPos(1,1)
  513.                             term.clearLine()
  514.                             textutils.slowPrint("Done.")
  515.                             term.setTextColor(colors.white)
  516.                             term.setCursorPos(3, 4)
  517.                             term.clearLine()
  518.                             print("<Deleted>")
  519.                             term.setCursorPos(1, math.floor(h - 1))
  520.                             term.clearLine()
  521.                             write("> ")
  522.                             comm = read()
  523.                             if comm == "reboot -i" then
  524.                                 clear()
  525.                                 sleep(0.5)
  526.                                 term.setCursorPos(1,3)
  527.                                 term.setTextColor(colors.red)
  528.                                 print("Internal Server Error: No such file")
  529.                                 sleep(1)
  530.                             end
  531.                         end
  532.                     elseif sUISec == 2 then
  533.                         clear()
  534.                         term.setCursorPos(1, 3)
  535.                         term.setTextColor(colors.white)
  536.                         for i=1,w do
  537.                             write("-")
  538.                         end
  539.                         term.setCursorPos(1, 4)
  540.                         term.setTextColor(colors.white)
  541.                         print("Company: "..serverNames[sNameSec])
  542.                         print(" ")
  543.                         balance = math.random(2000, 20000)
  544.                         print("Current Balance: ÂĽA3"..balance)
  545.                         employees = math.random(100, 300)
  546.                         print("Number of Employees: "..employees)
  547.                         term.setCursorPos(1, math.floor(h - 1))
  548.                         term.clearLine()
  549.                         write("> ")
  550.                         if foundUI2 == false then
  551.                             foundUI2 = true
  552.                             term.setCursorPos(1, math.floor(h - 2))
  553.                             print("This is an information board.")
  554.                             sleep(1)
  555.                             term.setCursorPos(1, math.floor(h - 2))
  556.                             term.clearLine()
  557.                             print("You can type 'bal <Balance>' as one hack.")
  558.                             sleep(1)
  559.                             term.setCursorPos(1, math.floor(h - 2))
  560.                             term.clearLine()
  561.                             print("Try it now: 'bal <Balance>'")
  562.                             term.setCursorPos(1, math.floor(h - 1))
  563.                             term.clearLine()
  564.                             write("> ")
  565.                         end
  566.                         term.setCursorPos(1, math.floor(h - 1))
  567.                         term.clearLine()
  568.                         write("> ")
  569.                         comm = read()
  570.                         if comm == "bal "..balance then
  571.                             clear()
  572.                             term.setTextColor(colors.green)
  573.                             textutils.slowPrint("Accessing Financial Screen...")
  574.                             sleep(1)
  575.                             clear()
  576.                             textutils.slowPrint("Done.")
  577.                             term.setTextColor(colors.white)
  578.                             term.setCursorPos(1, math.floor(h - 1))
  579.                             term.clearLine()
  580.                             write("> ")
  581.                             term.setCursorPos(1,3)
  582.                             for i=1,w do
  583.                                 write("-")
  584.                             end
  585.                             term.setCursorPos(1,4)
  586.                             print("Balance: "..balance)
  587.                             financeID = math.random(100000, 999999)
  588.                             print("Finance ID: "..financeID)
  589.                             term.setCursorPos(1, math.floor(h - 1))
  590.                             term.clearLine()
  591.                             write("> ")
  592.                             comm = read()
  593.                             if comm == "fid "..financeID then
  594.                                 term.setCursorPos(1, math.floor(h - 1))
  595.                                 term.clearLine()
  596.                                 write("> ")
  597.                                 term.setCursorPos(1,1)
  598.                                 term.clearLine()
  599.                                 term.setTextColor(colors.green)
  600.                                 textutils.slowPrint("Overflowing financial buffer...")
  601.                                 sleep(1)
  602.                                 clear()
  603.                                 textutils.slowPrint("Done.")
  604.                                 term.setCursorPos(1, 3)
  605.                                 term.setTextColor(colors.white)
  606.                                 for i=1,w do
  607.                                     write("-")
  608.                                 end
  609.                                 term.setCursorPos(1, 4)
  610.                                 term.setTextColor(colors.red)
  611.                                 print("Internal Server Error: Financial Buffer Error")
  612.                                 sleep(2)
  613.                             end
  614.                         end
  615.                     end
  616.                 end
  617.             end
  618.         elseif comm == "map" then
  619.             map()
  620.         end
  621.     end
  622. end
  623.  
  624. clear()
  625.  
  626. if tArgs[1] == nil then
  627.   print("What would you like your username to be?")
  628.   write("Username: ")
  629.   uname = read()
  630.   print(" ")
  631.   print("What would you like your password to be?")
  632.   write("Password: ")
  633.   pword = read("*")
  634. elseif tArgs[1] == "-nologin" then
  635.     uname = "username"
  636.     pword = "password"
  637. elseif tArgs[1] == "-server1" then
  638.     server1 = true
  639.     uname = "username"
  640.     pword = "password"
  641. elseif tArgs[1] == "-crash" and tArgs[2] ~= nil then
  642.     error("Error code "..tArgs[2])
  643. elseif tArgs[1] == "-freeroam" then
  644.     server1 = true
  645.     freeroamEnabled = true
  646.     freeroam(1)
  647. elseif tArgs[1] == "-map" then
  648.     freeroamEnabled = true
  649.     server1 = true
  650.     map()
  651. elseif tArgs[1] == "-server2" then
  652.     freeroamEnabled = true
  653.     server1 = true
  654.     server2()
  655. elseif tArgs[1] == "-serverGen" then
  656.     displayServer(tArgs[2], tArgs[3])
  657. elseif tArgs[1] == "-achievements" then
  658.     achievement(tArgs[2])
  659. end
  660.  
  661. w, h = term.getSize()
  662.  
  663. if server1 == false then
  664.   clear()
  665.   term.setCursorPos(math.floor(w / 2 - string.len("-= GenieChat =-")), 1)
  666.   print("-= GenieChat =-")
  667.   print(" ")
  668.   print("Please Login to GenieChat")
  669.   print(" ")
  670.   write("Username: ")
  671.   unameIn = read()
  672.   if unameIn == uname then
  673.     print(" ")
  674.     write("Password: ")
  675.     pwordIn = read("*")
  676.     if pwordIn == pword then
  677.       clear()
  678.       term.setCursorPos(math.floor(w / 2 - string.len("-= GenieChat =-")), 1)
  679.       print("-= GenieChat =-")
  680.       print("Moved to channel #4724")
  681.       print(" ")
  682.       print("<agentli>: Hi!")
  683.       sleep(1.5)
  684.       print("<You>: Hey.")
  685.       sleep(1.5)
  686.       print("<agentli>: So, what do you want to do?")
  687.       sleep(1.5)
  688.       print("<You>: I dunno.")
  689.       sleep(1)
  690.       term.setBackgroundColor(colors.red)
  691.       clear()
  692.       sleep(0.25)
  693.       term.setBackgroundColor(colors.black)
  694.       clear()
  695.       term.setCursorPos(math.floor(w / 2 - string.len("-= GenieChat =-")), 1)
  696.       print("-= GenieChat =-")
  697.       print(" ")
  698.       print("Moved to channel #666")
  699.       print(" ")
  700.       print("<agentls>: What just happened?")
  701.       sleep(1.5)
  702.       print("<You>: I dunno. Your username changed.")
  703.       sleep(1.5)
  704.       print("<agentli>: Better now?")
  705.       sleep(1.5)
  706.       print("<You>: Umm... Yeah, I guess...")
  707.       sleep(1.5)
  708.       print("<agentli>: Ok. Back to the job.")
  709.       sleep(1.5)
  710.       print("<You>: 'job'...?")
  711.       sleep(1.5)
  712.       print("<agentli>: You don't know? I want you to gain access to a server and... let's just say do some damage...")
  713.       sleep(1.5)
  714.       print("<You>: You mean hacking? I don't want to do that!")
  715.       sleep(1.5)
  716.       print("<agentli>: Well... too bad, I guess. Just press a key please.")
  717.       sleep(1)
  718.       print(" ")
  719.       print("-= Please press a key to continue... =-")
  720.       os.pullEvent("key")
  721.       print(" ")
  722.       print("-= Error: Unstability Detected! =-")
  723.       sleep(0.75)
  724.       term.setBackgroundColor(colors.lightBlue)
  725.       sleep(0.75)
  726.       clear()
  727.       term.setBackgroundColor(colors.black)
  728.       clear()
  729.     else
  730.       print(" ")
  731.       print("Incorrect Password.")
  732.       sleep(2)
  733.       os.reboot()
  734.       end
  735.   else
  736.       print(" ")
  737.       print("Invalid Username.")
  738.       sleep(2)
  739.       os.reboot()
  740.   end
  741. end
  742.  
  743. displayServer()
  744. term.setBackgroundColor(colors.black)
  745. term.setCursorPos(1, math.floor(h - 2))
  746. print("This is the server.")
  747. sleep(2)
  748. clear()
  749. displayServer()
  750. term.setCursorPos(1, math.floor(h - 2))
  751. print("Type 'crack' to crack the password.")
  752. term.setCursorPos(1, math.floor(h - 1))
  753. write("> ")
  754. comm = read()
  755. if comm == "crack" then
  756.     term.setCursorPos(1, 1)
  757.     term.setTextColor(colors.green)
  758.     textutils.slowPrint("Cracking password...")
  759.     term.setCursorPos(1,1)
  760.     sleep(0.5)
  761.     term.clearLine()
  762.     textutils.slowPrint("Password Found: 'spass'")
  763.     term.setTextColor(colors.white)
  764.     term.setCursorPos(1, math.floor(h - 2))
  765.     term.clearLine()
  766.     print("Well done. Now, type 'login spass' to login.")
  767.     term.setCursorPos(1, math.floor(h - 1))
  768.     term.clearLine()
  769.     write("> ")
  770.     comm = read()
  771.     if comm == "login spass" then
  772.         term.setCursorPos(1, 1)
  773.         term.setTextColor(colors.green)
  774.         term.clearLine()
  775.         textutils.slowPrint("Password Entered: 'spass'...")
  776.         sleep(0.5)
  777.         clear()
  778.         term.setCursorPos(1,1)
  779.         term.clearLine()
  780.         textutils.slowPrint("Login Attempt Success")
  781.         term.setTextColor(colors.white)
  782.         term.setCursorPos(1, 3)
  783.         print("File List:")
  784.         term.setCursorPos(3, 4)
  785.         print("os.properties")
  786.         term.setCursorPos(3, 5)
  787.         print("Documents")
  788.         term.setCursorPos(1, math.floor(h - 2))
  789.         print("So, type 'del os.properties' to delete the file.")
  790.         term.setCursorPos(1, math.floor(h - 1))
  791.         write("> ")
  792.         comm = read()
  793.         if comm == "del os.properties" then
  794.             term.setCursorPos(1,1)
  795.             term.setTextColor(colors.green)
  796.             term.clearLine()
  797.             textutils.slowPrint("Deleting file 'os.properties'...")
  798.             sleep(0.5)
  799.             term.setCursorPos(1,1)
  800.             term.clearLine()
  801.             textutils.slowPrint("Done.")
  802.             term.setTextColor(colors.white)
  803.             term.setCursorPos(3, 4)
  804.             term.clearLine()
  805.             print("<Deleted>")
  806.             term.setCursorPos(1, math.floor(h - 2))
  807.             print("Now, type 'reboot -i' to reboot the server.")
  808.             term.setCursorPos(1, math.floor(h - 1))
  809.             term.clearLine()
  810.             write("> ")
  811.             comm = read()
  812.             if comm == "reboot -i" then
  813.                 clear()
  814.                 sleep(0.5)
  815.                 term.setCursorPos(1,3)
  816.                 term.setTextColor(colors.red)
  817.                 print("Internal Server Error: No such file")
  818.                 sleep(0.5)
  819.                 term.setCursorPos(1, math.floor(h - 2))
  820.                 term.setTextColor(colors.white)
  821.                 print("Okay. Well done. Just a second, don't type 'exit'!")
  822.                 term.setCursorPos(1, math.floor(h - 1))
  823.                 write("> ")
  824.                 comm = read()
  825.                 if comm == "exit" then
  826.                     freeroamEnabled = true
  827.                 end
  828.             end
  829.         end
  830.     end
  831. end
  832.  
  833. if freeroamEnabled == true then
  834.     freeroam(1)
  835.     --clear()
  836.     --term.setTextColor(colors.white)
  837.     --print("You have completed the demo.")
  838. else -- Error Code 001 = freeroam not enabled, but reached
  839.     error("Error code 001")
  840. end
Add Comment
Please, Sign In to add comment