Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work after recent Agents of Sabotage GTAO update. #11

Open
ElectroBytezLV opened this issue Dec 24, 2024 · 7 comments
Open

Does not work after recent Agents of Sabotage GTAO update. #11

ElectroBytezLV opened this issue Dec 24, 2024 · 7 comments

Comments

@ElectroBytezLV
Copy link

Script simply does not work after the recent Agents of Sabotage DLC update. When you press the respective key, it does not do anything in game. You can see the script actually doing stuff in the console, but the actual keypresses are not being reflected in game.

Rockstar changed something in the most recent update relating to macros, hotkeys and keypresses that are from an external program, because I had the same issue with my AHK script and only started working after a few changes to the actual hotkeys.

I talked to a person that knows python well and they said that they got it to work after they used pynput directly to emulate/send the keypresses instead of the keyboard library, but I am unsure about the technical details.

@JU5TDIE
Copy link
Owner

JU5TDIE commented Dec 30, 2024

Sorry for the late reply, I've been quite busy. Anyways, I was already aware of this issue but I couldn't find the clear solution yet. The key inputs work most of the time but sometimes they do not.

And about the keyboard library issue, I have already tried with pynput library for key inputs, but it didn't even work before the Agents of Sabotage DLC. After testing with some libraries, ctypes was the only library that worked flawlessly with the direct input key values. However, I'm not sure if this is reliable for the main branch so I'll create a fork of this later. Feel free to test it and let me know if you encounter any issues.

@ElectroBytezLV
Copy link
Author

So a little information, I'm not a good programmer so I also tried converting the casino fingerprint script to use ctypes or pynput with chatgpt, but that didnt change anything for me (it did function just not in GTA).
I tried MANY different combos and methods to try and make this work, for example, installing the recommended python version and the libraries with the exact version, using the latest python version with the latest versions of each library, etc.
Tried launching the script in multiple ways: with admin, from a cmd window, via the main.py, via the exe, putting it in the same folder as GTA 5, etc. Launching the script before or after launching GTA 5. Nothing seemed to solve it.

Then magically I somehow managed to get it working. I have no clue how that could be a thing, but it seems like the script only works for me IF I launch GTA 5 from rockstar launcher OR have rockstar launcher open in the background (NOT minimized to the system tray).
If I minimize R* launcher or close it and launch the game from epic games or from my desktop shortcut, the script does not work. If I launch the game from R* launcher or launch the game from the shortcut or epic games when R* launcher is maximized, then it seemed to also work. I will do more testing related to these, but thats one thing that was fairly consistent in my testing.

It is quite inconsistent though, because one person tried it and it worked without any issues for them not matter how they launch their game or what they do.

@JU5TDIE
Copy link
Owner

JU5TDIE commented Dec 31, 2024

Well, I don't know how reliable chatgpt is nowadays, but I doubt it gave you the correct answers. From my experience, they were wrong most of the time when it came to resolving some complex problems.

Then magically I somehow managed to get it working. I have no clue how that could be a thing, but it seems like the script only works for me IF I launch GTA 5 from rockstar launcher OR have rockstar launcher open in the background (NOT minimized to the system tray).

I bought gta on rockstar launcher so I always launch gta from rockstar launcher but the script does not work even for me sometimes. I also tested multiple times with different setup, but it's too random that I couldn't find the pattern unfortunately.

Here is the branch I updated. As I explained above, it uses ctypes library with direct input, which means it might conflict with battleye. Test it at your own risk and let me know if you encounter any issues.

@ElectroBytezLV
Copy link
Author

The answers chatgpt gave seemed to look and work fine, just as I mentioned they didnt change anything in game. Either way I also havent been able to find a pattern of when it works or doesnt work.
I will try out the new branch later on though to see if it works, thank you for the response and help trying to solve the issue.

@ElectroBytezLV
Copy link
Author

ElectroBytezLV commented Jan 3, 2025

I have tried the updated branch and it seems to work perfectly now first time I opened it. If it worked perfect for you and me, I guess you can push this to the main branch and add a disclaimer about battleye.
Thank you for the help of solving this issue.

I wanted to ask another question. I've noticed when using this previously that quite often the script (doesnt matter if exe version or py version) closes by itself even if GTA is still open. What could be the issue or how could you solve it? Maybe a temporary solution is to launch the py script from a terminal window and it wont close that automatically? I'm not sure of the pattern on when or why it closes but I just have noticed often that it disappears from my taskbar and I have to reopen it.

Edit: I also tried it on cayo and the cayo retro fingerprint is quite unreliable - it often just spams random buttons without actually resolving the puzzle correctly (probably have to increase the delay between presses, but I havent tried it yet)

@JU5TDIE
Copy link
Owner

JU5TDIE commented Jan 6, 2025

Could you test it again? Because I tried to test cayo fingerprint hack with the ctypes-fix branch but it suddenly stopped working for me sadly. And I don't think it's the problem with specific library.

This is how I tested with both main and ctypes-fix branch. I started the program as soon as my character was loaded. The key inputs were unresponsive as usual, however the entire program went unresponsive after 8~10 minutes this time (pynput keyboard event not responding and I had to restart every time). After restarting the program, it worked flawlessly.

Strangely, it worked in the first place when I put 0.1 millisecond (0.0001 second) delay between PressKey and ReleaseKey function. But this also went unresponsive after 8~10 minutes and had to restart the program. (I assume battleye is doing something under the hood. The program never went unresponsive when I started gta with battleye off)

I'm extremely sure I found the pattern of this annoying issue, but I still haven't found the solution to fix this. I'll let you know when I push the fix.

I've noticed when using this previously that quite often the script (doesnt matter if exe version or py version) closes by itself even if GTA is still open. What could be the issue or how could you solve it?

Did you press F4 by any chance? It never closed by itself on my PC. Also, if you run it from the source on terminal, there should be an error output. Feel free to create a new issue and don't forget to post that error output together ;)

Edit: I also tried it on cayo and the cayo retro fingerprint is quite unreliable - it often just spams random buttons without actually resolving the puzzle correctly

That's probably because the script is getting each key's hex value from the dictionary every time, which consumes a little bit of time (sorry for the non-optimized code design, I had to make a quick fix). This only applies to ctypes-fix branch so you may also try with the main branch since they both have the same issue on my PC

@ElectroBytezLV
Copy link
Author

TLDR;

For some reason, main branch is working for me now (as you can see from my previous messages it did not work at all).
I did not experience unresponsiveness for either main or ctypes fix branch.
Casino fingerprint works perfectly now for both branches.
Cayo retro fingerprint does not work correctly for either branches.

Ok so I did some more testing. To my surprise the main branch somehow is working for me now in game (its actually solving stuff) where as you can see from my previous messages, it did not work at all. I dont understand how or why the main branch is working for me now.

I was probably testing both branches for more than 10-30 minutes and I did not experience any of them freezing or crashing and me having to reopen then.

Also yes I tried and saw that F4 closes the script which I found quite odd, since its a common button that you could accidentally press or press it for other purposes and the script would close. In my opinion - remove it so the only way to close the script is to manually close the window, the exe or CTRL+B in the terminal window. So it doesnt close on accident.
Not sure if I just got unlucky but I didnt experience it closing randomly (so maybe I was pressing F4 often even though I dont remember using it often).

Now I tried both main and ctypes branch on cayo retro fingerprint and I can report that is basically did not work almost every time. It just spams random buttons and does not solve the fingerprint correctly almost everytime. Which is weird because it used to work perfectly before battleye.
I also experimented with casino fingerprint and keypad and both ctypes and main branch work PERFECTLY for casino fingerprint hack.
But for some reason sometimes both branches fail on the keypad even though I pressed F6 on the last pattern correctly (it seemed to fail more often on the main branch and cytpes branch only failed one of the hacks out of like 10 tries). No one does the keypad hack anyways but obviously it would be nice if it was working correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants