Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v5.1 can't execute in command line mode #190

Closed
vanferry opened this issue Nov 27, 2022 · 1 comment
Closed

v5.1 can't execute in command line mode #190

vanferry opened this issue Nov 27, 2022 · 1 comment
Labels

Comments

@vanferry
Copy link

vanferry commented Nov 27, 2022

with v5.1, can't execute in command line mode, both on win10 and mac, python 3.11
tried to execute using bash shell:

$ /c/tools/KeymouseGo_win10/KeymouseGo_v5.1-win64.exe /c/tools/KeymouseGo_win10/scripts/1128_053340.txt

2022-11-28 05:44:15.137 | DEBUG | main::114 - ['C:\tools\KeymouseGo_win10\KeymouseGo_v5.1-win64.exe', 'C:/tools/KeymouseGo_win10/scripts/1128_053340.txt']
2022-11-28 05:44:15.137 | DEBUG | main::138 - {'scripts': ['C:/tools/KeymouseGo_win10/scripts/1128_053340.txt'], 'runtimes': 1, 'speed': 100, 'module': 'Extension'}
2022-11-28 05:44:15.137 | INFO | main:single_run:82 - Script path:C:/tools/KeymouseGo_win10/scripts/1128_053340.txt
2022-11-28 05:44:15.137 | DEBUG | UIFunc:parsescript:620 - Script content
2022-11-28 05:44:15.137 | DEBUG | UIFunc:parsescript:621 - [[0,"EM","mouse move",["0.17805989583333334%","0.9415094339622642%"]],[202,"EM","mouse move",["0.15397135416666666%","0.970440251572327%"]],[202,"EM","mouse move",["0.0751953125%","0.9849056603773585%"]],[203,"EM","mouse move",["0.046875%","0.9716981132075472%"]],[136,"EM","mouse left down",["0.0458984375%","0.9716981132075472%"]],[112,"EM","mouse left up",["0.0458984375%","0.9716981132075472%"]],[1492,"EK","key down",[68,"D",0]],[170,"EK","key up",[68,"D",0]],[29,"EK","key down",[79,"O",0]],[111,"EK","key up",[79,"O",0]],[77,"EK","key down",[82,"R",0]],[135,"EK","key up",[82,"R",0]],[82,"EK","key down",[73,"I",0]],[64,"EK","key up",[73,"I",0]],[105,"EK","key down",[67,"C",0]],[140,"EK","key up",[67,"C",0]],[16,"EK","key down",[79,"O",0]],[52,"EK","key up",[79,"O",0]],[541,"EK","key down",[13,"Return",0]],[94,"EK","key up",[13,"Return",0]],[8873,"EM","mouse move",["0.0458984375%","0.9716981132075472%"]],[202,"EM","mouse move",["0.0%","0.7547169811320755%"]],[202,"EM","mouse move",["0.055013020833333336%","0.5283018867924528%"]],[203,"EM","mouse move",["0.056966145833333336%","0.5188679245283019%"]],[191,"EM","mouse left down",["0.072265625%","0.489937106918239%"]],[107,"EM","mouse left up",["0.072265625%","0.489937106918239%"]],[695,"EK","key down",[13,"Return",0]],[35,"EK","key up",[13,"Return",0]],[7514,"EK","key down",[164,"Lmenu",0]],[53,"EK","key down",[160,"Lshift",0]],[6,"EK","key down",[80,"P",0]],[5,"EK","key up",[80,"P",0]],[55,"EK","key up",[164,"Lmenu",0]],[11,"EK","key up",[160,"Lshift",0]],[11184,"EK","key down",[160,"Lshift",0]],[54,"EK","key down",[162,"Lcontrol",0]],[6,"EK","key down",[87,"W",0]],[6,"EK","key up",[87,"W",0]],[126,"EK","key up",[160,"Lshift",0]],[7,"EK","key up",[162,"Lcontrol",0]],[667,"EM","mouse move",["0.072265625%","0.489937106918239%"]],[202,"EM","mouse move",["0.6695963541666666%","0.47735849056603774%"]],[248,"EM","mouse move",["0.6722005208333334%","0.49748427672955975%"]],[202,"EM","mouse move",["0.5865885416666666%","0.5006289308176101%"]],[248,"EM","mouse move",["0.5660807291666666%","0.5012578616352201%"]],[6,"EM","mouse left down",["0.5660807291666666%","0.5012578616352201%"]],[118,"EM","mouse left up",["0.5660807291666666%","0.5006289308176101%"]],[1170,"EM","mouse move",["0.5660807291666666%","0.5006289308176101%"]],[201,"EM","mouse move",["0.6539713541666666%","0.47735849056603774%"]],[203,"EM","mouse move",["0.7018229166666666%","0.4880503144654088%"]],[519,"EM","mouse move",["0.7154947916666666%","0.48742138364779874%"]]]
2022-11-28 05:44:15.137 | ERROR | main:single_run:107 - too many values to unpack (expected 2)

no debug info under Windows Powershell, so I tried Bash Shell.
this command works well with v5.0 and v4.1.

@Monomux Monomux added the bug label Nov 28, 2022
@Monomux
Copy link
Collaborator

Monomux commented Nov 28, 2022

Sorry, this is a bug due to my carelessness.
The function parsescript will return a tuple with length 3, after update 518dbaf . However, I didn't update the code in command line mode.

events, smodule_name = UIFunc.RunScriptClass.parsescript(path, speed=speed)

This problem can be solved by simply adding a return value

events, smodule_name, _ = UIFunc.RunScriptClass.parsescript(path, speed=speed) 

Currently, the plugin system has changed, and the relative code is refactored. So this problem will not happen in newer version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants