event = require("event")
require("component").modem.open(1)
function receive ()
while true do
local eventData = { event.pull() }
if eventData[1] == "modem_message" then
local message = eventData[6]
local port = eventData[4]
local adress = eventData[3]
return message, port, adress
end end end
while true do
local m, p, a = receive()
print(p)
end
And here is sender program:
m = require("component").modem
print("Type address")
adr = io.read()
print("Type message")
msg = io.read()
if m.send(adr, 1, msg) == true then
print("Message sended succesfully")
else
print("Error occured")
computer.beep(500)
os.sleep(0.5)
computer.beep(500)
end
And the problem: receiver receives only broadcast messages.
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Here is receiver program:
And here is sender program:
And the problem: receiver receives only broadcast messages.
I use wireless card on tablet and on PC
Link to post
Share on other sites