It feels weird but I found it better understood what I wanted when I stopped using what you could consider like search engine syntax, and just “spoke” to it like it was a human I was giving a task to. It gives up easy do sometimes it needs prodding as well. For instance you might ask something like write me a macro for game x or a lua script that does y - often I get back stuff like “sorry I can’t access game x’s files” when really what you want it to do doesn’t require that kind of access. When it does that ask it to define the variables in your ask.
Example:
Me - Write me a macro that gets full use of my healing potions crit chance without any overlap or wasted resources
GPT - I don’t have access to that kind of stuff
Me - Define Healing Potion in game LeakedBB 6
GPT - a healing potion in that game does blah blah amount of healing
Me - How much life does a lvl 69 character in Leakedbb 6 have?
GPT - a lvl 69 character has blah blah health
Me - Now, write me a blah blah and hit it with your original question and it usually nails it after some hand holding
I just used games as an example but the above method works for anything
Hope that helps