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! ๐๐ป