afk-clicker icon indicating copy to clipboard operation
afk-clicker copied to clipboard

Hey man, it's me, necromancer!

Open dasiuk opened this issue 2 years ago • 11 comments

I know this repo has been super dead for the past 4 years, but I really want to find myself a working autoclicker bc I don't know how to code. Libraries can't be installed now, versions stated are ether too old or non-existent, and it does nothing when run. Can I somehow revive in? All I need is to spam 1 keyboard button every 20 seconds in TF2 (specific window)

dasiuk avatar Oct 24 '23 19:10 dasiuk

Hello, could you provide more details about the errors?

  • Environment that you are trying to run (python version, operating system, etc)
  • The error message

Currently I can't promise that I will make changes in the code, but I can see what I can do.

eHonnef avatar Nov 01 '23 23:11 eHonnef

Windows 10 Pro, Version 10.0.19044 Build 19044. Python 3.10.9. Error:

C:\Users\aboba\Desktop\windows>python Main.py -n "cs2.exe" Traceback (most recent call last): File "C:\Users\aboba\Desktop\windows\Main.py", line 158, in Main() File "C:\Users\aboba\Desktop\windows\Main.py", line 150, in Main afk_Clicker.run(afk_Clicker.get_hwnds_by_name(args.name)) File "C:\Users\aboba\Desktop\windows\Main.py", line 92, in run raise Exception("Invalid handler, please check PID or process name") Exception: Invalid handler, please check PID or process name

C:\Users\aboba\Desktop\windows>pip install -r requirements.txt Collecting pywin32==306 (from -r requirements.txt (line 1)) Using cached pywin32-306-cp310-cp310-win_amd64.whl (9.2 MB) Collecting win32gui==221.4 (from -r requirements.txt (line 2)) Using cached win32gui-221.4.tar.gz (605 kB) Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [19 lines of output] Traceback (most recent call last): File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "C:\Users\aboba\AppData\Local\Programs\Python\Python310\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\aboba\AppData\Local\Temp\pip-build-env-7ru0t6wg\overlay\Lib\site-packages\setuptools\build_meta.py", line 355, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "C:\Users\aboba\AppData\Local\Temp\pip-build-env-7ru0t6wg\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in _get_build_requires self.run_setup() File "C:\Users\aboba\AppData\Local\Temp\pip-build-env-7ru0t6wg\overlay\Lib\site-packages\setuptools\build_meta.py", line 507, in run_setup super(_BuildMetaLegacyBackend, self).run_setup(setup_script=setup_script) File "C:\Users\aboba\AppData\Local\Temp\pip-build-env-7ru0t6wg\overlay\Lib\site-packages\setuptools\build_meta.py", line 341, in run_setup exec(code, locals()) File "", line 26, in File "C:\Users\aboba\AppData\Local\Temp\pip-install-e1ugdrnt\win32gui_0cd5f4b2f0174a1baa9b02bed3068197\win32\distutils\gui.py", line 6, in from win32.distutils.command import win32_build_ext ModuleNotFoundError: No module named 'win32.distutils.command' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

dasiuk avatar Nov 02 '23 20:11 dasiuk

My thought is that it probably actually works, but I can't install dependencies listed, since it's so hella old. And can't launch code without them. Also I forgot to mention that I'm looking for an autoclicker to type 1 letter in an inactive window every 20 seconds. So maybe it can't even do it in theory, idk

dasiuk avatar Nov 02 '23 21:11 dasiuk

Hey, so I just checked on a Windows 10 VM using the newest python 3.12.0 and it still works :)

The trick was to bump the version of pywin32 and remove the dependency of win32gui. I updated the requirements.txt in the last commit.

Please, update with the latest commit e5f409406771d8702a7307c232101ba32623c062, give a try and let me know if it worked.

eHonnef avatar Nov 02 '23 21:11 eHonnef

Ok, yeah. It definitely does something now for sure. But there are still some strange things going on. I repeated your tests, tested in Minecraft and notepad, as well as TF2 (where I hope it'll work) and CS2. So it does not work in any games at all, nothing. But in Notepad it does. Since it has to press letter 'r' every 20 seconds, I tested it with command python Main.py -k 0x52 -p %code%, and instead of typing 'r' it repeatedly typed 虀 (ex 虀虀虀虀虀虀虀虀虀) instead. So maybe windows can't recognize the symbol I'm trying to type? I had english keyboard on at the moment and my Windows is in english too

dasiuk avatar Nov 02 '23 21:11 dasiuk

I changed that one number from 1 to 20, so It'll now type every 20 seconds I think. I also tried googling the problem, but found no issues like that, maybe that's on my PC or something. I also tested a few other codes (0x50, 0x51) and they all type the same symbol 虀 instead of letter they supposed to type

Bruh https://www.yellowbridge.com/chinese/dictionary.php?word=%E8%99%80&cache=87827

dasiuk avatar Nov 02 '23 22:11 dasiuk

Bruh https://www.yellowbridge.com/chinese/dictionary.php?word=%E8%99%80&cache=87827

LoL :laughing:

What you can try to check is in this line https://github.com/eHonnef/afk-clicker/blob/master/windows/Main.py#L83

That line is the one that posts the keystroke to the window handle. Maybe it should post another struct besides the win32con.WM_CHAR.

Maybe I will give a look in the weekend or next week, idk. This code is a little big mess that I ducked tape long ago.

eHonnef avatar Nov 02 '23 22:11 eHonnef

Sorry, I just don't know how to code. And your "mess" almost works exactly as needed. Still idk if it'll work for valve's games as some autoclickers don't but to it's huuge still

dasiuk avatar Nov 03 '23 09:11 dasiuk

Ay, have you looked into the code?

dasiuk avatar Nov 13 '23 16:11 dasiuk

Bruh https://www.yellowbridge.com/chinese/dictionary.php?word=%E8%99%80&cache=87827

LoL 😆

What you can try to check is in this line https://github.com/eHonnef/afk-clicker/blob/master/windows/Main.py#L83

That line is the one that posts the keystroke to the window handle. Maybe it should post another struct besides the win32con.WM_CHAR.

Maybe I will give a look in the weekend or next week, idk. This code is a little big mess that I ducked tape long ago.

Man?...

dasiuk avatar Jan 08 '24 13:01 dasiuk

Hello, sorry, I have no plans to work on this for now. Maybe you'll have some luck in one of the forks.

eHonnef avatar Jan 09 '24 23:01 eHonnef