Originally Posted by
Boreas
Request for when 24 hours reports become common again: army (including army of 1) break handling system
1) Army file with a time card for each player.
2) LogInEx LogOutEx that updates in and out in file for player.
3) Global var for total time you expect to run all scripts out of 24 hrs
4) Var for the max time each player can be logged in per 24 hrs
5) Var for the max time each player can be logged without break (with another var for +/-)
6) Var for time you expect to run current script out of 24 hours
7) Function that is called after every bank/whatever which looks at those variables, and decides whether to stay loggedin, or switch user (switch again if next player also has had too much time), or just wait if all players have had too much time.
For example, someone has a machine they intend to run scripts on 24 out of 24 hours. They are only running one script, for 24 out of 24 hours. They have 7 players, that should play for a max of 4 hours a day each, of stretches of 15 mins max. So that means 3 hours and 25 mins each (including switch time), per 24 hours. 6 hours into the 24 hours, each player will have done about 3hr25min/4 = 51 mins (made up of pieces <15mins). Let's say 4 players go false all at once (not likely, but it's to just make these example numbers easy). There are 18 hours left for 3 players, meaning 6 hours each, so they would finish the day with 6hr51m each (assuming no resets). However the breakhandler/switcher will stop this, by saying each of the 3 remaining players have 3hr9min left (13 stretches of <15mins), which is 9hrs27 min out of 18 hrs, so it needs to wait 8hr33mins. There will be 13*3 more logins, so between each login, wait 8hr33min/39 = 13.5 mins. This sounds like a lot of calculations, but it takes a few ms and is done after every load. Then if some/all of the 4 players are reset back to true at the 17 hour mark for example, the function re-evaluates and finds that it doesn't need to wait between logins. If max player time per day is longer, or if intended script runtime is shorter, there will be less waiting. Less players means more waiting, works with 1 player also. Also if it could give more time to the players that were reset to even them out that would be awesome, but not terribly important as chances are over time each players bench time will average out.