Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/taojy123/KeymouseGo
Browse files Browse the repository at this point in the history
  • Loading branch information
Monomux committed Sep 5, 2023
2 parents 3e2cdb2 + aaf923f commit 4e7fa5f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions KeymouseGo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,19 @@ def on_keyboard_event(event):
try:
for path in script_path:
logger.info('Script path:%s' % path)
events, smodule_name = UIFunc.RunScriptClass.parsescript(path,
events, smodule_name, labeldict = UIFunc.RunScriptClass.parsescript(path,
speed=speed)
extension = UIFunc.RunScriptClass.getextension(
smodule_name if smodule_name is not None else module_name,
runtimes=run_times,
speed=speed)
j = 0
extension.onbeginp()
while j < extension.runtimes or extension.runtimes == 0:
logger.info('=========== %d ===========' % j)
try:
if extension.onbeforeeachloop(j):
UIFunc.RunScriptClass.run_script_once(events, extension)
UIFunc.RunScriptClass.run_script_once(events, extension, labeldict=labeldict)
extension.onaftereachloop(j)
j += 1
except BreakProcess:
Expand Down
2 changes: 1 addition & 1 deletion UIFunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ def parsescript(cls, script_path, speed=100):
# 识别标签或脚本语句
for i in range(startindex, steps):
if type(s[i]) == str:
labeldict[s[i]] = i - numoflabels
labeldict[s[i]] = i - numoflabels - startindex
numoflabels = numoflabels + 1
else:
delay = s[i][0] / (speed / 100)
Expand Down

0 comments on commit 4e7fa5f

Please sign in to comment.