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

Help me plz

Started by vivanewvegas, 18 October 2012 - 12:35 PM
vivanewvegas #1
Posted 18 October 2012 - 02:35 PM
I'm making a program which should send a message to another computer over rednet, using rednet.send.
Here's my code

Can anyone tell me why it keeps saying "rednet 347: positive number expected" and how i can fix this? Thanks :P/>/>
jag #2
Posted 18 October 2012 - 02:39 PM
Where you got
print("Receiver ID:")
rid = read()
You are taking a string for input, try this instead:
print("Receiver ID:")
rid = tonumber(read())
This will make sure that the input is a number (basically).
Because rednet.send() needs the first syntax to be a number.
Doyle3694 #3
Posted 18 October 2012 - 02:40 PM
change
rid = read()

to

rid = tonumber(read())

EDIT: Ninja'd :P/>/> Var iaf en svensk jag blev ninja'd av xD
vivanewvegas #4
Posted 18 October 2012 - 02:43 PM
Thanks guys :P/>/>