Last active
September 29, 2022 13:53
-
-
Save moeenn/7d69233c5d227a4ee6f471fb69ae4532 to your computer and use it in GitHub Desktop.
WhatsApp Spam Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pynput.keyboard import Key, Controller | |
import time | |
def key_press(keyboard, keys) -> None: | |
for key in keys: | |
keyboard.press(key) | |
for key in keys: | |
keyboard.release(key) | |
def main() -> None: | |
keyboard = Controller() | |
delay = 0.3 | |
time.sleep(5) | |
while True: | |
print("sending message") | |
key_press(keyboard, [Key.ctrl, "v"]) | |
key_press(keyboard, [Key.enter]) | |
time.sleep(delay) | |
if __name__ == "__main__": | |
try: | |
main() | |
except KeyboardInterrupt: | |
print("Shutting down...") | |
except Exception as err: | |
print(err) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment