Advertisement
Guest User

lg

a guest
May 31st, 2019
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.37 KB | None | 0 0
  1. local component=require("component")
  2.  
  3. local rs=component.redstone
  4.  
  5. local gpu=component.gpu
  6.  
  7. local term=require("term")
  8.  
  9. local text=require("text")
  10.  
  11. local computer=require("computer")
  12.  
  13. local os=require("os")
  14.  
  15. local sides = require("sides")
  16.  
  17. ----Config----
  18.  
  19. local delay1=1             --The delay what the redstone is on for (1)
  20.  
  21. local delay2=1             --The delay what the redstone is on for (2)
  22.  
  23. local side1=0              --The redstone side (1)
  24.  
  25. local side2=0              --The redstone side (2)
  26.  
  27. local username1="polis"     --Username (1)
  28.  
  29. local username2="holm"     --Username (2)
  30.  
  31. local password1="admin"     --Password (1)
  32.       --Password (2)
  33.  
  34. local commands1="start reactor 1"
  35. local commands2="stop reactor 1"
  36.  
  37. local commands3="start reactor 2"
  38. local commands4="stop reactor 2"
  39.  
  40. local commands5="start reactor 3"
  41. local commands6="stop reactor 3"
  42.  
  43. local commands7="start reactor 4"
  44. local commands8="stop reactor 4"
  45.  
  46. local firstmsg="BNK-SYSTEM AND PROTECTION SECURITY"      --The message that appears when the program is started
  47.  
  48. local success="Success !"
  49. ---- ---- ----
  50.  
  51. while true do
  52.  
  53.     term.clear()
  54.  
  55.     gpu.set(1,1,firstmsg)
  56.  
  57.     term.setCursor(1,2)
  58.  
  59.     gpu.set(1,3,"Please enter the username:")
  60.  
  61.     term.setCursor(27,3)
  62.  
  63.     local username=io.read()
  64.  
  65.     if username==username1 then
  66.  
  67.       gpu.set(1,4,"Please enter the password:")
  68.  
  69.       term.setCursor(27,4)
  70.  
  71.       local password=io.read()
  72.        
  73.       if password==password1 then
  74.       end
  75.  
  76. else if password~=password1 then
  77.  
  78. gpu.set(1,6,"Wrong Username !")
  79.  
  80.       os.sleep(delay2)
  81. end
  82. end
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105. while true do
  106.  
  107.     if username==username2 then
  108.  
  109.     gpu.set(1,4,"Please enter the password:")
  110.    
  111.       term.setCursor(27,4)
  112.  
  113.       local password=io.read()
  114.    
  115.      if password==password1 then
  116.      end
  117.  
  118. else
  119. gpu.set(1,6,"Wrong Username !")
  120.    
  121.     os.sleep(delay2)
  122.  
  123.  
  124. end
  125.  
  126.  
  127.  
  128.  
  129.    
  130. while true do
  131.  
  132.       term.clear()
  133.  
  134.       gpu.set(1,1,"BNK-SYSTEMS REACTOR CONTROL")
  135.  
  136.         gpu.set(1,3,"COMMANDS:")
  137.  
  138.           gpu.set(1,5,"start reactor <number>")
  139.           gpu.set(1,6,"stop reactor <number>")
  140.  
  141.        gpu.set(1,8,"ENTER COMMAND PLEASE:")
  142.  
  143.       term.setCursor(23,8)
  144.  
  145.       local command=io.read()
  146.  
  147.  
  148.      
  149.       if command==commands1 then --reactor 1 on
  150.  
  151.       rs.setOutput(sides.top,15)
  152.        
  153.      
  154.       else if command==commands2 then --reactor 1 off
  155.  
  156.       rs.setOutput(sides.top,0)
  157. end
  158. end
  159. end
  160. end
  161. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement