4 ms·
automating the game I'm playing right now with plain old input simulation + image recognition. This is how I started my career in the first place as a software
by Prunkton 4y ago
automating the game I'm playing right now with plain old input simulation + image recognition.
This is how I started my career in the first place as a software engineer and this is how I continue learning new languages w/o the feeling to artificially build something useless
I usually start like that:
- add a mouse/keyboard emulator library, on the way you usually find out how good native system integrations are and how to integrate dependencies into your project
- write a brutally easy script of some mouse clicks/movements or similar to have something in place you can build on
- generalize the script
- make use of basic code features like functions, code logic, abstractions
- maybe add some math for screen resolution independent mouse movements ore more natural movements or typing events
- have some basic idea of concurrency by waiting a random time before input events
- how about adding openCV or a similar screen capture tool? now you can capture a single color indicating a specific event to make things more interactive
- get more creative in what you want to detect
- figure out what are the limitations of the language of your choice, how many fps can you archive and what are the bottlenecks?
- when you are at this point you opened the door to an endless journey of adding more and more features and optimizing your code
the first steps are often just c&p from stackoverflow + some basic lookup from the documentation. with this approach you have a working prototype rather quickly and you are in full control on how fast and in what direction you want to go
by the time everything feels repetitive in what you are doing you probably already have a basic idea of the language and can decide on how or if to continue.
needles to say, don't spoil yours and others fun by applying this approach to PVP oriented games. also you will probably have a hard time since there are way more efficient ways + anti cheat tool will detect you