TurboClick

Post your working scripts, libraries and tools
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

TurboClick

02 Oct 2017, 08:40

I was updating a software at work and it required about 20,000 lines to be inserted into a database. many already existed because this was a small monthly update. The software thought it was polite to tell me every time I was updating something that already exists... and forced me to click [OK] before continuing. I though that was silly and wrote this script to make my mouse click repeatedly while I walked away. (it clicked repeatedly because I layed something over the button)

after it worked so well I made it have a hotkey ([Ctrl] + [Insert]) to turn on and off this function (so dragging could be used)
I named it TurboClick (like the Turbo buttons on the old NES joypads):
.exe download: http://lsadevelopment.com/Software/Files/TurboClick.zip
Source:

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus

BoBo
Posts: 1208
Joined: 13 May 2014, 17:15

Re: TurboClick

02 Oct 2017, 09:30

Are all those programms you provide for download (on your page) made with AHK?? :)
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

Re: TurboClick

02 Oct 2017, 09:40

haha no.
actually this is my first venture into AHK.
most (not all) are C# programs.

I am learning AHK has some real power though. might be worth learning more and getting better with it.
User avatar
Delta Pythagorean
Posts: 237
Joined: 13 Feb 2017, 13:44
Location: Equestria

Re: TurboClick

03 Oct 2017, 07:05

Code: [Select all] [Expand] [Download] GeSHi © Codebox Plus


Untested, but made smaller.
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

Re: TurboClick

03 Oct 2017, 11:18

I like this:

Code: [Select all] [Download] GeSHi © Codebox Plus

^Ins::
MsgBox, % "Turbo Click is " (Var := !Var) ? "on" : "off"
Return


is that a boolean AND assignment operator (the := )
pretty cool.
User avatar
Delta Pythagorean
Posts: 237
Joined: 13 Feb 2017, 13:44
Location: Equestria

Re: TurboClick

04 Oct 2017, 08:46

Locksmitharmy wrote:I like this:

Code: [Select all] [Download] GeSHi © Codebox Plus

^Ins::
MsgBox, % "Turbo Click is " (Var := !Var) ? "on" : "off"
Return


is that a boolean AND assignment operator (the := )
pretty cool.

If you want an easy explanation for it: ? : is basically a smaller, one line if and else expression.
The Var := !Var is for "toggling" the variable's state. If 1, or true, then it would flip to be 0, or false.
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

Re: TurboClick

04 Oct 2017, 09:22

I understand the one line if statement, it is the same as c#.
But in c# we would not use the := ... we could just say (Var = !Var)...
What is the : for?
User avatar
Delta Pythagorean
Posts: 237
Joined: 13 Feb 2017, 13:44
Location: Equestria

Re: TurboClick

05 Oct 2017, 07:08

Locksmitharmy wrote:I understand the one line if statement, it is the same as c#.
But in c# we would not use the := ... we could just say (Var = !Var)...
What is the : for?

That turns the variable to be in Expression mode. Without it, it forces the if to ask if the Var is not the Var. Which is useless and makes no sense.
Without the colon, it's a normal if command. With it, it defines the variable.
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

Re: TurboClick

05 Oct 2017, 07:55

Neat Thanks.

(for completeness, In c# (var == !var) would do a comparison only while (var = !var) would do an assignment and still return a boolean because var IS a boolean)
Jaxter88

Re: TurboClick

10 Oct 2017, 22:23

Locksmitharmy wrote:Neat Thanks.

(for completeness, In c# (var == !var) would do a comparison only while (var = !var) would do an assignment and still return a boolean because var IS a boolean)


When using "=" to assign a value, literals are tolerated. However, assigning a variable's value requires bracketing the variable name with "%" delimiters, e.g. Var1 = %MyVar%.

The ":=" assignment operator doesn't require this, and has other useful properties.

See:

https://autohotkey.com/docs/Variables.htm

and the "Assign" section of the Operators help page at:

https://autohotkey.com/docs/Variables.htm#Operators
Locksmitharmy
Posts: 6
Joined: 29 Sep 2017, 09:46

Re: TurboClick

11 Oct 2017, 07:15

Neatoe, thanks for that
elModo7
Posts: 14
Joined: 01 Sep 2017, 02:38

Re: TurboClick

11 Oct 2017, 10:28

Looks nice! Love your software! :)
User avatar
Tomer
Posts: 191
Joined: 21 Aug 2016, 05:11

Re: TurboClick

15 Oct 2017, 09:35

Cool tnx

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 12 guests