I wrote a script to calculate the quantity withdrawn from the client and that is different in a minute script to withdraw the name of the client and the division of the speed limit on them evenly in the queue Simple
What is wrong with the code I hope illustration
First of all, your first for loop ends right there. It runs through each active item in the hotspot, and just keeps reassigning the global variable until it gets to the last entry.
I’m not really clear on what you are trying to do, but you will need to, at the very least, extend out the first for loop to a greater scope.
But the downside to the script that you have written is that it will take more than a minute for each entry in the hotspot to run and loop through everything, and it can only work on one entry at a time. I’m not sure there is a good way to script what you want to do. You might be able to use the new “function” feature in 6.2 or greater and pass the current byte1 to that function and have the delay, calculation, and adjustment in that script. I’m just not sure if there is a limit on how many times a script/function can be called in a row.
Further to this, PCQ was created for performing this same function automatically (dividing available bandwidth between online users in an address pool etc), have a read of the following and watch the video presentation if you want to learn more: