Fun piece of code! Youβre right; having the genie , I would also click it, just like most real players would. Iβm not sure if you already have all the necessary widgets, but if not, let me know, and I can post them here if you respond to this post.
However, the code doesnβt consider who the genie is targeting. Youβll end up in an endless loop, trying to interact with the genie until it dissolves into thin air when the timer runs out.
Add some code to check if the genie is interacting with the player. You could maybe check the text, extract the name from the genieβs message, and see if it matches the current player. Iβll take a look at my code to see how I handled it.
Great snippet, keep it up!