Posted 17 October 2013 - 10:01 PM
Hey, I'm pretty new to ComputerCraft so this question will probably be quickly answered.
I essentially want a computer to run the contents of every rednet message it receives as a program. I can't figure out exactly how to do that.
This is what I came up with off the top of my head, but of course it will just try to run the program "text". How do I use the content of the message as the arguent in this program? I'd like to avoid the multitude of elseifs I'd have to use otherwise.
I essentially want a computer to run the contents of every rednet message it receives as a program. I can't figure out exactly how to do that.
rednet.open("back")
while true do
event, id, text = os.pullEvent()
if event == "rednet_message" then
shell.run("text")
end
end
This is what I came up with off the top of my head, but of course it will just try to run the program "text". How do I use the content of the message as the arguent in this program? I'd like to avoid the multitude of elseifs I'd have to use otherwise.