Advertisement
themadgod

Untitled

Jan 27th, 2020
412
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. import os
  2. import sys
  3. import time
  4. import win32api
  5. import win32con
  6.  
  7. from ahk import AHK
  8.  
  9. ahk = AHK()
  10.  
  11. #CONFIG
  12. windowName = b"MapleLegends (Build 21/12/2019)"
  13.  
  14. try:
  15. maple = ahk.find_window(title=windowName)
  16.  
  17. except:
  18. print("Game not found.")
  19. os.system('pause')
  20. sys.exit()
  21.  
  22. class Bot():
  23. def __init__(self):
  24. self.on = True
  25. self.lastMove = 0
  26.  
  27. def start(self):
  28. while self.on:
  29. now = time.time()
  30. while time.time() < (now + 30):
  31. self.heal()
  32. if win32api.GetAsyncKeyState(win32con.VK_SPACE) == 1:
  33. self.on = False
  34. break
  35. self.move()
  36.  
  37. def heal(self):
  38. ahk.key_press('z')
  39.  
  40. def move(self):
  41. if self.lastMove > 0:
  42. ahk.key_press('left')
  43. self.lastMove = 0
  44. else:
  45. ahk.key_press('right')
  46. self.lastMove = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement