- Sky
- Blueberry
- Slate
- Blackcurrant
- Watermelon
- Strawberry
- Orange
- Banana
- Apple
- Emerald
- Chocolate
- Charcoal
parmort
-
Content Count
2 -
Joined
-
Last visited
Posts posted by parmort
-
-
Hi.
I wrote a program that harvests sugarcane on demand (via modems). I have a main run loop, but the harvesting code runs twice per message received.
local event = require "event" local running = true -- ... while running do local _, _, _, port, _, message = event.pull("modem_message") doHarvestRoutine() -- The bit that runs twice per event pull print("Message: "..port.." "..tostring(message)) end
Any ideas why this is happening?
Function runs twice
in Programming
Posted
So it turned out being a bug in the sender. I ended up rewriting the program to add more functionality, and it disappeared.
Thanks for taking the time to look at this!