Created this for some stupid game, but that's beside the point. I started keyboard maestro last week and have been catching on, but still lack plenty of knowledge obviously. Out of my newly gained knowledge, I'd say the most important concept was the familiarization of global variables/subtasks. Anyways, Here's the script:
*Activate or deactivate the script with a hotkey.
*The script calculates a random duration of time to be logged in: within a 2.5 to 5-hour range and keeps track of your logged-in duration.
*ALL click positions are randomly selected from the range of coordinates specified on the entire location of the target
*The script selects a random coordinate within the click area of the specified coordinate range *Pauses for a brief moment between 1.5 to 2 seconds before each action
*Randomly determines a time within 15 to 45 minutes for subtle mouse movement changes within the click area
*Generates varied time intervals between each click:
Most common: 1.5 to 2 seconds (95% chance).
Least common: 15 to 60 seconds (0.25% chance).
*Once the random calculation for the logout time is reached, it clicks the logout buttons and then calculates a random duration to wait before logging back in (between 20 minutes and 2 hours)
Login Sequence; After the pause duration determined after logging out:
*Clicks the login button
*Waits for 15 to 30 seconds.
*Clicks the welcome message and the whole cycle repeats until the script is ended via hotkey
What I'd like to know from the veteran Keyboard Maestro users here:
One thing I can say is that you should be using local rather than global for any variables not needed outside of this macro. This keeps your variable list lean, which is good practice in general, as numerous large variable values stored globally can start to hinder performance.
Also, I’ve been trying to get this script to display certain calculation variables in the form of EST.
Example: It calculates the amount of time to be logged in, but it’s in Unix. I’m trying to get it to show it’s calculation in hours/minutes, as well as the start time of the script (NOW() = StartTime) to allow me to see the amount of time I have left.
If either of you know a command that could get me started or know a direction I can head to find out, I’d greatly appreciate that.
Technically you don’t need the double underscore, a local variable just needs to start with local, so for example: localVariable. The double underscore (example: local__Variable) just hides anything behind the underscores in user prompts.
So for instance, in the Prompt for User Input action, if you include a double underscore in variable, the only thing that the prompt will show is whatever comes after the underscores.
Example: AOE__Unit, the AOE__ will not display in the prompt as seen in the screenshots.
Here are some examples to show how that can be done. Keyboard Maestro has a native feature to convert from unix to human readable, but unless I’m mistaken, it doesn’t have a native feature to convert from human readable to unix. So I use a shell script to do that. Note that in the shell script your flags (everything in the quotation marks after -jf, in the example %H:%M) must match the format of the KM variable.
When one condition is not used in a logic action, I insert an Intentionally BlankComment action.
Below is your macro with those suggestions (minus the change to local variables). I placed all of your actions in a Group and then collapsed the group, otherwise the image created during the native upload function is too large. (Note that the image size could also be reduced by collapsing logic actions; but I opted to use one enclosing group because I wanted to preserve the original presentation of your macro within the group.)
High Alchemy Rough Draft Advanced (@_jims suggestions) Macro (v10.2)
What does this script accomplish in the game? Is it like automated farming of materials or experience points? I like the idea of automating tedious and repetitive stuff in games and have tried this myself with varying success, so you got me curious!
Yes it is. A lot of people hate on it, but I don’t have the patience to sit there for hours clicking a million times lol. Ive come a long way since this post.
The script randomizes everything (pauses/breaks, clicking locations, etc.), reports stats like xp/actions per hour, and even has a built in error contingency setup. If it messes up in any way (lags and misplaces an item, logs me out, etc.) it will go through a serious of troubleshooting steps and correct the issue itself.
Im at the point where I could leave it on 24/7 and never touch it if I want to.
Awesome thanks I'll definitely go check it out. I ended up detecting changes in the application (E.g., a certain process coming to a halt) via pixel conditions. I could NOT, for the life of me, getting Found Image on Screen to work. I tried absolutely everything I could find online: permissions, screen resolution, fuzziness, the list goes on. I even tried going the OCR route but found it to be a little too inconsistent.
I have a long list of If/then/otherwise and while/until functions along with multiple "execute a macro" actions throughout a massive script. It definitely gets tough when I'm trying to implement something big but it's a good time for sure.