The functionality of this post has been summarized in the function GeneralizedChaosGame, available on the Wolfram Function Repository:
https://resources.wolframcloud.com/FunctionRepository/resources/GeneralizedChaosGame
So you can now try this out using simply:
ResourceFunction["GeneralizedChaosGame"][3, 3 10^4]
Enjoy!