Advertisement
Guest User

PokèBot Scheduler

a guest
Jul 26th, 2016
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. # Made with <3 during a hot day from Halix !
  2. # Instructions :
  3. # Save this script as a new .py file
  4. # Put in the same folder of 'PokeCli.py'
  5. # Run it with Python3 !
  6.  
  7.  
  8. import subprocess
  9. import time
  10.  
  11. location = "Santa Monica"
  12. acctype = "google"
  13. username = "mygoogle@gmail.com"
  14. password = "mysecretpass"
  15.  
  16. def wait(timer):
  17. import time
  18.  
  19. while timer >= 0:
  20. time.sleep(1)
  21. print("[Time : " + str(timer) + "] Counting Down . . .")
  22. timer -= 1
  23.  
  24.  
  25. while True:
  26. process = subprocess.Popen(['screen', '-d', '-m' ,'python2', 'pokecli.py','-a',acctype,'-u',username,'-p',password,'-l',location])
  27. print("[Time : 0] Process Running . . .")
  28.  
  29. timer = 3600
  30. wait(timer)
  31.  
  32. subprocess.call(["pkill", "python2"])
  33. print("[Time : 0] Process Killed,sleeping . . .")
  34.  
  35. timer = 300
  36. wait(timer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement