How can I loop the program for specified period of time #40
Unanswered
iamraghav1503
asked this question in
Q&A
Replies: 1 comment
-
Hello @iamraghav1503 ! import pyautogui as pe
import time
# Start time
start_time = time.time()
# Initialize a counter for unique numbers
counter = 1
# Run the loop for 2 hours
while time.time() - start_time < 2 * 60 * 60:
# Perform the actions
pe.moveTo(132, 475, 1)
pe.click(132, 475, 1)
# Create the unique sentence
message = f"superb bro i want this because of camera{counter}"
pe.typewrite(message)
pe.click(917, 515, 1)
# Increment the counter for unique numbers
counter += 1
# Optional: Add a delay between iterations if needed (e.g., 1 second)
time.sleep(1) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
pe.moveTo(132,475,1),pe.click(132,475,1),pe.typewrite(superb bro i want this because of camera),pe.click(917,515,1)
i want to loop this program for 2 hours and after the word 'camera' in the sentence i want to add non repeating unique numbers
Beta Was this translation helpful? Give feedback.
All reactions