Posted 01 January 2013 - 03:29 PM
Hi,
I started using ComputerCraft a couple of days ago, and today, I decided to setup some turtles to write a new year message, in lights, to the world. Although I have a lot of programming experience, I know virtually nothing about Lua, and as time was limited to get the message up on my server before people joined, I've kept things very simple. It all works fine but it brings up a question for me: how efficient is rednet.receive() when compared with subscribing to rednet_message?
Essentially, I'm doing this:
With 100 turtles, it has a noticeable effect on performance, and rather than changing all 100 turtles to find out if subscribing to rednet_message would be better, I was hoping someone would be able to tell me first.
Anyway, here's what it looks like for anyone that's interested and I hope you all have a happy 2013. :)/>
I started using ComputerCraft a couple of days ago, and today, I decided to setup some turtles to write a new year message, in lights, to the world. Although I have a lot of programming experience, I know virtually nothing about Lua, and as time was limited to get the message up on my server before people joined, I've kept things very simple. It all works fine but it brings up a question for me: how efficient is rednet.receive() when compared with subscribing to rednet_message?
Essentially, I'm doing this:
function listen()
rednet.open("right")
while true do
id, message = rednet.receive()
parse(message)
end
end
With 100 turtles, it has a noticeable effect on performance, and rather than changing all 100 turtles to find out if subscribing to rednet_message would be better, I was hoping someone would be able to tell me first.
Anyway, here's what it looks like for anyone that's interested and I hope you all have a happy 2013. :)/>