I am new to using rednet.
How would I make it show the rednet message only (not the computer ID aswell)
Also how would I make it receive it all the time and update automatically?
This will help me alot
Rednet Help
Started by koslas, Sep 01 2012 06:42 AM
4 replies to this topic
#1
Posted 01 September 2012 - 06:42 AM
#2
Posted 01 September 2012 - 06:45 AM
rednet will always send the ID, MSG, and distance there's no way to get around that without making your own program or modifying the original.
What are you trying to do with it? You can capture the output and only use the msg variable from it and not do anything with the id var.
What exactly are you wanting to update? More info is always better then less...
Example:
What are you trying to do with it? You can capture the output and only use the msg variable from it and not do anything with the id var.
What exactly are you wanting to update? More info is always better then less...
Example:
while true do local id, msg = rednet.receive() print(msg) end
#3
Posted 01 September 2012 - 06:51 AM
I am currently playing on a server with Factions plugin, and this is for a ally application
I am currently using
while true do
rednet.receive()
sleep(0)
end
This doesn't seem to be working though.
Any idea why not?
I am also using on the application computer
factionName = read()
--and also
reason = read()
--then
rednet.send(105, factionName)
rednet.send(105, reason)
-- 105 is receiving computers ID
But it's not sending anything
I am currently using
while true do
rednet.receive()
sleep(0)
end
This doesn't seem to be working though.
Any idea why not?
I am also using on the application computer
factionName = read()
--and also
reason = read()
--then
rednet.send(105, factionName)
rednet.send(105, reason)
-- 105 is receiving computers ID
But it's not sending anything
#4
Posted 01 September 2012 - 06:55 AM
The sending portion should work. You're receiving code is not capturing the data received by rednet.receive(). You will want to capture it with vars like I did the in the small example I posted above.
You can print the vars, check them in an if statement etc...
You can also name the vars anything you like.
local id, msg = rednet.receive() -- the computer id send will be captured in the var id, and the message in the var msg.
You can print the vars, check them in an if statement etc...
You can also name the vars anything you like.
local ignore, message = rednet.receive() -- or whatever you choose, use what makes the most sense to you.
#5
Posted 01 September 2012 - 07:32 AM
Thank you for you help. This is now completed
I really liked it how you replied so quickly
I really liked it how you replied so quickly
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users











