xXMustangXx Posted August 12, 2020 Posted August 12, 2020 what I need is: at mission start a flag "StartFlag" is created and set to 0 said flag to be increased by 1 every 600 seconds 4 times. I don't know the function to increase the flag so I invented that part. this is what I would come up with... StartFlag = USERFLAG:New(" Start Flag ") StartFlag:Set(0) FlagIncrease = SCHEDULER:New( nil, function() StartFlag:increase(1) ---made this up but i need something like this end, {}, 600 , 4 ) Any Help please
HC_Official Posted August 12, 2020 Posted August 12, 2020 read the MOOSE docs https://flightcontrol-master.github.io/MOOSE_DOCS/Documentation/Core.UserFlag.html StartFlag:Set(StartFlag:Get() + 1) is what might work No more pre-orders Click here for tutorials for using Virpil Hardware and Software Click here for Virpil Flight equipment dimensions and pictures. .
Habu_69 Posted August 12, 2020 Posted August 12, 2020 Take another look at the Moose Scheduler documentation. Your Scheduler will not achieve your objective. Where you have 600, 4 the parameters are: Start, Repeat, RandomizeFactor, Stop The number 4 (which is an invalid value) would set the randomization, not number of repetitions. So the Scheduler parameters should be: {}, 0, 600, 1, 2500 -- 2500 sec.should stop the Scheduler after 4 repetitions. You could also write a conditional statement to do Scheduler:Stop() after 4 repetitions.
HC_Official Posted August 12, 2020 Posted August 12, 2020 StartFlag = USERFLAG:New(" Start Flag ") StartFlag:Set(0) FlagIncrease = SCHEDULER:New( nil, function() StartFlag:Set(StartFlag:Get() + 1) end, {},600, 600, nil, 2500 ) No more pre-orders Click here for tutorials for using Virpil Hardware and Software Click here for Virpil Flight equipment dimensions and pictures. .
xXMustangXx Posted August 14, 2020 Author Posted August 14, 2020 Thanks Guys! ill check it out and come back with updates!! Thanks!!
Recommended Posts