Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Python 

How to recognize NPCs in a game?

So I'm trying to write a script for a game and the most important part is the script needs to be able to recognize the NPC is there and then click on it.  So I am using pyautogui and I give the script an image, the issue is it can only recognize the NPC if it's in the same exact angle it was in when the picture was taken.  Here is a code example of how I'm doing it and I hope someone has a better method because mine isn't working.


Code
while 1:
    if pyautogui.locateOnScreen('character.png', confidence=0.8) is not None:
        print("I can see it")
        time.sleep(0.5)
    else:
        print("I cannot see the character")
If it’s 3D then that library isn’t going to do anything to help you. Look into openCV and tesseract
(Aug 18, 2020 05:23 PM)Charger Wrote:  If it’s 3D then that library isn’t going to do anything to help you. Look into openCV and tesseract

Ahh, so tesseract should treat the image as a 3d image, while pyautogui is treating it as 2d.

I'll have to do some research.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by DistrictMay 17, 2019 08:05 PM 5 147 May 17, 2019 08:05 PM
Last Post: demarco
[Java] by sneezing pandaJun 12, 2018 12:42 AM 14 484 Jun 12, 2018 12:42 AM
Last Post: GenericSkid
[.NET] by BapeZOct 1, 2017 11:44 AM 2 150 Oct 1, 2017 11:44 AM
Last Post: Barret