MerlinofMines / EasyCommands

Github Repository for Ingame Scripts built by MerlinofMines. Uses MDK to Deploy to SpaceEngineerse
GNU General Public License v3.0
8 stars 3 forks source link

Active Messages in Listening Queue Causes Script to halt when re-parsed #167

Closed MerlinofMines closed 2 years ago

MerlinofMines commented 2 years ago

There's a but with the program execution wherein the program is not instantiated if on the first execution of the script there is an active message to process. The script only processes the active message and then doesn't proceed to run the program.

Example script:

#Listener
async call comms

:comms
listen "ReferenceCoords"
wait until false
repeat

#Sender

:TransmitReference
set Command to "set global reference to " + ("Remote Control" position) + " as vector"
print Command
send Command to "ReferenceCoords"
repeat

I believe the fix here is to wipe all channels that were previously being listened to whenever we reset the program state.

This means the script will ignore any previous messages sent when you re-compile, which is appropriate. It would fix other bugs too such as changing the channel you are listening to, which currently wouldn't cause you to stop listening on the old channel I believe.

MerlinofMines commented 2 years ago

Alright will take a look at this one... bugs before features haha