dustyroo

Untitled

Aug 31st, 2019
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.79 KB | None | 0 0
  1. import threading
  2. from time import sleep, time,strftime
  3. from random import randint,uniform
  4. from mouse import press, release
  5. from keyboard import is_pressed
  6. from humanize_zucc import imageFind,imageLocation,humanClick,humanClickHold,humanClickRealse,humanMove, humanKeyp,humanMoverel
  7.  
  8. forceStop = False
  9. paused = True
  10. reset = True
  11. start = time()
  12. timerLimit = 69*69
  13. #edit these to your keybind
  14. forwardMoveKey = ""
  15. backMoveKey = ""
  16. leftMoveKey = "z"
  17. rightMoveKey = "x"
  18.  
  19. def main():
  20.     print("started")
  21.     while not forceStop:
  22.         if not paused:
  23.             afk()
  24.  
  25.             stime = uniform(0.1,1)
  26.             sleep(stime)    
  27.         sleep(0.5)
  28.  
  29. def afk():
  30.     global reset, start,timerLimit
  31.     if reset:
  32.         print("Randomizing timer")
  33.         reset = False
  34.  
  35.         start = time()
  36.         timer = int(time() - start)
  37.         timerLimit = randint(300,1200)
  38.         print("Anti-AFK in:{} min".format(timerLimit/60))
  39.  
  40.     timer = int(time() - start)
  41.  
  42.     if timer > timerLimit:
  43.         reset = True
  44.         timesToLoop = randint(0,10)
  45.  
  46.         for i in range(timesToLoop):
  47.             if forceStop or paused:
  48.                 break
  49.  
  50.             chance = randint(0,100)
  51.  
  52.             if chance >= 50:
  53.                 humanKeyp(leftMoveKey)
  54.             else:
  55.                 humanKeyp(rightMoveKey)
  56.             x = randint(-100,100)
  57.             y = randint(-100,100)
  58.             chanceToLook = randint(0,100)
  59.             if chanceToLook >= 50:
  60.                 humanClickHold("right")
  61.                 humanMoverel(x,y,3,8,-5,5)
  62.                 humanClickRealse("right")
  63.        
  64.  
  65.  
  66.  
  67. def stopAll():
  68.     global forceStop, paused
  69.     key = "f12"
  70.     on_off = False
  71.  
  72.     while not forceStop:
  73.         try:
  74.             if is_pressed(key):
  75.                 if on_off:
  76.                     print('Paused afk')
  77.                     paused = True
  78.                     on_off = False
  79.                     while is_pressed(key):
  80.                         sleep(0.1)
  81.                 elif not on_off:
  82.                     print('UnPaused afk')
  83.                     paused = False
  84.                     on_off = True
  85.                     while is_pressed(key):
  86.                         sleep(0.1)
  87.  
  88.             if is_pressed("f11"):
  89.                 print("force closed app")
  90.                 forceStop = True
  91.                
  92.             sleep(0.01)
  93.         except Exception as e:
  94.             print("#ERROR debug Info {}\n".format(e))
  95.             appendFile = open('logs/logfile_startdata_errors.txt','a')
  96.             appendFile.write('ERROR(stopAll) @{}  Info {}\n'.format(strftime("%c"),e))
  97.             appendFile.close()
  98.         else:
  99.             sleep(0.01)
  100.  
  101. start_timer = threading.Thread(target=stopAll)
  102. start_timer.start()
  103. starter = threading.Thread(target=main)
  104. starter.start()
Advertisement
Add Comment
Please, Sign In to add comment