Guest User

Computercraft attempt to index ? (a number value)

a guest
Mar 30th, 2013
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.77 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2.  
  3. rednet.open("left")
  4. local serverId = 14
  5. local done = false
  6. local myId = os.computerID()
  7.  
  8. while done == false do
  9.  
  10.   term.clear()
  11.   term.setCursorPos(1,1)
  12.   write("Password:")
  13.   local password = read()
  14.   term.clear()
  15.   term.setCursorPos(1,1)
  16.  
  17.   if password == "ADMIN" then
  18.     done = true
  19.   else
  20.     rednet.send(serverId.password)
  21.     senderId.message.distance = rednet.receive(5)
  22.     if senderId == serverId then
  23.       if message == "Valid" then
  24.         print("Access Granted")
  25.         redstone.setOutput("top",true)
  26.         sleep(3)
  27.         redstone.setOutput("top",false)
  28.       else
  29.         print("Access Denied")
  30.         sleep(1)
  31.         print("Goodbye")
  32.         redstone.setOutput("back",false)
  33.         sleep(3)
  34.         redstone.setOutput("back",true)
  35.             end
  36.     end
  37.   end
  38. end
Advertisement
Add Comment
Please, Sign In to add comment