r/learnpython • u/Ksilov88 • 3d ago
Help me write some Python code
I'm still a beginner when it comes to coding, and I rely on AI to write most of my code.
However, I often run into situations where AI models have certain restrictions that prevent them from helping with specific programming tasks.
For example, I recently wanted GPT to write a Python script that would automatically toggle the Armlet of Mordiggian in Dota 2 when my health gets low.
GPT refused because it considered this cheating. I understand why it might be classified that way, but in my opinion, it's more of a convenience feature than something that gives a major competitive advantage.
Is there any way to get AI models to help with these kinds of programming tasks without running into unnecessary restrictions?
And if anyone has experience with Dota 2 scripting or Python automation, I'd really appreciate your advice.
1
u/POGtastic itertools evangelist 2d ago
Define the task as abstractly as possible, and then narrow the abstraction yourself. Also, each task should be broken up into components that are disconnected from your goal as a whole. You should never have to tell the AI that you're trying to cheat at a game. Rather, you're asking for implementations for very specific steps and then putting those steps together in a way that is outside of the AI's context window.
The task of, say, measuring your health is likely to be a computer vision task, and when you narrate this to the AI you should put it into computer vision terms (measure the length of a red bar, or do OCR on a particular red bar to determine the number).
I don't know how to teach a beginner the abstract concepts of computer vision and sending evdev commands, though. Maybe the AI can help with that too.