Posted 27 February 2012 - 06:06 AM
I just encountered a curious little bug in this script I made for a custom map.
Without going into unneeded detail, there's a patrolling turtle out in a hallway and if it's patrol is interrupted it uses the rednet.broadcast method to communicate with a terminal controlling a door. All of this works perfectly fine, the doors lock appropriately when the turtle is interrupted, the timer's set, not the slightest glitch to be found…
Until I exited the map and reloaded. The turtle starts up fine and starts patrolling, and when I check the terminal, it too has run it's startup function without presenting any errors. But when the turtle's route is interrupted, the terminal failed to lock the doors. rednet.broadcast returns true, and simply by restarting the terminal, everything works like a charm.
I thought that maybe it was a problem with trying to open the wireless router at map start, but no matter what I did, putting it in another program and running it with shell or creating and loading an API that had only one function, rednet.open, delaying it, using rednet.close and then open, or a combination of any/all of those, nothing seemed to work. I still have to assume it's something I'm doing wrong and I'm still working on it (I'll post any/all code upon request) but I've gotten to the point where I have to ask if anyone else has run into a similar predicament, and if so, did you find a way around it?
Without going into unneeded detail, there's a patrolling turtle out in a hallway and if it's patrol is interrupted it uses the rednet.broadcast method to communicate with a terminal controlling a door. All of this works perfectly fine, the doors lock appropriately when the turtle is interrupted, the timer's set, not the slightest glitch to be found…
Until I exited the map and reloaded. The turtle starts up fine and starts patrolling, and when I check the terminal, it too has run it's startup function without presenting any errors. But when the turtle's route is interrupted, the terminal failed to lock the doors. rednet.broadcast returns true, and simply by restarting the terminal, everything works like a charm.
I thought that maybe it was a problem with trying to open the wireless router at map start, but no matter what I did, putting it in another program and running it with shell or creating and loading an API that had only one function, rednet.open, delaying it, using rednet.close and then open, or a combination of any/all of those, nothing seemed to work. I still have to assume it's something I'm doing wrong and I'm still working on it (I'll post any/all code upon request) but I've gotten to the point where I have to ask if anyone else has run into a similar predicament, and if so, did you find a way around it?