Skip to content

Commit

Permalink
Usage Explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
Zy-XD committed Jan 6, 2023
1 parent 0ce2808 commit a2c96a3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
# zymacro
Macro recorder and playback program

Created using Python 3.11.1 64-bit
Created using Python 3.11.1 64-bit

pyautogui, pydirectinput, pynput, and simplejson required

E.g. pip install [module]

Use 'py code/record/recorder.py' to record keyboard and mouse inputs, use -h to view options

macro file is output into 'output' folder as .json

Use 'py code/playback/playback.py' to playback the macro in the 'input' folder, use -h to view options
12 changes: 12 additions & 0 deletions code/playback/playback.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
global held_clicks
held_clicks = list()

global executed_actions
executed_actions = list()

def main():

print("ZyMacro - Playback")
Expand Down Expand Up @@ -286,6 +289,9 @@ def playActions(filename, i=0):
pool.join()

if repeat_macro:

executed_actions.clear()

if Decimal(elapsed_time()) > macro_duration:
print("Reached duration specified...")
elif operation_halted:
Expand Down Expand Up @@ -315,6 +321,12 @@ def actionIterator(iterations): # Using multithreading function to increase accu

action = data[index]

global executed_actions
if executed_actions.__contains__(action):
return
else:
executed_actions.append(action)

if Decimal(elapsed_time()) < Decimal(action['time']):
sleep(float(Decimal(action['time']) - Decimal(elapsed_time())))

Expand Down

0 comments on commit a2c96a3

Please sign in to comment.