Use os.pullEvent instead of rednet.receive
Why would you expect that to make a difference?
C'mon, dude. You're a fairly competent programmer, so I'm more than a bit curious as to what your train of thought was there.
Throwing out "guesses" as if they were "solutions" isn't helpful, if that's what you were thinking.
Like Creator said,just use os.pullEvent like this:
os.pullEvent() returns event types before the rest of the data. That's also not even remotely how you would make use of protocol strings.
@LeviM:
The problem is pixelcrypt's use of math.randomseed().
When a ComputerCraft computer boots, it picks a random seed to generate math.random() results with (presumably based on what the system clock is set to at the time the computer starts, as that's the most common source, but it could be based on something else - point is it's not immediately easy to guess, and is therefore
unpredictable).
Values returned by math.random() will always follow an entirely predictable pattern so long as the seed is known. If you set the seed to 1 and generate ten "random" numbers, then set the seed to 1 again and generate another ten "random" numbers… then you'll get exactly the same results.
You, however, are setting it to something entirely predictable, within your checksum function. This has system-wide effects.
For one thing, it means that the unique identifiers attached to rednet messages your client sends - which are supposed to be random, in order to prevent messages from getting the same ones (or at least, make it
really unlikely that they get the same ones) - become entirely predictable, to the point where your script will use the same UUID for the message it sends
every time.
And if your server gets two messages with the same UUID within half a minute, then it assumes the extra copies were transmitted by the
repeat script, and since it already got one with that UUID recently that means it
ignores it.
In short, if you feel pixelcrypt.checksum() MUST use math.randomseed() with a non-random argument (and I don't see any obvious reason why it should), then at least feed it a somewhat random value (such as os.clock()) once you're done with it so that it's not so predictable afterwards!