In this tutorial series, I’ll show you how to use PyAutoGUI to write a video game bot in Python. This is a great beginner AI project to strengthen your programming skills, or to take your first steps into video game automation. We’ll be playing Earth & Beyond, a space MMO, and in it we’re going to automate a trade route to earn credits.
In this introductory video, I explain what we’re going to build and how to install Earth & Beyond.
Full playlist:
GitHub repo for this project:
Download Earth & Beyond:
Donate to help keep the Earth & Beyond emulator alive:
Additional PyAutoGUI tutorial at Automate the Boring Stuff with Python:
Checkout for more programming project ideas.
GUI automation is a botting technique where you control the mouse and keyboard using code, and you use the pixels on the screen to get information about the state of the game. We aren’t bypassing the normal game inputs, and we aren’t accessing any hidden information. With GUI automation, we’re trying to emulate a human sitting at a computer.
Before doing this tutorial, you’ll want to have a basic understanding of Python. If you’re new to programming or Python, you should do an introductory Python tutorial first. But once you get through that, this is a great beginner programming project to help you get more experience writing Python.
We’re going to be using the PyAutoGUI library. This is a great library to learn, even for things other than botting, as it can be used for automated testing, working with spreadsheets, or automating any other tedious, repetitive task.
In this tutorial we’ll be botting Earth & Beyond, a space MMO. It’s a good game for this project because it has a lot of repetitive gameplay, and it has keybindings that will making botting this game a little easier. Earth & Beyond also has many static items in its interface, and this will make it easier when we start to do image recognition.
Installing Earth & Beyond can be tricky, so here’s how to do it: Go to click on the FAQ link in the main menu, click on the “Game play and Issues” tab, and finally expand “How do I get into the game !!”. Follow the steps listed there exactly.
I had a few problems come up during installation, and here’s how I fixed them.
On step 11, running the Earth & Beyond configuration, it would open and then close immediately, even when running as administrator. If this happens to you, go to the “EBCONFIG” folder, right click on “E&BConfig.exe”, select “troubleshoot compatibility”, and it should suggest you use “Windows XP mode” for this file, so choose that.
When you run your configuration, select “Windowed Mode” and choose a resolution smaller than your full monitor resolution so you can easily switch between the game and your code when developing. It’s also required that you run the Performance Test whenever you change your configuration.
On step 14, clicking the play button on the launcher, when I initially did this I got an error that said “server failed to respond to login attempt” and then the launcher would close. To fix this, in the launcher under the debug section, I changed the “Local IP” selection to the second item in the list.
Hopefully you’re able to get the game installed successfully now.
Once you have it running, inside the game under “Options”, then “Control”, select the “Default FPS” keybindings if you want to follow along with me exactly. These keybindings allow us to use WASD control for movement.
At this point, it would be a good idea to play the game normally for a little bit to get familiarized with how the game works. Since it is an old game, expect to find some bugs, and be aware that the questing system doesn’t always explain itself very well when you’re going through the missions.
Hopefully you’re excited to start building your first video game bot. We’ll get started with the code in the next tutorial.
Read the expanded written tutorial here:
Nguồn: https://infernalaffairsguild.com/
Xem thêm bài viết khác: https://infernalaffairsguild.com/game/
Thanks 👍
Such an underrated channel, glad I found it!
How do i pull android game data from android emulator? I want to automate android game. For that I need various information like health, inventory list, how much space left in inventory etc… I tried pyaotigui locate on screen function but it's not reliable… I want to pull accurate game data and process that data and perform task according to that data… How do i do that?
Can you do agar.io bot tutorial
crack bro
I've found your channel 3 days ago and I've been watching your videos I find them really insightful! Thank you!
Well shit. Now i know why i got banned on fortnite 😂
I've asked this question on stackoverflow but no one could answer to that….
Hi just quick question is there any library in python similar to pyautogui where I can create a program which will initialize given window and execute commands(i.e click, hotkeys etc.) only in this particular window?
For example I want to create a simple program that will click for me and use hotkeys in game, but at the same time I want to use computer without stopping the program. As far I'm concerned using pyautogui I can create programs like that but I cant click, or change windows while program is running because it will crash program.
[Everyone Liked That]
Hey i wanted to know how this modules are made..i just can't imagine how it is made.. how they operate hardware and software together 🤔 and made a such a useful modules for us..i have been trying to understand for a week but i can't figure it out so any recommendations 🙏
Thank you for the tutorials!
your content is just awsome, i am doing this as my project!!…..Thanks for this tutorial
I'm convinced this is just an elaborate ploy to get people to play earth and beyond
Woah thx
Is there a guide for like if it detects a certain image on a screen it presses a certain key?
How to make a pubg or Csgo bot?? And how to train my it
Tip : don't go into a romantic relationship with it
I'm so glad that i found these series, So excited to learn pyautogui and put them to good use.
Stay safe, wash your hands. I will be following through and joining on your journeys on the channel from here on. Thank you. 😊
Damn, Your eye looks pretty cool.
Are they different colors too?
you are the best!
Can you do a match 3 bot tutorial?
your content is 10/10 im getting better because of you!
Love it man, you are doing a great job
Can you teach us how to make a bot for another MMORPG browser game? Also I love your vids
Really nice!
Thank you for the tutorials, they are very well made. I will subscribe and hope that you make more tutorials.
in my opinion this video is so underrated
Thank you for uploading this video i am learning a lot from you.