adafruit / Adafruit_CircuitPython_Ducky

CircuitPython library for running DuckyScript
MIT License
20 stars 7 forks source link

No long integer support for adafruit_ducky #12

Closed Ar1ste1a closed 4 days ago

Ar1ste1a commented 1 year ago

[edited by @dhalbert, transferred from Learn Guides repo]

Line in question is https://github.com/adafruit/Adafruit_CircuitPython_Ducky/blob/a1bfe1f2b9cc3f0e7d403537e36ccbe3e787ea0e/adafruit_ducky.py#L146

Neradoc commented 1 year ago

That could be fixed by using adafruit_ticks and its functions in the library instead of time.monotonic_ns().

dhalbert commented 11 months ago

Commit in question is 3782248.

GrahamGrecian commented 11 months ago

Commit in question is 3782248.

Yeah. Even rolling back doesn't seem to fix the issue. Right now this repo is pretty broken. Not sure how to transfer all my time functions to adafruit ticks.

Andynam0 commented 7 months ago

@evaherrada Still happening in the latest project files https://learn.adafruit.com/neo-trinkey-circuitpython-rubber-ducky/project-code (I am using 9.x, )

Traceback (most recent call last):
  File "code.py", line 47, in <module>
  File "adafruit_ducky.py", line 146, in loop
NotImplementedError: No long integer support
]0;🐍146@adafruit_ducky.py NotImplementedError | 9.0.3\
Code done running.
UF2 Bootloader v1.23.1-adafruit.1-337-g1c691d5 SFHWRO
Model: NeoPixel Trinkey M0
Board-ID: SAMD21E18A-NeoTrinkey-v0

Latest Stable CircuitPy https://downloads.circuitpython.org/bin/neopixel_trinkey_m0/en_US/adafruit-circuitpython-neopixel_trinkey_m0-en_US-9.0.3.uf2

(same exact error for NeoKey even after making commenting changes to code.py)

UF2 Bootloader v1.23.1-adafruit.1-366-gb00c709 SFHWRO
Model: NeoKey Trinkey M0
Board-ID: SAMD21E18A-NeoKeyTrinkey-v0

https://downloads.circuitpython.org/bin/adafruit_neokey_trinkey_m0/en_US/adafruit-circuitpython-adafruit_neokey_trinkey_m0-en_US-9.0.3.uf2

tyeth commented 3 months ago

Commit in question is https://github.com/adafruit/Adafruit_CircuitPython_Ducky/commit/3782248e20a08c8e0d66d5610285462a95a3f596.

Just to note a user in discord had this issue. I wildly suggested changing the time.monotonic_ns to time.monotonic and dividing all the delays by 1000, which surprisingly worked. They might have had to alter the delays in their ducky script too

SnapBanane commented 3 months ago

Update on the error so i fixed it by doing everything tyeth said above but not changing the delay multiplier to 1000 but to 2

tyeth commented 3 months ago

Was that 2 value the delay in the ducky script @SnapBanane which was originally 2000 (i.e. not the bit in the adafruit_circuutpython_ducky python library)?

SnapBanane commented 2 months ago

I modified this:

if start == "DELAY": print("delay!") self.wait_until += int(words[1]) * 2 return True

and this: if start in ("DEFAULT_DELAY", "DEFAULTDELAY"): self.wait_until -= self.default_delay self.default_delay = int(words[1]) * 2 self.wait_until += self.default_delay return True and this: now = time.monotonic() * 1000 # Convert to milliseconds

Also i wrote some code to remove emty lines because the original code took emty lines as an ENTER input which is bad cause in almost every ducky script there are emty lines.

i dunno if this helped or not @tyeth