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

Mail system

Started by HurdeHack, 22 March 2012 - 01:31 PM
HurdeHack #1
Posted 22 March 2012 - 02:31 PM
im busy with a code for a mail system and these lines are for sending and i think its not good

rednet.open("left")
send = write("to: ")
message = write("message:")
write("to: ")
write("message: ")
rednet.send(send,message)

any help?
Liraal #2
Posted 22 March 2012 - 02:43 PM

rednet.open("left")
write("to: ")
send = tonumber(read("to: "))
write("message: ")
message = read("message:")
rednet.send(send,message)
Advert #3
Posted 22 March 2012 - 02:44 PM
I'm not sure what you're trying to do with write, but I think this will do something close to what you're trying:


write("To: ")
local target = tonumber(read())
write("nMessage: ")
local message = read()
rednet.send(target, message)
HurdeHack #4
Posted 22 March 2012 - 02:59 PM
it works now i understand the code!
hamish1001 #5
Posted 23 March 2012 - 07:29 AM
I'm not sure what you're trying to do with write, but I think this will do something close to what you're trying:


write("To: ")
local target = tonumber(read())
write("\nMessage: ")
local message = read()
rednet.send(target, message)


with your code i can send messages to other computers with my server?