It'd really help if you could paste what you got, even if it doesn't work.
Here are some pointers:
1) You need to use
rednet.open("side"), where
side is the side you placed the modem on your computer, before you can send stuff through it.
2) Here's a simple client-server program:
server:
rednet.open("top") -- assuming that the modem is on the top
repeat
print("'q' to quit.")
local event, p1, p2 = os.pullEvent()
if event == "rednet_message" then
print("Message from ", p1, ": ", p2)
rednet.send(p1, "Message Recieved.")
end
until event == "char" and p1 == "q" -- Exit the loop if "q" is pressed with the computer open
client:
rednet.open("top")
repeat
print("'m' to send a message; 'q' to quit.")
local event, p1, p2 = os.pullEvent()
if event == "rednet_message" then
print("Message from ", p1, ": ", p2)
elseif event == "char" and p1 == "m" then
print("Input target & Message:")
rednet.send(tonumber(read()), read()) -- This will take input twice: first, for the ID, and a second time, for the message itself.
end
until event == "char" and p1 == "q"
You can expand upon this, if you wish.