The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macro to Loop functions + change function with hotkey while also scanning for images
#1
Hey QM Users and Gintarras!^^

Maybe this is simple for you. Would be cool if you can help me with a snippet. I tried with several approaches but none of them worked and i have really bad programming skills. xD

I need a few hotkeys and everyone of them should trigger another function while stopping the function that was running before

I have a function that does something (one time). But in my main Macro I want to loop the execution of that function after the command (RegisteredHotKey) is given.
And if i press another hotkey it should stop repeating the function that was running before and repeat the next function that is linked with the other hotkey

These functions should be able to call other functions (like function 4, 5 or 6 who are without hotkeys but are triggered if one of a few images is found). They should pause the 1, 2 and  3 functions when they do that. After these "non-hotkey" functions were running, they should return to the function loop that was triggered by hotkey. (I think that's normal function behaviour but I'm not sure and this is why i mention it.)

Pseudocode:
Code:
Copy      Help
Hotkey Shift+Alt+1
Hotkey Shift+Alt+2
Hotkey Shift+Alt+3


if Shift+Alt+1
     stop function 2+3
     rep function 1

if Shift+Alt+2
     stop function 1+3
     rep function 2
if Shift+Alt+3
     stop function 1+2
     rep function 3

---
simultaneous:
scan for image 1, if found run function 4
scan for image 2, if found run function 5
scan for image 3, if found run function 6

Doing this only with if, else and if(scan) etc. creates such a chaotic macro that I can't even understand what I did. So it would be very cool if there is a more clean and easy to understanding code that I can add things to it. But if thats not so easy in a clean way, i am happy with anything that helps me to run the code. Big Grin

Thanks for trying to save my life! ;p


Messages In This Thread
Macro to Loop functions + change function with hotkey while also scanning for images - by Remotehorst23 - 07-25-2020, 09:13 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)