Advertisement
MrUndead

Mag

Feb 10th, 2022 (edited)
947
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.02 KB | None | 0 0
  1. local component = require("component")
  2. local term = require("term")
  3. local event = require("event")
  4. local Data = component.data
  5. local m = component.modem
  6.  
  7. local PortO = 123
  8. local ServerA = "158e29fe-4f83-42b5-8837-1bddad8fadc4"
  9.  
  10. m.open(PortO)
  11.  
  12. local function myFunction(eventName, address, playerName, cardData, cardUniqueId, isCardLocked, side)
  13.  
  14.     m.send(ServerA,PortO,"ClientCheck")
  15.  
  16.     term.clear()
  17.     io.write("Type your Password: ", "\n")
  18.    
  19.     local Pass = io.read()
  20.  
  21.     os.sleep(1)
  22.     m.send(ServerA,PortO,cardData)
  23.     os.sleep(2)
  24.     m.send(ServerA,PortO,Pass)
  25.     os.sleep(1)
  26.  
  27.     term.clear()
  28.  
  29.     local _, _, from, port, _, Check = event.pull("modem_message")
  30.    
  31.     if Check == "True" then
  32.         io.write("Here goes some code")
  33.  
  34.     elseif Check == "False" then
  35.         io.write("Incorrect Password!")
  36.         event.ignore("magData", myFunction)
  37.         term.clear()
  38.         os.execute("Mag")
  39.     end
  40.  
  41.  
  42. end
  43.  
  44. io.write("Scan Your Card")
  45.  
  46. event.listen("magData", myFunction)
  47.  
  48.  
  49.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement