Solved

write me an autohotkey script

Posted on 2014-10-18
8
502 Views
Last Modified: 2014-10-19
Hello

I'm not a programmer and don't have time tonight to learn the formatting in's and out's of autohotkey

Can one of you experts build me an autohotkey script which does this:

   1. begin a loop of 800 cycles
 a. wherever the mouse happens to be, send a normal single click
b. sleep a random amount of time between 2000ms and 4000ms
c. send a keypress of the "1" key
d. sleep a random 2-4 seconds again (a new random not the same as before)
e. send the "1" key again
f. sleep a random 2-4 seconds again (another new seed)
g. send the spacebar
h. sleep 18 to 22 seconds and repeat next increment of this loop (as long as capslock is on, else stop)
0
Comment
Question by:FocIS
  • 3
  • 3
  • 2
8 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 40390010
EE is not a free version of rent-a-coder.  The EE experts can help you with your scripts, but you must put in some effort.

You may want to consider contacting the top experts in the applicable zones to see if they have their Hire Me link enabled.  The most applicable zones for that search are (VBScript and Visual Basic Programming - VB6).
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 40390021
Sounds like a homework assignment to me. :)
0
 
LVL 2

Author Comment

by:FocIS
ID: 40390531
Well, it isn't a homework assignment (i have been out of school for almost 20 years now) just an effort to get an automated task done in a short amount of time...  sort of like getting an oil change without first having to learn how to do it myself.  

Sometimes the answer to every single thing a person can need isn't to learn everything about how to do it first, sometimes it has to be ok to ask for help to just get it done in the interest of time.  I'm not a programmer, I don't write code, and I have no time or interest in perusing that skill set.  I simply have a task, and a tool; seeking help how to use the tool for this task.

I didn't realize there was a rule or requirement set on EE that says someone has to put in a sufficient level of effort which those experts determine is either good enough or not good enough.  Obviously experts can choose to help, or not help as you two have.

If someone who is already an expert in scripting (especially with AutoHotKey) would like an easy 500 points for what's probably 2 minutes of work, I'd love to see and use the script.

I understand it's not a free version of rent-a-coder, and you understand it's not always FREE either, we're on a paid subscription.  You have your subscription for free by answering questions (as you should) - we paid real money to be here.
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40390703
If you make a little effort, you will get a much more robust response from the (volunteer) experts.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 51

Accepted Solution

by:
Joe Winograd, EE MVE earned 500 total points
ID: 40391087
Well, the reason I said "homework assignment" is that I can't for the life of me figure out how this is a useful program in the real world — so my gut was that it's a homework assignment in order to learn something about AutoHotkey, which, from your comments, you are obviously not interested in doing. So although I can't figure out why you want this, here's the AutoHotkey code that does exactly what you asked for:

Loop,800
{
  Send {LButton}
  Random,SleepTime,2000,4000
  Sleep,%SleepTime%
  Send 1
  Random,SleepTime,2000,4000
  Sleep,%SleepTime%
  Send 1
  Random,SleepTime,2000,4000
  Sleep,%SleepTime%
  Send {Space}
  Random,SleepTime,18000,22000
  Sleep,%SleepTime%
  GetKeyState,CapsLockState,CapsLock,T
  If (CapsLockState="D") ; caps lock is on
    Continue
  Else                   ; caps lock is off (CapsLockState="U")
    Break
}

Open in new window


If you want to re-seed the random number generator at any point in the code, the command is:

Random,,NewSeed

Here's the definition of NewSeed from the AutoHotkey help:
This mode reseeds the random number generator with NewSeed (which can be an expression). This affects all subsequently generated random numbers. NewSeed should be an integer between 0 and 4294967295 (0xFFFFFFFF). Reseeding can improve the quality/security of generated random numbers, especially when NewSeed is a genuine random number rather than one of lesser quality such as a pseudo-random number. Generally, reseeding does not need to be done more than once.

If reseeding is never done by the script, the seed starts off as the low-order 32-bits of the 64-bit value that is the number of 100-nanosecond intervals since January 1, 1601. This value travels from 0 to 4294967295 every ~7.2 minutes.
Regards, Joe
0
 
LVL 2

Author Comment

by:FocIS
ID: 40391178
Joe,

Thanks for taking the time to write that script for me.  I totally understand your initial hesitation, I wouldn't do the work for someone who was supposed to be learning how to do it either.

Maybe one day when I have time (or increased need) I'll sit down and really page through how AHK works but for this one off thing I couldn't devote the time (between the kids fall activities and winterizing the house, work, wife, etc)

From your example alone I've learned some basics that I can apply in simple situations going forward too

This script has freed me from my keyboard, where I was previously stuck pressing that combination repeatedly - now the script can do it while I dig the storm windows out of the garage - I'll silently raise my beer in your direction when they're all up

Thanks again for taking the time, I really appreciate it
0
 
LVL 2

Author Closing Comment

by:FocIS
ID: 40391180
Above and beyond one of the most professional experts I've had the pleasure of interacting with on EE
0
 
LVL 51

Expert Comment

by:Joe Winograd, EE MVE
ID: 40391229
Happy to help — and thanks for the kind words! But I still cannot understand why you would be executing this process 800 times (when caps lock is on). I've written many AutoHotkey scripts that automate repetitive keyboard tasks, often with wait times (Sleep commands), but never with random wait times. I'd love to understand (at least superficially) what this key sequence accomplishes for you, i.e., why you were previously pressing that combination repeatedly. If you don't mind, please take a brief moment to explain. Regards, Joe
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now