Little_Fan,
Thanks for the feedback.
When the script starts it will immediately do the quest until it sees an ending message, then it will wait for a fresh new round to start. At that point, the roundCount variable will = 1.
Once that fresh new round starts it will do the quests and when it sees the end of event message, it will see that there is plenty of time left and that roundCount is less than 3 and will then increase roundCount by 1, change channels, then do the quest on the next round.
On that next round, roundCount = 2. At the end, if there is still enough time left it will change channels again, and increase roundCount by 1.
At this point RoundCount = 3. Once it gets the end of event message this time, even if there is time left, it shouldn't change channels again. Here's that part of the code:
Code: Select all
if nextRound > 5 and 3 >= roundCount then -- if more than 5 minutes remaining in round, change channel:
cprintf(cli.yellow,"\r%0.1f minutes until next round starts... Changing channel.", nextRound)
roundCount = roundCount + 1
changeChannel()
firstRun = false
timerIncorrect = false
changedChannels = true
break
elseif 1 > nextRound then
roundCount = 1
changedChannels = false
cprintf(cli.yellow,"\rTime till next round start: %0.1f seconds.",nextRound/60)
else
roundCount = 1
changedChannels = false
cprintf(cli.yellow,"\rTime till next round start: %0.1f minutes.",nextRound)
end
On that first line, because at this point roundCount is equal to 3 it will then go to the else statements. One of them will display seconds while the other will display minutes depending on how much time is left in the round. It shouldn't change channels after the 3rd channel has been hit during a single 20 minute event time. Instead it should wait for a fresh new event to start, and it should reset the roundCount back to 1.
Oh crap... I just saw my mistake in my logic. it resets roundCount back to 1 during that repeat function... Ok, I'll do a quick update and post it here for testing.
Update: New file posted here. I can't test it now but if someone can test it and let me know the results, if it's good I'll update the first post with this revision. Thanks.