VlaD00m

SecuCODEX

Sep 16th, 2020 (edited)
444
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --[[ SecuCODEX Code Door System.
  2. Program-system for password and "fingerprint" based access computer system
  3. Author: Bs()Dd
  4.  
  5. Idea and base interface concept borrowed from ECS's CodeDoor
  6.  
  7. Program-system working without OpenOS, because "hackers" can't kill it by CTRL+ALT+C
  8.  
  9. Requirements to computer system:
  10.  - Tier 2 Computer (preferably Tier 3 for Tier 3 Video card)
  11.  - Tier 2 Video Card (preferably Tier 3 for correct color display)
  12.  - Tier 2 Monitor (preferably Tier 3 for correct color display)
  13.  - Tier 1 Processor
  14.  - Tier 1 Hard Drive
  15.  - 1x Tier 1 Memory
  16.  - Tier 1 Redstone Card or Redstone I/O block
  17.  
  18. Installing:
  19.  1. Download this file as init.lua to hard drive in access computer system (pastebin get AvmkEgix /mnt/<adr>/init.lua)
  20.  2. Boot from drive by Lua BIOS
  21.  3. Make first Setup
  22.  4. Enjoy))
  23.  
  24. To enter in Setup menu, click on 'c' in "(c)" in copyright line and enter access password
  25.  
  26. After entering correct password, player's "fingerprint" adds to DB
  27. Player may be deleted from DB by removing his nickname from /configs/fingers.cfg
  28. ]]
  29.  
  30. function totable(inputstr)
  31.   local t={}
  32.    for str in string.gmatch(inputstr, "([^\n]+)") do
  33.      table.insert(t, str)
  34.    end
  35.    return t
  36. end
  37.  
  38. function untable(table)
  39.   res= ''
  40.   for _,x in pairs(table) do
  41.     res= res..x..'\n'
  42.   end
  43.   return res
  44. end
  45.  
  46. function sleep(timeout)
  47.   checkArg(1, timeout, "number", "nil")
  48.   local deadline = computer.uptime() + (timeout or 0)
  49.   repeat
  50.     pull(deadline - computer.uptime())
  51.   until computer.uptime() >= deadline
  52. end
  53.  
  54. function pull(...)
  55.   local args = table.pack(...)
  56.   if type(args[1]) == "string" then
  57.     return pullFiltered(createPlainFilter(...))
  58.   else
  59.     checkArg(1, args[1], "number", "nil")
  60.     checkArg(2, args[2], "string", "nil")
  61.     return pullFiltered(args[1], createPlainFilter(select(2, ...)))
  62.   end
  63. end
  64.  
  65. function pullFiltered(...)
  66.   local args = table.pack(...)
  67.   local seconds, filter = math.huge
  68.  
  69.   if type(args[1]) == "function" then
  70.     filter = args[1]
  71.   else
  72.     checkArg(1, args[1], "number", "nil")
  73.     checkArg(2, args[2], "function", "nil")
  74.     seconds = args[1]
  75.     filter = args[2]
  76.   end
  77.  
  78.   repeat
  79.     local signal = table.pack(computer.pullSignal(seconds))
  80.     if signal.n > 0 then
  81.       if not (seconds or filter) or filter == nil or filter(table.unpack(signal, 1, signal.n)) then
  82.         return table.unpack(signal, 1, signal.n)
  83.       end
  84.     end
  85.   until signal.n == 0
  86. end
  87.  
  88. function createPlainFilter(name, ...)
  89.   local filter = table.pack(...)
  90.   if name == nil and filter.n == 0 then
  91.     return nil
  92.   end
  93.  
  94.   return function(...)
  95.     local signal = table.pack(...)
  96.     if name and not (type(signal[1]) == "string" and signal[1]:match(name)) then
  97.       return false
  98.     end
  99.     for i = 1, filter.n do
  100.       if filter[i] ~= nil and filter[i] ~= signal[i + 1] then
  101.         return false
  102.       end
  103.     end
  104.     return true
  105.   end
  106. end
  107.  
  108. function drawplate(preset)
  109.   if preset == 'gr' then
  110.     vid.setBackground(0x00FF00)
  111.     vid.fill(1,1,60,7, " ")
  112.     vid.setForeground(0x000000)
  113.     vid.set(17,1,'SecuCODEX Code Door System')
  114.     npos = (60-10-#who)/2
  115.     if (60-10-#who)%2 ~= 0 then npos = npos + 1 end
  116.     vid.set(math.floor(npos),4,'Welcome, '..who..'!')
  117.     vid.setBackground(0x009200)
  118.     vid.fill(1,8,60,1, " ")
  119.     vid.setBackground(0x006D00)
  120.     vid.fill(1,9,60,1, " ")
  121.   end
  122.   if preset == 'wh' then
  123.     vid.setBackground(0xFFFFFF)
  124.     vid.fill(1,1,60,7, " ")
  125.     vid.setForeground(0x000000)
  126.     vid.set(17,1,'SecuCODEX Code Door System')
  127.     vid.setBackground(0xC3C3C3)
  128.     vid.fill(1,8,60,1, " ")
  129.     vid.setBackground(0x969696)
  130.     vid.fill(1,9,60,1, " ")
  131.   end
  132.   if preset == 'rd' then
  133.     vid.setBackground(0xFF0000)
  134.     vid.fill(1,1,60,7, " ")
  135.     vid.setForeground(0x000000)
  136.     vid.set(17,1,'SecuCODEX Code Door System')
  137.     vid.set(23,4,'ACCESS DENIED!')
  138.     vid.setBackground(0x990000)
  139.     vid.fill(1,8,60,1, " ")
  140.     vid.setBackground(0x660000)
  141.     vid.fill(1,9,60,1, " ")
  142.   end
  143. end
  144.  
  145. function drawkeys()
  146.   vid.setBackground(0x000000)
  147.   vid.setForeground(0xFF0000)
  148.   vid.set(6,10, '╔═══════╗   ╔═══════╗   ╔═══════╗')
  149.   vid.set(6,11, '║       ║   ║       ║   ║       ║')
  150.   vid.set(6,12, '║   1   ║   ║   2   ║   ║   3   ║')
  151.   vid.set(6,13, '║       ║   ║       ║   ║       ║')
  152.   vid.set(6,14, '╚═══════╝   ╚═══════╝   ╚═══════╝')
  153.   vid.set(6,15, '╔═══════╗   ╔═══════╗   ╔═══════╗')
  154.   vid.set(6,16, '║       ║   ║       ║   ║       ║')
  155.   vid.set(6,17, '║   4   ║   ║   5   ║   ║   6   ║')
  156.   vid.set(6,18, '║       ║   ║       ║   ║       ║')
  157.   vid.set(6,19, '╚═══════╝   ╚═══════╝   ╚═══════╝')
  158.   vid.set(6,20, '╔═══════╗   ╔═══════╗   ╔═══════╗')
  159.   vid.set(6,21, '║       ║   ║       ║   ║       ║')
  160.   vid.set(6,22, '║   7   ║   ║   8   ║   ║   9   ║')
  161.   vid.set(6,23, '║       ║   ║       ║   ║       ║')
  162.   vid.set(6,24, '╚═══════╝   ╚═══════╝   ╚═══════╝')
  163.   vid.set(6,25, '╔═══════╗   ╔═══════╗   ╔═══════╗')
  164.   vid.set(6,26, '║       ║   ║       ║   ║       ║')
  165.   vid.set(6,27, '║   C   ║   ║   0   ║   ║   E   ║')
  166.   vid.set(6,28, '║       ║   ║       ║   ║       ║')
  167.   vid.set(6,29, '╚═══════╝   ╚═══════╝   ╚═══════╝')
  168. end
  169.  
  170. function drawfinger()
  171.   vid.setBackground(0x000000)
  172.   vid.setForeground(0xFF0000)
  173.   vid.set(43,16, '╔═════════════╗')
  174.   vid.set(43,17, '║ Finger      ║')
  175.   vid.set(43,18, '║       print ║')
  176.   vid.set(43,19, '║  Scanner    ║')
  177.   vid.set(43,20, '║             ║')
  178.   vid.set(43,21, '║ Compys      ║')
  179.   vid.set(43,22, '║   OCFPS-412 ║')
  180.   vid.set(43,23, '╚═════════════╝')
  181. end
  182.  
  183. function drawpushed(x,y,n)
  184.   vid.setBackground(0xFF0000)
  185.   vid.setForeground(0x000000)
  186.   vid.set(x,y  , '╔═══════╗')
  187.   vid.set(x,y+1, '║       ║')
  188.   vid.set(x,y+2, '║   '..n..'   ║')
  189.   vid.set(x,y+3, '║       ║')
  190.   vid.set(x,y+4, '╚═══════╝')
  191. end
  192.  
  193. function know(setmode)
  194.   z = {{7,11},{8,11},{9,11},{10,11},{11,11},{12,11},{13,11},
  195.        {7,12},{8,12},{9,12},{10,12},{11,12},{12,12},{13,12},
  196.        {7,13},{8,13},{9,13},{10,13},{11,13},{12,13},{13,13}}
  197.   for _,point in pairs(z) do
  198.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 6,10,1 end
  199.   end
  200.   z = {{19,11},{20,11},{21,11},{22,11},{23,11},{24,11},{25,11},
  201.        {19,12},{20,12},{21,12},{22,12},{23,12},{24,12},{25,12},
  202.        {19,13},{20,13},{21,13},{22,13},{23,13},{24,13},{25,13}}
  203.   for _,point in pairs(z) do
  204.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 18,10,2 end
  205.   end
  206.   z = {{31,11},{32,11},{33,11},{34,11},{35,11},{36,11},{37,11},
  207.        {31,12},{32,12},{33,12},{34,12},{35,12},{36,12},{37,12},
  208.        {31,13},{32,13},{33,13},{34,13},{35,13},{36,13},{37,13}}
  209.   for _,point in pairs(z) do
  210.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 30,10,3 end
  211.   end
  212.   z = {{7,16},{8,16},{9,16},{10,16},{11,16},{12,16},{13,16},
  213.        {7,17},{8,17},{9,17},{10,17},{11,17},{12,17},{13,17},
  214.        {7,18},{8,18},{9,18},{10,18},{11,18},{12,18},{13,18}}
  215.   for _,point in pairs(z) do
  216.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 6,15,4 end
  217.   end
  218.   z = {{19,16},{20,16},{21,16},{22,16},{23,16},{24,16},{25,16},
  219.        {19,17},{20,17},{21,17},{22,17},{23,17},{24,17},{25,17},
  220.        {19,18},{20,18},{21,18},{22,18},{23,18},{24,18},{25,18}}
  221.   for _,point in pairs(z) do
  222.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 18,15,5 end
  223.   end
  224.   z = {{31,16},{32,16},{33,16},{34,16},{35,16},{36,16},{37,16},
  225.        {31,17},{32,17},{33,17},{34,17},{35,17},{36,17},{37,17},
  226.        {31,18},{32,18},{33,18},{34,18},{35,18},{36,18},{37,18}}
  227.   for _,point in pairs(z) do
  228.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 30,15,6 end
  229.   end
  230.   z = {{7,21},{8,21},{9,21},{10,21},{11,21},{12,21},{13,21},
  231.        {7,22},{8,22},{9,22},{10,22},{11,22},{12,22},{13,22},
  232.        {7,23},{8,23},{9,23},{10,23},{11,23},{12,23},{13,23}}
  233.   for _,point in pairs(z) do
  234.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 6,20,7 end
  235.   end
  236.   z = {{19,21},{20,21},{21,21},{22,21},{23,21},{24,21},{25,21},
  237.        {19,22},{20,22},{21,22},{22,22},{23,22},{24,22},{25,22},
  238.        {19,23},{20,23},{21,23},{22,23},{23,23},{24,23},{25,23}}
  239.   for _,point in pairs(z) do
  240.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 18,20,8 end
  241.   end
  242.   z = {{31,21},{32,21},{33,21},{34,21},{35,21},{36,21},{37,21},
  243.        {31,22},{32,22},{33,22},{34,22},{35,22},{36,22},{37,22},
  244.        {31,23},{32,23},{33,23},{34,23},{35,23},{36,23},{37,23}}
  245.   for _,point in pairs(z) do
  246.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 30,20,9 end
  247.   end
  248.   z = {{7,26},{8,26},{9,26},{10,26},{11,26},{12,26},{13,26},
  249.        {7,27},{8,27},{9,27},{10,27},{11,27},{12,27},{13,27},
  250.        {7,28},{8,28},{9,28},{10,28},{11,28},{12,28},{13,28}}
  251.   for _,point in pairs(z) do
  252.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 6,25,'C' end
  253.   end
  254.   z = {{19,26},{20,26},{21,26},{22,26},{23,26},{24,26},{25,26},
  255.        {19,27},{20,27},{21,27},{22,27},{23,27},{24,27},{25,27},
  256.        {19,28},{20,28},{21,28},{22,28},{23,28},{24,28},{25,28}}
  257.   for _,point in pairs(z) do
  258.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 18,25,0 end
  259.   end
  260.   z = {{31,26},{32,26},{33,26},{34,26},{35,26},{36,26},{37,26},
  261.        {31,27},{32,27},{33,27},{34,27},{35,27},{36,27},{37,27},
  262.        {31,28},{32,28},{33,28},{34,28},{35,28},{36,28},{37,28}}
  263.   for _,point in pairs(z) do
  264.     if tpoint[1] == point[1] and tpoint[2] == point[2] then return 30,25,'E' end
  265.   end
  266.   if tpoint[1] == 20 and tpoint[2] == 30 and setmode == false then setup() end
  267.   if setmode == false then
  268.     z = {{44,17},{45,17},{46,17},{47,17},{48,17},{49,17},{50,17},{51,17},{52,17},{53,17},{54,17},{55,17},{56,17},
  269.         {44,18},{45,18},{46,18},{47,18},{48,18},{49,18},{50,18},{51,18},{52,18},{53,18},{54,18},{55,18},{56,18},
  270.         {44,19},{45,19},{46,19},{47,19},{48,19},{49,19},{50,19},{51,19},{52,19},{53,19},{54,19},{55,19},{56,19},
  271.         {44,20},{45,20},{46,20},{47,20},{48,20},{49,20},{50,20},{51,20},{52,20},{53,20},{54,20},{55,20},{56,20},
  272.         {44,21},{45,21},{46,21},{47,21},{48,21},{49,21},{50,21},{51,21},{52,21},{53,21},{54,21},{55,21},{56,21},
  273.         {44,22},{45,22},{46,22},{47,22},{48,22},{49,22},{50,22},{51,22},{52,22},{53,22},{54,22},{55,22},{56,22}}
  274.     for _,point in pairs(z) do
  275.       if tpoint[1] == point[1] and tpoint[2] == point[2] then
  276.         fg=1
  277.         finger()
  278.         for _,name in pairs(allowed) do
  279.           if who == name then inpassw = passw fg= nil return 500,500,'E' end
  280.         end
  281.       end
  282.     end
  283.     if fg == 1 then fg = 0 inpassw='' return 500,500,'E' end
  284.   end
  285. end
  286.  
  287. function setup()
  288.   vid.setBackground(0x000000)
  289.   vid.setForeground(0xFFFFFF)
  290.   vid.fill(1,1,60,9, " ")
  291.   vid.set(1,1,'SecuCODEX v1.08 Setup')
  292.   vid.set(1,2,'Old Password: ')
  293.   apassw = ''
  294.   drawkeys()
  295.   pos = 1
  296.   while true do
  297.     _,_,tx,ty,_,who = pull('touch')
  298.     tpoint = {tx,ty}
  299.     x,y,n = know(true)
  300.     if n ~= nil then
  301.       drawpushed(x,y,n)
  302.       vid.setBackground(0x000000)
  303.       vid.setForeground(0xFFFFFF)
  304.       if n== 'C' then apassw='' vid.fill(14, 2, 60, 1, " ") pos =1 sleep(0.1) drawkeys()
  305.       elseif n== 'E' then sleep(0.1) drawkeys() break
  306.       else
  307.         pos = pos+1
  308.         apassw = apassw..n
  309.         vid.set(pos+13,2, "*")
  310.         sleep(0.1)
  311.         drawkeys()
  312.       end
  313.     end
  314.   end
  315.   if apassw == passw then intap() else drawplate('wh') end
  316. end
  317.  
  318. function intap()
  319.   f=hdd.open('/configs/sets.cfg',"w")
  320.   vid.setBackground(0x000000)
  321.   vid.setForeground(0xFFFFFF)
  322.   vid.fill(1,1,60,9, " ")
  323.   vid.set(1,1,'SecuCODEX v1.08 Setup')
  324.   vid.set(1,2,'New Password: ')
  325.   passw = ''
  326.   drawkeys()
  327.   pos = 1
  328.   while true do
  329.     _,_,tx,ty,_,who = pull('touch')
  330.     tpoint = {tx,ty}
  331.     x,y,n = know(true)
  332.     if n ~= nil then
  333.       drawpushed(x,y,n)
  334.       vid.setBackground(0x000000)
  335.       vid.setForeground(0xFFFFFF)
  336.       if n== 'C' then passw='' vid.fill(14, 2, 60, 1, " ") pos =1 sleep(0.1) drawkeys()
  337.       elseif n== 'E' then sleep(0.1) drawkeys() break
  338.       else
  339.         pos = pos+1
  340.         passw = passw..n
  341.         vid.set(pos+13,2, "*")
  342.         sleep(0.1)
  343.         drawkeys()
  344.       end
  345.     end
  346.   end
  347.   vid.setBackground(0x000000)
  348.   vid.setForeground(0xFFFFFF)
  349.   vid.fill(1,2,60,8, " ")
  350.   vid.set(1,2,'Side for correct code (0-5): ')
  351.   corr = ''
  352.   pos = 1
  353.   while true do
  354.     _,_,tx,ty,_,who = pull('touch')
  355.     tpoint = {tx,ty}
  356.     x,y,n = know(true)
  357.     if n ~= nil then
  358.       drawpushed(x,y,n)
  359.       vid.setBackground(0x000000)
  360.       vid.setForeground(0xFFFFFF)
  361.       if n== 'C' then corr='' vid.fill(29, 2, 60, 1, " ") pos =1 sleep(0.1) drawkeys()
  362.       elseif n== 'E' then sleep(0.1) drawkeys() break
  363.       else
  364.         pos = pos+1
  365.         corr = corr..n
  366.         vid.set(pos+28,2, tostring(n))
  367.         sleep(0.1)
  368.         drawkeys()
  369.       end
  370.     end
  371.   end
  372.   vid.setBackground(0x000000)
  373.   vid.setForeground(0xFFFFFF)
  374.   vid.fill(1,2,60,8, " ")
  375.   vid.set(1,2,'Side for incorrect code (0-5): ')
  376.   incorr = ''
  377.   pos = 1
  378.   while true do
  379.     _,_,tx,ty,_,who = pull('touch')
  380.     tpoint = {tx,ty}
  381.     x,y,n = know(true)
  382.     if n ~= nil then
  383.       drawpushed(x,y,n)
  384.       vid.setBackground(0x000000)
  385.       vid.setForeground(0xFFFFFF)
  386.       if n== 'C' then incorr='' vid.fill(31, 2, 60, 1, " ") pos =1 sleep(0.1) drawkeys()
  387.       elseif n== 'E' then sleep(0.1) drawkeys() break
  388.       else
  389.         pos = pos+1
  390.         incorr = incorr..n
  391.         vid.set(pos+30,2, tostring(n))
  392.         sleep(0.1)
  393.         drawkeys()
  394.       end
  395.     end
  396.   end
  397.   vid.setBackground(0x000000)
  398.   vid.setForeground(0xFFFFFF)
  399.   vid.fill(1,2,60,8, " ")
  400.   vid.set(1,2,'Show password? [E/C]: ')
  401.   while true do
  402.     _,_,tx,ty,_,who = pull('touch')
  403.     tpoint = {tx,ty}
  404.     x,y,n = know(true)
  405.     if n ~= nil then
  406.       drawpushed(x,y,n)
  407.       if n== 'C' then stars = 'false' sleep(0.1) drawkeys() break
  408.       elseif n== 'E' then stars = 'true' sleep(0.1) drawkeys() break
  409.       end
  410.     end
  411.   end
  412.   vid.setBackground(0x000000)
  413.   vid.setForeground(0xFFFFFF)
  414.   vid.fill(1,2,60,8, " ")
  415.   vid.set(1,2,'Show key push? [E/C]: ')
  416.   while true do
  417.     _,_,tx,ty,_,who = pull('touch')
  418.     tpoint = {tx,ty}
  419.     x,y,n = know()
  420.     if n ~= nil then
  421.       drawpushed(x,y,n)
  422.       if n== 'C' then kpush = 'false'  sleep(0.1) drawkeys() break
  423.       elseif n== 'E' then kpush = 'true' sleep(0.1) drawkeys() break
  424.       end
  425.     end
  426.   end
  427.   hdd.write(f,passw..'\n'..stars..'\n'..kpush..'\n'..corr..'\n'..incorr)
  428.   hdd.close(f)
  429.   computer.shutdown(true)
  430. end
  431.  
  432. function finger()
  433.   vid.setBackground(0x000000)
  434.   vid.setForeground(0xFF0000)
  435.   rr=22
  436.   while rr ~=17 do
  437.     vid.set(44,rr, '─────────────')
  438.     sleep(0.05)
  439.     vid.set(44,rr, '             ')
  440.     rr=rr-1
  441.   end
  442.   while rr ~=22 do
  443.     vid.set(44,rr, '─────────────')
  444.     sleep(0.05)
  445.     vid.set(44,rr, '             ')
  446.     rr=rr+1
  447.   end
  448.   sleep(0.05)
  449.   vid.set(44,17, ' ███████████ ')
  450.   vid.set(44,18, ' █   ████  █ ')
  451.   vid.set(44,19, ' █  █   █  █ ')
  452.   vid.set(44,20, ' █  █ █ ██ █ ')
  453.   vid.set(44,21, ' █ ██ █ █  █ ')
  454.   vid.set(44,22, ' ███████████ ')
  455. end
  456.  
  457. red=component.proxy(component.list("redstone")())
  458. vid=component.proxy(component.list("gpu")())
  459. mx, my = vid.getResolution()
  460. vid.fill(1, 1, mx, my, " ")
  461. vid.setResolution(60,30)
  462. mx, my = vid.getResolution()
  463. for hda in pairs(component.list("filesystem")) do
  464.   hdd=component.proxy(hda)
  465.   if hdd.getLabel() ~= 'tmpfs' then break end
  466. end
  467. if hdd.exists('/configs/sets.cfg') then
  468.   f=hdd.open('/configs/sets.cfg',"r")
  469.   rd=hdd.read(f,512)
  470.   rd = totable(rd)
  471.   passw= rd[1]
  472.   stars= rd[2]
  473.   kpush= rd[3]
  474.   corr= rd[4]
  475.   incorr= rd[5]
  476.   if #rd ~= 5 then intap() end
  477.   hdd.close(f)
  478.   f=hdd.open('/configs/fingers.cfg',"r")
  479.   allowed = hdd.read(f,512)
  480.   if allowed == nil then allowed = {} else allowed = totable(allowed) end
  481.   hdd.close(f)
  482. else
  483.   hdd.makeDirectory('/configs/')
  484.   hdd.open('/configs/fingers.cfg',"w")
  485.   intap()
  486. end
  487. drawplate('wh')
  488. drawkeys()
  489. vid.setForeground(0x00FF00)
  490. vid.set(14,30,'2020 (c) Compys Security Software')
  491. while true do
  492.   inpassw=''
  493.   see=''
  494.   drawkeys()
  495.   drawfinger()
  496.   pos = 1
  497.   prept = 31
  498.   while true do
  499.     _,_,tx,ty,_,who = pull('touch')
  500.     tpoint = {tx,ty}
  501.     x,y,n = know(false)
  502.     if n ~= nil then
  503.       if kpush =='true' then drawpushed(x,y,n) end
  504.       vid.setBackground(0xFFFFFF)
  505.       vid.setForeground(0x000000)
  506.       if n== 'C' then inpassw='' see='' vid.fill(1, 4, 60, 1, " ") pos =1 prept = 31 sleep(0.1) drawkeys()
  507.       elseif n== 'E' then sleep(0.1) drawkeys() break
  508.       else
  509.         pos = pos+1
  510.         if pos % 2 == 0 then prept= prept-1 end
  511.         inpassw = inpassw..n
  512.         if stars == 'false' then
  513.           see= see..'*'
  514.         else
  515.           see= see..n
  516.         end
  517.         vid.set(prept,4,see)
  518.         sleep(0.1)
  519.         drawkeys()
  520.       end
  521.     end
  522.   end
  523.   if inpassw == passw then
  524.     drawplate('gr')
  525.     red.setOutput(tonumber(corr), 15)
  526.     for _,name in pairs(allowed) do
  527.       if who == name then exis=true break end
  528.     end
  529.     if exis~=true then table.insert(allowed, who) f=hdd.open('/configs/fingers.cfg',"w") hdd.write(f,untable(allowed)) hdd.close(f) end
  530.     exis= nil
  531.   else
  532.     drawplate('rd')
  533.     red.setOutput(tonumber(incorr), 15)
  534.   end
  535.   sleep(1.5)
  536.   drawplate('wh')
  537.   red.setOutput(tonumber(corr), 0)
  538.   red.setOutput(tonumber(incorr), 0)
  539. end
RAW Paste Data