Advertisement
LBPHacker

Sender #1 - Gate controller for Jman

Jul 31st, 2013
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.71 KB | None | 0 0
  1. -- * configuration
  2. rednet.open("MODEM_SIDE_HERE")
  3. local receiverID = 0
  4.  
  5. local password = ""
  6. local waitForClose = false
  7. while true do
  8.     local eventData = {os.pullEvent()}
  9.     if eventData[1] == "rednet_message" and eventData[2] == receiverID then
  10.         waitForClose = (eventData[3] == "closeinterface")
  11.     elseif eventData[1] == "key" and eventData[2] == 28 then
  12.         if waitForClose then
  13.             rednet.send(receiverID, "close")
  14.         else
  15.             rednet.send(receiverID, password)
  16.             password = ""
  17.         end
  18.     end
  19.     if not waitForClose then
  20.         if eventData[1] == "char" then
  21.             password = password .. eventData[2]
  22.         elseif eventData[1] == "key" and eventData[2] == 14 then
  23.             password = string.sub(password, 1, #password - 1)
  24.         end
  25.     end
  26. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement