Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import time
- import win32api
- import win32con
- from ahk import AHK
- ahk = AHK()
- #CONFIG
- windowName = b"MapleLegends (Build 21/12/2019)"
- try:
- maple = ahk.find_window(title=windowName)
- except:
- print("Game not found.")
- os.system('pause')
- sys.exit()
- class Bot():
- def __init__(self):
- self.on = True
- self.lastMove = 0
- def start(self):
- while self.on:
- now = time.time()
- while time.time() < (now + 30):
- self.heal()
- if win32api.GetAsyncKeyState(win32con.VK_SPACE) == 1:
- self.on = False
- break
- self.move()
- def heal(self):
- ahk.key_press('z')
- def move(self):
- if self.lastMove > 0:
- ahk.key_press('left')
- self.lastMove = 0
- else:
- ahk.key_press('right')
- self.lastMove = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement