Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if mouse stops moving
#1
i read this and dont understand it really...but i think it mite be what i need not sure tho

Wait statement - until mouse stops moving

i need to add something to my macro so if there is no mouse movement for 10 seconds it ends the current macro and runs a different one...is that possible?

in other words i have "Macro" and "Macro1" and i need to have... for example, if no mouse movement for 10 seconds end "Macro" and run "Macro1"...can anyone help?
#2
I personally have never tried this before, so I don't think I could be of any help on this subject but I set the macro in that post up into a file because I was bored. You can probably mess with the times given and get it to work with your macro. Since none of us can see the macro your working on.


Attached Files
.qml   qmr55 Macro.qml (Size: 986 bytes / Downloads: 364)
Taking on Quick Macros one day at a time
#3
yeah that is the problem actually lol...i do not understand that macro and i think it mite be wut i need but i dont understand it
#4
just download the .qml posted by QM Assistant, and add the the out to Macro Stop then hit play and move the mouse around until you feel like stopping then it should put the out put in after 10 sec of mouse idle
Code:
Copy      Help
if(!WaitForMouseMove(0)) ret
WaitForMouseStop 10
out "Mouse Idle for 10 sec"
#5
Works good JOHN, whats weird is I tried exactly what you had except I just had:
Code:
Copy      Help
out 1
and it didn't work for me but then I tried what you had and it did. I musta miss typed something when I tried! Confusedhock:
Taking on Quick Macros one day at a time
#6
out will only work with "" or str or int so for out 1

out "1"

or

int x=1
out x

or

str x="1"
out x
#7
Yep, but now when I tried it with
Code:
Copy      Help
out 1
it decided to work. So i'm guessing I miss typed something or I might have even forgot to put the 1 after out, and just thought I did. Confusedhock:
Taking on Quick Macros one day at a time
#8
i think u guys may have missed what i needed lol...i need something to add to my macro to make it so if the mouse does not click for 10 seconds it ends the macro and runs a different macro...can u help plz? ty
#9
i learned something new lol out # works dont know that i would ever use it lol
#10
Quote:i learned something new lol out # works dont know that i would ever use it lol
lol, don't we all.

Quote:i think u guys may have missed what i needed lol...i need something to add to my macro to make it so if the mouse does not click for 10 seconds it ends the macro and runs a different macro...can u help plz? ty

Just put:
Code:
Copy      Help
if(!WaitForMouseMove(0)) ret
WaitForMouseStop 10
mac- "Other Macro"

in your macro. We could probably help out more if we could see your code.
Taking on Quick Macros one day at a time
#11
just make a function and put this in it:

new_function
Code:
Copy      Help
if(!WaitForMouseMove(0)) ret
WaitForMouseStop 10
shutdown -6 0 "macro to stop"
mac "macro to start"

;if you want to lop this set a rep for it.

;rep
,;if(!WaitForMouseMove(0)) ret
,;WaitForMouseStop 10
,;shutdown -6 0 "macro to stop"
,;mac "macro to start"
then use mac "new_function" in one of you macros/functions you running to start this function
#12
john do i have to have some other macros named

WaitForMouseStop ??
#13
You need both those functions in the file I posted.
WaitForMouseMove
WaitForMouseStop
Taking on Quick Macros one day at a time
#14
yes have you not downloaded the .qml file ? you will need to if you havent
#15
ok...i dont think this works how i want it to lol...so if i have this and i run a macro and it does not click somewhere for 10 seconds it will end the macro and run the next one?
#16
WaitForMouseMove
Code:
Copy      Help
;/;
function# [double'maxWaitTime]

;Waits until mouse movement begins.
;Returns 1 if movement began, 0 if not.


;maxWaitTime - number of seconds to wait. Default or 0 - infinite.


int wt=maxWaitTime*1000
int t1=GetTickCount
POINT p p0
xm p0
rep
,0.05
,xm p
,if(memcmp(&p &p0 sizeof(POINT))) ret 1
,if(wt and GetTickCount-t1>=wt) ret

WaitForMouseStop
Code:
Copy      Help
;/;
function double'idleTime

;Waits until mouse movement ends.

;idleTime - number of seconds mouse must be not moving.


POINT p pp
int i t0 it=idleTime*1000
xm pp
rep
,0.05
,xm p
,if(memcmp(&p &pp sizeof(POINT))) i=0
,else if(!i) i=1; t0=GetTickCount
,else if(GetTickCount-t0>=it) ret
,pp=p
#17
Code:
Copy      Help
if(!WaitForMouseMove(0)) ret
WaitForMouseStop 10
mac- "Other Macro"

Is set up so that basically if your mouse doesnt move for 10 seconds, then it will run the other macro, but you need both those other files with it.
Taking on Quick Macros one day at a time
#18
like was said before there is only so much we can help you without seeing your code. this will be my last post here until you do so.


Forum Jump:


Users browsing this thread: 1 Guest(s)