Mar-24-2020, 08:19 PM
(Mar-24-2020, 07:03 PM)buran Wrote: may I ask why that complicated scheme running the code? What does "pasting actual code", where it comes from? Why not simply save the code as py files and run it the normal way?
https://python-forum.io/Thread-How-to-Ex...ython-code
it looks likeimport win32api
was changed probably by mistake -import
was deleted and first line in empty, second line is justwin32api
. But that is just a guess based on the traceback
I'm running it for a game, and it basically requires it to be through Powershell. I have the code in its own document, and I'd always just paste it into Powershell (after I did those previously stated steps). The one thing I neglected to mention, was what Powershell displayed in the actual code; that error I pasted is what it says below after I hit enter. Here's what it says on the actual code:
>>> import win32api Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: DLL load failed: The specified module could not be found. >>> import mouse >>> from time import sleep >>> import random >>> from random import randint >>> >>> # Digits >>> runter =[18,18,14,14,14,14,14,14,14,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] >>> cunter =[-4,-4,-4,-4,-4,-4,-4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] >>> >>> >>> # vars >>> count = 0 >>> EinAus = False >>> jaornein = randint(0,1) >>> >>> >>> >>> # Loop >>> count = 0 >>> while True: ... if win32api.GetAsyncKeyState(ord('0')): ... EinAus = not EinAus ... sleep(0.2) ... print('On') ... sleep(0.2) ... while EinAus is True: ... count = 0 ... while mouse.is_pressed(button='left'): ... if count < 40: ... jaornein = randint(0,1) ... if jaornein == 1: ... randomized = randint(0,5) ... elif jaornein == 0: ... randomized = random.uniform(0,-5) ... print(randomized) ... ammount = runter[count] ... drew = cunter[count] ... if jaornein == 1: ... ammount = ammount + randomized ... drew = drew + randomized ... elif jaornein == 0: ... ammount = ammount - randomized ... drew = drew - randomized ... ammountFinal = int(round(ammount)) ... drewFinal = int(round(drew)) ... win32api.mouse_event(0x0001,drewFinal,ammountFinal) ... sleep(0.10) ... count = count + 1 ... if count > 40: ... count = 0 ... ammount = 0 ... drew = 0 ... if win32api.GetAsyncKeyState(ord('0')): ... print('Out') ... EinAus = not EinAus ... sleep(0.2) ... break ... sleep(0.1)You see, it keeps saying that the module cannot be found. Thing is, it has always been installed and it was working before. Out of the blue this issue happened. Tried reinstalling, same issue. Odd issue and I'm out of ideas on how to fix it :/