Posted 17 October 2013 - 11:09 AM
Hey guys! I'm trying to write a basic chat program as a proof of concept to see if I can get remote control turtles up and running
here's what I have so far
I'm getting an error at parallel:22, !chat:23 expecting a number, but going through twice I don't see where a number doesn't show up.
This is coupled with the fact that this is the first time I've ever used functions and parallel I'm feeling a little out of my depth
any help?
here's what I have so far
--!chat
--This is for simple emailing from computers
function recieve()
while true do
event, side, channel, replychannel, message, distance=os.pullEvent("modem_message")
print("Message from Computer ID: "..replychannel.." from "..distance.." blocks away!")
print(message)
end
end
function send()
while true do
print("Public Message=1, Private Message=0")
type=read()
if type=="0" then
print("What ID would you like to send it to?")
ID=read()
else
ID=100
end
print("What would you like to say?")
sent=read()
modem.transmit(ID, os.getComputerID(), sent)
end
end
parallel.waitForAny(recieve,send)
I'm getting an error at parallel:22, !chat:23 expecting a number, but going through twice I don't see where a number doesn't show up.
This is coupled with the fact that this is the first time I've ever used functions and parallel I'm feeling a little out of my depth
any help?