Posts: 15
Threads: 8
Joined: Jan 2009
Hi,
I am new to QM and have created a macro where the mouse drags a window across the screen to a different location. I would like to edit the macro so that it runs faster. I have some characters that I cannot understand in the macro:
mou "AaD@A@C@D@E@G@G@f10I@F@JAM@MAOAf16+38+4f15+36+3f10+44+6TBXCUCWEUDTDNDUDTFPDf10OEQE+28+9IDLEHDFBHDGCGCf10GCf24YMEBFCHCDB
HCEBFBf10IDDACCB@BBBABB@ABBABf10BDf16@Af15@KaEf16@M@E@DAEf10@B@C@BAC@CACABADBB@Af10ADBCCDABDDBCEEABBB@Bf18CDA@BC@ABBBBBBf23
@Af10ACBA@A@ABAf24@AAA@Af18BA@ABAf23@AAAf23@Af10AAf16AABAf64@BA@f15AAf16BAf16AAf17A@f63ABf185A@f143Aaf496aaf41@af111@af176"
I have no idea how to make sense of this and I cannot find anything in the help or reference that makes it clear.
I have five or so such lines in this macro.
Can anyone explain what this means and how I might edit it to speed up the dragging?
Thanks.
Posts: 12,097
Threads: 142
Joined: Dec 2002
It is to make recorded macro more compact.
Records mou "..." if Drag is checked in QM Recording dialog. Example:
Macro
int w1=act(win("Untitled - Notepad" "Notepad"))
lef+ 329 14 w1
mou "a@a@aAaAaAaAbBaBbAaBaA@AaBbAaAaBaAbBbBaBbAbBbCcBbBbBcBcBcCfDdDdCeDdCeDfEgEfFfEfDeDfFfEdEeFfEfFeDdCcCbCcBdDcCdEeDeFcEcBcB@Ba@"
lef- 329 14 w1
If unchecked:
Macro
int w1=act(win("Untitled - Notepad" "Notepad"))
lef+ 279 18 w1
lef- 740 245
If it runs too fast, use opt slowmouse:
Macro
spe 50
opt slowmouse 1
int w1=act(win("Untitled - Notepad" "Notepad"))
lef+ 279 18 w1
lef- 740 245
If you need to convert mou "..." to multiple mou x y, I can create function that converts.
Posts: 12,097
Threads: 142
Joined: Dec 2002
This macro converts recorded mou commands to editable format.
Macro
Trigger @11 ![Help - how to add the trigger to the macro Help - how to add the trigger to the macro](images/qm/help.png) (can be any trigger)
;Select recorded mou "..." command in QM editor, and run this macro.
;It replaces the selection to multiple mou- x y commands.
;Can be selected more than one line. Can contain other commands. For example you can select whole macro.
str s1.getsel s2 so
ARRAY(str) a
int r
foreach s2 s1
,if(findrx(s2 "^([[9],]*)mou ''(.+?)''$" 0 0 a)>=0)
,,ConvertRecordedMouString a[2] so a[1]; err mes- "failed to convert" "" "x"
,,r=1
,else
,,so.addline(s2)
if(r) so.setsel
else mes- "There are no mou ''...'' commands in the selected text." "" "!"
Function ConvertRecordedMouString
;/
function $s str&so [$prefix]
;Converts recorded mou command, where it is in format mou "...", to multiple mou- x y commands.
;s - input string.
;so - output string.
;prefix - a string to prepend to each line.
int i j x y isy c w; str ss
for j 0 1000000
,c=s[0]
,;out s
,sel c
,,case 0 break
,,
,,case ['+','-']
,,for isy 0 2
,,,s+1
,,,for(i 0 100) if(!isdigit(s[i])) break
,,,if(i=0) end ES_BADARG
,,,y=val(ss.left(s i)); if(s[-1]=='-') y=-y
,,,if(!isy) x=y; if(s[i]!='+' && s[i]!='-') end ES_BADARG
,,,s+i
,,s-1
,,so.formata("%smou- %i %i[]" prefix x y)
,,
,,case ['w','f'] ;;wait, factor
,,if(!isdigit(s[1])) goto g1
,,s+1
,,for(i 1 100) if(!isdigit(s[i])) break
,,w=val(ss.left(s i))
,,if(w) so.formata("%s%g%s[]" prefix w*0.001 iif(s[-1]='f' "*F" ""))
,,s+i-1
,,
,,case else
,,;g1
,,if(c!='@' and !isalpha(c)) end ES_BADARG
,,x=iif(c<=90 (c-64) -(c-96)); s+1; c=s[0]
,,y=iif(c<=90 (c-64) -(c-96))
,,so.formata("%smou- %i %i[]" prefix x y)
,
,s+1
Posts: 15
Threads: 8
Joined: Jan 2009
Thanks very much!
I will experiment with the information you posted.
Posts: 15
Threads: 8
Joined: Jan 2009
Hi,
I tried using the macro you created, but every time I run it, the macro stops on the line "ConvertRecordedMouString".
I have pasted the macro into a new macro and then assigned the ctrl+F5 hotkey to run it. I then select an entire macro which contains mouse movement and use the ctrl+F5 hotkey. What happens is the macro editor opens up to the mouse coord macro with the line above highlighted. I am also not sure what to do with the function you have below the macro.
Thanks.
Posts: 12,097
Threads: 142
Joined: Dec 2002
|