PyAutoGUI Video Game Bot Tutorial 1/4: Get Started with a Great Beginner AI Project!



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/


Article Categories:
Game

Comments

  • Thanks 👍

    Jhon Smith July 7, 2020 3:14 pm Reply
  • Such an underrated channel, glad I found it!

    Kameron Hartman July 7, 2020 3:14 pm Reply
  • 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?

    Muhammad Rokonuzzaman July 7, 2020 3:14 pm Reply
  • Can you do agar.io bot tutorial

    Anmol Pandey July 7, 2020 3:14 pm Reply
  • crack bro

    Carlos Osuna July 7, 2020 3:14 pm Reply
  • I've found your channel 3 days ago and I've been watching your videos I find them really insightful! Thank you!

    Muhammad Khalid July 7, 2020 3:14 pm Reply
  • Well shit. Now i know why i got banned on fortnite 😂

    JaydenFX July 7, 2020 3:14 pm Reply
  • 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.

    Maciej Gronczynski July 7, 2020 3:14 pm Reply
  • [Everyone Liked That]

    DerinOnder Eren July 7, 2020 3:14 pm Reply
  • 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 🙏

    Aniket Singh July 7, 2020 3:14 pm Reply
  • Thank you for the tutorials!

    Greed&Sloth July 7, 2020 3:14 pm Reply
  • your content is just awsome, i am doing this as my project!!…..Thanks for this tutorial

    Md Aawesh Patanwala July 7, 2020 3:14 pm Reply
  • I'm convinced this is just an elaborate ploy to get people to play earth and beyond

    Sepher July 7, 2020 3:14 pm Reply
  • Woah thx

    super Sunardi July 7, 2020 3:14 pm Reply
  • Is there a guide for like if it detects a certain image on a screen it presses a certain key?

    Flnn GT July 7, 2020 3:14 pm Reply
  • How to make a pubg or Csgo bot?? And how to train my it

    indratej reddy July 7, 2020 3:14 pm Reply
  • Tip : don't go into a romantic relationship with it

    school survivor July 7, 2020 3:14 pm Reply
  • 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. 😊

    Anand Charvin July 7, 2020 3:14 pm Reply
  • Damn, Your eye looks pretty cool.
    Are they different colors too?

    Unilitre Pw July 7, 2020 3:14 pm Reply
  • you are the best!

    Za Warudo July 7, 2020 3:14 pm Reply
  • Can you do a match 3 bot tutorial?

    Tan Ing Hua July 7, 2020 3:14 pm Reply
  • your content is 10/10 im getting better because of you!

    Arc. god July 7, 2020 3:14 pm Reply
  • Love it man, you are doing a great job

    Tomas Gumauskas July 7, 2020 3:14 pm Reply
  • Can you teach us how to make a bot for another MMORPG browser game? Also I love your vids

    Scarasect July 7, 2020 3:14 pm Reply
  • Really nice!

    thewaytohell July 7, 2020 3:14 pm Reply
  • Thank you for the tutorials, they are very well made. I will subscribe and hope that you make more tutorials.

    Edinson Cabral July 7, 2020 3:14 pm Reply
  • in my opinion this video is so underrated

    Midrush July 7, 2020 3:14 pm Reply
  • Thank you for uploading this video i am learning a lot from you.

    Ronaldo apelyido July 7, 2020 3:14 pm Reply

Leave a Comment

Your email address will not be published. Required fields are marked *