This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Tron's profile picture

Rednet Not Sending Password

Started by Tron, 25 February 2012 - 10:02 PM
Tron #1
Posted 25 February 2012 - 11:02 PM
I am making a password program that uses rednet to connect to a main computer for the password
But it doesnt seem to be getting the password, the main computer is sending(confirmed because it is sending the var to the computer)But not the password
doneyet = 0
sender = "55"
local status, input
print("Recieving Data Via Rednet...Please wait")
while doneyet == 0 do
rednet.open("right")
action, senderID, var = os.pullEvent()
if var == var then
  sleep(0.1)
  action, senderID, cpass = os.pullEvent()
  rednet.open("right")
  doneyet = 1
  end
end
print("Data received")
sleep(0.1)
print("Enter Password")
status, epass = pcall(read)
if epass == cpass then
print("Correct")
end
if not epass == cpass then
print("Incorrect Now Shutting Down")
sleep(1.5)
os.shutdown()
end
Computer sending passwords code:
password ="testpass7"
var = var
x = 1
while x == 1 do
rednet.open("right")
rednet.announce(var)
sleep(0.1)
rednet.announce(password)
end
Edit: Changed line 1 of Computer sending, still doesnt work though D:
Edited on 25 February 2012 - 10:52 PM
Liraal #2
Posted 25 February 2012 - 11:23 PM
the password's not a string. try 'password="testpass7" '
Advert #3
Posted 25 February 2012 - 11:25 PM
Use code tags instead of quotes, they will syntax highlight your code.

You need to put your password in quotes, though this is only what I saw from a quick glance.