I really liked your script and I even tested it and rolled a few dices my self, but as I'm not a code expert I can't know if there is any back door in it or not.
Besides if you really rely on luck and randomness of the results you will definitely go bankrupt within 10 days or less.
I have tried and used a very complicated strategy to win at the end but that was on a real provably fair dice and no funds were involved while using the same strategy over 50 times I was a winner all 50 times and testing it on a real online casino I lost the first time.
Can you guarantee me that the results will be in my favor and the house will always win overall or no?