|
Post by zeak on Feb 9, 2020 1:16:13 GMT
Is there a way to detect if the PC is not being used, So that MMM doesn't interrupt me if i'm using the mouse or Keyboard. Either as a program setting or as an action with a delay before resuming macro.
|
|
|
Post by steve on Feb 11, 2020 4:44:05 GMT
I think it might depend on how you define 'not being used'
If not being used can be no mouse movement (so no human moving the mouse) then maybe something like: DEFINE STRING1 = %MOUSE_X%%MOUSE_Y% <do some stuff> DEFINE STRING2 = %MOUSE_x%%MOUSE_Y% IF STRING1 = STRING2 THEN THE MOUSE HAS MOVED SO IT IS NOT IDLE
If not being used is the computer at an idle state (again difficult to define) then maybe looking for a specific process triggered by an "IDLE" event: IF IDLE_PROCESS EXISTS THEN THE PC IS IDLE
|
|
|
Post by zeak on Feb 12, 2020 23:08:03 GMT
I was thinking the same sort of timing that triggers a screen saver, so if not used for 5 minutes screen saver turns on. So if we could find that hook then we could say if not used for 30 seconds then continue macro.
|
|
|
Post by Steve on Feb 14, 2020 9:15:04 GMT
Something like this?
DEFINE | PCIDLE::5 IF | PCIDLE | TRUE | <ACTION 1> do something do something do something ...the pc does go idle and ACTION 1 gets triggered do something do something ...the pc does go idle again and ACTION 1 gets triggered again do something RUN ACTION | STOP
|
|
|
Post by zeak on Feb 15, 2020 9:19:13 GMT
Yea something like that, Mainly just need it to stop when not idle. Because if you do it with the way you said in your last post, it wouldn't stop between those "do something" if no longer idle.
|
|
|
Post by cyberchipz on Feb 21, 2020 9:17:32 GMT
I think I get this zeak... you want it to do stuff.. if it's moving the mouse... continue, but if you wiggle the mouse... or press a key, the program will stop, or, so it will stop at the line that was executing... so you can pull up a page to read, or email, then when you walk away... it starts up again. or, so you can click stop and edit it because you saw it do something you didn't like. or, so you're at the line that was executing... or near the area you'd like to work on... Yeah.. I keep forgetting to click.. STOP and then go an edit the line, and get the error... Macro was modified (::facepalm: dang... forgot to stop it again. So, have it not stop if IT's moving the mouse; but DO stop if anything else moves the mouse... this kind of thing?
|
|
|
Post by zeak on Feb 23, 2020 22:36:34 GMT
I think I get this zeak... you want it to do stuff.. if it's moving the mouse... continue, but if you wiggle the mouse... or press a key, the program will stop, or, so it will stop at the line that was executing... so you can pull up a page to read, or email, then when you walk away... it starts up again. or, so you can click stop and edit it because you saw it do something you didn't like. Exactly what I was thinking.
|
|
|
Post by cyberchipz on Feb 23, 2020 23:49:25 GMT
Take a look at this, I incorporate some mouse movements too; but, they're not necesary... it doesn't exactly fit what you need; but, the basics are there.
2 | RUN ACTION | WAIT MILLISECONDS | 100
2 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL%::%TIME_MACRO%
3 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL%::+10
* | LookAgain 4 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL1%::%TIME_MACRO%
4 | RUN ACTION | MESSAGE PROMPT | X:%MOUSE_X% Y:%MOUSE_Y% MacroTime is %DECIMAL1%::Test %DECIMAL%::1 5 | RUN ACTION | DEFINE DECIMAL VARIABLE | %DECIMAL1%::%TIME_MACRO%
6 | IF | DECIMAL VARIABLE | %DECIMAL1% | LESS THAN | %DECIMAL% | GOTO MACRO LINE | LookAgain Line 3 is the length of time to wait.. didn't write for anything over 10 seconds from start; but, has the basics. Don't know what the decimal value is over a minute (ah, doesn't work)... let me know if you find out. (NM) OK it's basic. Will make something using actual time... perhaps. That will be more difficult. In most programs like Excel, MSBASIC, there's a system time which can be easier to work with. Notice it was missing a line after LookAgain... not sure why (forgot to save?) anyway, added, needs relisted.
The initial wait is to let the %TIME_MACRO% timer have time to go to zero, it's never zero at start but like 20+ sec, then goes to zero. Not perfect but, it works mostly. I have another one where I look for mouse movements, which could be modified into a mouse movement with a timer... that way if we wiggle the mouse, it will reset the timer, or a wait until mouse doesn't move. IOW if the mouse moves, it stays in loop (counts down till stable, so waits till not moving for x times) and if not moving jumps out of loop... could be set up as subroutine to run, or load and call, it's more complicated... let me know if you'd like to see that one.
OTOH, why not... it works, but a work in progress... after done, will use it to recalibrate positions of buttons if game moves location.
1 | RUN ACTION | WAIT MILLISECONDS | 100
* | Set Sensitivity in Milliseconds
2 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::0
* | Set Number of times mouse position is same
3 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER6%::10
4 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER1%::100
5 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER2%::0
6 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER3%::0
7 | RUN ACTION | MESSAGE PROMPT | Click OK and get Mouse Position::Waiting for USER::0
* | LookAgain
8 | RUN ACTION | WAIT MILLISECONDS | 100
9 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER4%::%MOUSE_X%
10 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER5%::%MOUSE_Y%
11 | IF | INTEGER VARIABLE | %INTEGER2% | IS | %INTEGER4% | WAIT MILLISECONDS | 100 | AND | 2 | IF | INTEGER VARIABLE | %INTEGER3% | IS | %INTEGER5% | GOTO MACRO LINE | FoundPosition
12 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER2%::%INTEGER4%
13 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER3%::%INTEGER5%
14 | IF | | | | DEFINE INTEGER VARIABLE | %INTEGER%::0
15 | RUN ACTION | GOTO MACRO LINE | LookAgain
* | FoundPosition
16 | RUN ACTION | DEFINE INTEGER VARIABLE | %INTEGER%::+1
17 | IF | INTEGER VARIABLE | %INTEGER% | LESS THAN | 10 | GOTO MACRO LINE | LookAgain
18 | RUN ACTION | MESSAGE PROMPT | MOUSE X:%INTEGER2% Y:%INTEGER3%::MOUSE POSITION::0
Wrote this before going to bed... could probably be cleaned up a bit... but basically records and returns mouse position after you let mouse sit for a Tried to make %INTEGER6% the number times the same but wouldn't let me code that in line 17. I have a question to Steve on that. In fact, sometimes won't let me code into IF anything over %INTEGER4%.
Oops, not sure what happened on line 14... sometimes it does that... not sure why. Maybe I forgot to clear.
|
|