Posted 30 June 2017 - 11:20 AM
--Sender Program by Weapon
rednet.open("back")
while true do
local id, msg = rednet.receive()
if (id == 1) then
local msgs = msg
--Says what message it is
elseif (id == 3) then
local ids = tonumber(msg)
--Gives Info About the ID receiver
end
rednet.send(ids, msgs)
print("Sent 1 message to "..ids)
end
The problem is tonumber() Wich doesnt work in the way I wanted. Please note that I am on CC 1.5 (Tekkit)[rednet : 39 : Expected Number]
Please help!
P.S Code for Client Is :
--Mail Client by Weapon
rednet.open("back")
print("Enter Message:")
local msg = io.read()
print("Enter ID:")
local id = tonumber(io.read())
textutils.slowPrint("Sending . . .")
if rednet.send(1, msg) and rednet.send(3, id) then
print("Message Sent!")
else
print("Can't send Message! Try again Later.")
end
Code For MSG Router is (ID 1) :
--MSGSender by Weapon
rednet.open("back")
local msg = false
while true do
local id , msg = rednet.receive()
if msg then
rednet.send(2, msg)
print("Routed 1 message from "..id)
end
end
Code for ID sender (ID 3) is :
-- IDSender by Weapon
rednet.open("back")
local msg = false
while true do
local id, msg = rednet.receive()
if msg then
rednet.send(2, msg)
print("Routed 1 message from "..id)
end
end
Thanks for help!