Badge: Go With The Flow
Why do any work at all when Power Automate can work for you?
Our *bleerp bloorp* processes have <insert 56kbps modem sounds> been automated.
For resource hungry miner peasants out there Power Automate will every 15 minute randomly spawn a chunk of resources at a random location.
IF, of course there is always an if, the location already have a chunk assigned, it won’t be assigned a new one.
When peasant miners gather resources Power Automate will automatically mark that chunk of resources as claimed and make sure the spawn location is available for new spawn chunk and command our copilot slave to make a happy/cool/hip live commentary on the claim!

Look at that naming convention! Is it not beautiful?!
SO! How do they work you ask?

It all starts with our scheduled Spawn Generator-flow. Every 15 minutes it runs, lists all available spawn locations. For each available spawn it runs a child flow, namely our “Manual – Chunk generator”-flow.

Every Resource type has a spawn rate. It goes from 1-100, consider it a percentage chance for the resource type to spawn.
To generate a chunk of resources randomly, yet according to the spawn chance we need the following:
We make to variables. An array called varWeighted a variable called currentTotal. Then we list all resource types.
For each resource type we increment the Spawn Rate with the item spawn rate value. Then we add that row to the array saving it with the currentTotal.
Following that we take the total spawn rate, compose a random number between 1-<Total Spawn rate nr>, then we filter out every row in the array which has currentTotal higher then the random number.
We then take the first row and use that as our winning resource.
We create a Spawn Chunk-row in dataverse, update our spawn location to not be available, and thats it!
Does this actually work? Is it spawning based on spawn rate? Hard to say, i’m not a math guy, but perplexity told me this would work.
Finally, our last flow. When a spawn chunk is claimed.

When a row (spawn chunk) is modified (a miner, contact, is added to the row), a flow sets the row to status reason claimed, sets the spawn location to available, and executes the agent based on a condition (this one is work in progress, sorry).
Very much definietly wroten by a human person