Skip to content

Instantly share code, notes, and snippets.

@Simarjot-sk
Created August 8, 2021 12:51
Show Gist options
  • Save Simarjot-sk/b5350556d280d9dd49c7c560709089f6 to your computer and use it in GitHub Desktop.
Save Simarjot-sk/b5350556d280d9dd49c7c560709089f6 to your computer and use it in GitHub Desktop.
Simulates scrolling and changing of tabs. It can be used during work from home to bypass productivity tracking softwares, just start this script, open an ide with multiple tabs and this program will scroll up and down.
import time
import pyautogui as gui
import random as rdm
#scrolls random number of times for random distances,
#changes the tabs in the active window
def work_hard():
print('hard work started')
s_count = rdm.randint(1,10)
for i in range(s_count):
s_distance = rdm.randint(-1000, 1000)
gui.scroll(s_distance)
print(f'scrolled {s_distance} pixels')
print('sleeping')
time.sleep(rdm.randint(0, 10))
select_random_tab()
time.sleep(1)
def select_random_tab():
gui.keyDown('ctrl')
tab_change_count = rdm.randint(0, 3)
for i in range(tab_change_count):
gui.press('tab')
gui.keyUp('ctrl')
print('starting honest hard work in 5 seconds')
time.sleep(5)
while True:
work_hard()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment