Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. import time, os, keyboard, mouse, random, threading
  2.  
  3. cooldown_reset = 900
  4. #Tutaj ustawiasz co ile sekund ma byc reset wedki ^
  5. yoo = 1
  6.  
  7. def follow(thefile):
  8. thefile.seek(0,2)
  9. while True:
  10. line = thefile.readline()
  11. if not line:
  12. time.sleep(0.1)
  13. continue
  14. yield line
  15.  
  16. def Convert(string):
  17. li = list(string.split(" "))
  18. return li
  19.  
  20. def foo():
  21. threading.Timer(cooldown_reset, foo).start()
  22. keyboard.press_and_release('2')
  23. time.sleep(1.5)
  24. keyboard.press_and_release('1')
  25. mouse.click(button='right')
  26.  
  27. foo()
  28.  
  29. if __name__ == "__main__":
  30. logfile = open("C://Users/Kuba/AppData/Roaming/.minecraft/logs/latest.log", "r")
  31. loglines = follow(logfile)
  32. for line in loglines:
  33. if "Musisz wpisac" in line:
  34. if "aby moc lowic dalej" in line:
  35. x = Convert(line)
  36. print(x[5])
  37. x2 = x[5]
  38. keyboard.press_and_release('T')
  39. time.sleep(0.1)
  40. keyboard.write(x2)
  41. keyboard.press_and_release('enter')
  42. time.sleep(1)
  43. keyboard.press_and_release('2')
  44. time.sleep(1)
  45. keyboard.press_and_release('1')
  46. mouse.click(button='right')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement