Posted 05 June 2017 - 11:50 PM
im trying to send a packet via rednet , but i want the computer to ask me which ID i want to send before sending to this ID
so i created a read variable
variable = read()
rednet.send(variable, "message")
but i get an error saying : " rednet:87 expected number"
rednet.open("top")
print("Choose ID Range To Scan: ")
range = read()
term.clear()
term.setCursorPos(1,1)
for i = 0,range do
rednet.send(i, "check")
id, message = rednet.receive(1)
if message == "ready" then
term.setTextColor(colors.green)
print(" ID:".. id.. " Active")
term.setTextColor(colors.white)
else
term.setTextColor(colors.red)
print(" ID:"..i.."Nothing Found")
term.setTextColor(colors.white)
end
end
print("================")
write("Choose Session ID:")
sid = read()
write("Attempting Private Connection with "..sid)
write(".")
sleep(0.5)
write(".")
sleep(0.5)
write(".")
rednet.send(sid, "go") – HERE I GET THE ERROR
so i created a read variable
variable = read()
rednet.send(variable, "message")
but i get an error saying : " rednet:87 expected number"
rednet.open("top")
print("Choose ID Range To Scan: ")
range = read()
term.clear()
term.setCursorPos(1,1)
for i = 0,range do
rednet.send(i, "check")
id, message = rednet.receive(1)
if message == "ready" then
term.setTextColor(colors.green)
print(" ID:".. id.. " Active")
term.setTextColor(colors.white)
else
term.setTextColor(colors.red)
print(" ID:"..i.."Nothing Found")
term.setTextColor(colors.white)
end
end
print("================")
write("Choose Session ID:")
sid = read()
write("Attempting Private Connection with "..sid)
write(".")
sleep(0.5)
write(".")
sleep(0.5)
write(".")
rednet.send(sid, "go") – HERE I GET THE ERROR