-
-
Save pmnlla/bc233e4ea225072d7c0f1447bd3b9b7e to your computer and use it in GitHub Desktop.
how exactly do i do that? my code looks like
import time
import pyautogui
def SendScript():
time.sleep(2)
with open('script.txt') as f:
lines = f.readlines()
for line in lines:
pyautogui.typewrite(line.strip())
pyautogui.press('enter')
SendScript()
try this:
import time
import pyautogui
def SendScript():
with open('script.txt') as f:
for x in f:
pyautogui,typewrite(x)
pyautogui.press(enter)
time.sleep(2)
SendScript()I haven't tried it out myself, but hopefully it works for you
I tried this (copy and pasted it exactly into notepad++) but it said "NameError: name 'typewrite' is not defined" so I assumed maybe that was because you (maybe typo, i assumed this because the two lines under it have periods not commas) put a comma between pyatogui and typewrite, but when I added a period instead of a comma it said,"NameError: name 'enter' is not defined"
I tried this (copy and pasted it exactly into notepad++) but it said "NameError: name 'typewrite' is not defined" so I assumed maybe that was because you (maybe typo, i assumed this because the two lines under it have periods not commas) put a comma between pyatogui and typewrite, but when I added a period instead of a comma it said,"NameError: name 'enter' is not defined"
My code looks like this
import time
import pyautogui as auto
file = open("script.txt", "r")
auto.click(860, 719);
for x in file:
print(x)
time.sleep(0.7)
auto.write(x)
you can change the time.sleep to anything you want (I use 0.9 for Discord)
I tried this (copy and pasted it exactly into notepad++) but it said "NameError: name 'typewrite' is not defined" so I assumed maybe that was because you (maybe typo, i assumed this because the two lines under it have periods not commas) put a comma between pyatogui and typewrite, but when I added a period instead of a comma it said,"NameError: name 'enter' is not defined"
That is because 'typewrite' does not exist and is not part of the pyautogui library. Use 'write' instead
Yup! Just keep in mind that Discord will ratelimit you even if you send a message every seccond, so add a longer delay. ^-^