Live data from Hacker News

AutoHotkey v2 Official Release Announcement

autohotkey.com

91–100 of 153 posts

Re: AutoHotkey v2 Official Release Announcement

#92
post #44

What are some use cases where having AHK scripts would help? On the same note, can anyone share some existing list of scripts and their functions which helped make their lives easier?

Back when I played Minecraft, I wrote one I was pretty pleased with:

If you have a stack of items, you can pick up half of them by right-clicking on it, which is very convenient when you're dividing out a stack on the crafting grid to make many copies of a recipe that needs that item in 2 or 4 slots; but for some recipes, you need to put the same item in 3 or 6 slots, and there's no built-in way to divide a stack into thirds.

So I made an AHK script that, when I held down a key, would

- pick up half of the items in the stack I'm pointing at (right-click) - move the mouse one inventory space to the right - put them down (left-click) - pick up half of them again - move back one inventory space left - put them down, adding them back to the original stack - and repeat

and it would only stop after one of the "pick up" steps; so, after a few iterations, you'd be left with the stack divided into equal thirds, two in your inventory & one on the mouse.

Eg, starting with a stack of 60, it goes 30/30, 45/15, 22/38, 41/19, 20/40, 40/20, 20/40, 40/20... then release the key, and you've got three stacks of 20.

Re: AutoHotkey v2 Official Release Announcement

#93

I saw there's a python library that just lets you write autohotkey scripts in actual python code. I'd rather try that if I was going to rewrite my v1 scripts. AHK is awesome but the scripting language was never good. The new one looks like it has some better syntax, but native python support would be a much better solution for a lot of people.

In case you're open to something for JS instead of Python, my life has been much better since I switched from AHK to nutjs for my own automation scripts: https://nutjs.dev/ A real programming language, and support for multiple platforms!

Alternatively if you're into dotnet, FlaUI is amazing for automation and gives you a sane environment. I moved to it when I couldn't deal with AutoIT scripts anymore and it's everything I needed. https://github.com/FlaUI/FlaUI

Re: AutoHotkey v2 Official Release Announcement

#94
post #44

What are some use cases where having AHK scripts would help? On the same note, can anyone share some existing list of scripts and their functions which helped make their lives easier?

I like to prefix files with a YYMMDD date, so I made a script to do that when I press a hot key, and also send a text to my wife to bring me a cup of coffee.

So on days with more files you drink more coffee? For me personally the files pretty fast would be the limit, else I get really jittery…

Re: AutoHotkey v2 Official Release Announcement

#95
post #24

I love Autohotkey because, in addition to its productivity benefits, it's a defensive tool against dark patterns imposed by user-hostile companies. For example, I've been using it for years to enter my Runescape password [1] due to Jagex being clueless about security [2] [1] https://reddit.com/r/runescape/comments/gxapao/how_to_paste_... [2] https://www.troyhunt.com/the-cobra-effect-that-is-disabling/

I work in a large enterprise who's idea of single sign on is you use the same dialog for everything and have to type your username and password every time. They are fairly strict about saving passwords so I use a hot key for my username that also logs the time and date of usage

Re: AutoHotkey v2 Official Release Announcement

#96
post #44

What are some use cases where having AHK scripts would help? On the same note, can anyone share some existing list of scripts and their functions which helped make their lives easier?

I've done some scripting for a very annoying enterprisy software in a medical environment. Think "repeat the action for those 100 patients" without spending hours clicking around. It started in AutoIT and migrated to FlaUI, but probably could've started in AHK as well.

Re: AutoHotkey v2 Official Release Announcement

#97

I see here are the masters of ahk! Is there a smart way to mark/record from a specific moment till "done" and just reply it 1/n times? I tried many macro tools but none of them was "just easy" to use.

Can you expand on “from a specific moment till done” and possibly provide an example? What’s the exit condition? Time? A ui change? Seems like you could write a do_macro function and bind a key to loop it till “done” but I may be misunderstanding

Re: AutoHotkey v2 Official Release Announcement

#98
post #44

What are some use cases where having AHK scripts would help? On the same note, can anyone share some existing list of scripts and their functions which helped make their lives easier?

Back when I played Minecraft, I wrote one I was pretty pleased with: If you have a stack of items, you can pick up half of them by right-clicking on it, which is very convenient when you're dividing out a stack on the crafting grid to make many copies of a recipe that needs that item in 2 or 4 slots; but for some recipes, you need to put the same item in 3 or 6 slots, and there's no built-in way to divide a stack int…

I have an adjacent, simple scripting story.

Battlefield 2042 recently had an XP glitch where you could go into a server with BF3 settings, throw ammo to a teammate and get XP for the resupply. Naturally there were several servers dedicated to this with 128/128 players and everyone on one team all standing at one objective.

Rather than actually play the game to level up and get the weapons/gadgets I wanted or even play this accelerated XP mini game, I wrote an ahk script to automate the equipping and dropping of the ammo crate so that I could do other things.

I only had to let it run for a few hours before I was max level, and the 10 minutes of scripting gave me the benefit for something I wouldn’t otherwise subject myself to.

Re: AutoHotkey v2 Official Release Announcement

#99
Autohotkey is the only windows thing I miss on Linux.

And it seems impossible to even discuss desktop automation with contemporary Linux DE people, they just glaze over. "Like, why would you want apps to be able to control other apps, that sounds dangerous! We definitely want to protect you from that in Wayland.... Oh, what's that? You are a large consultancy that uses time tracking apps to help with billable hours? I guess you have to change your business model"

Re: AutoHotkey v2 Official Release Announcement

#100

Autohotkey is the only windows thing I miss on Linux. And it seems impossible to even discuss desktop automation with contemporary Linux DE people, they just glaze over. "Like, why would you want apps to be able to control other apps, that sounds dangerous! We definitely want to protect you from that in Wayland.... Oh, what's that? You are a large consultancy that uses time tracking apps to help with billable hours?…

People are sleeping on Windows Power Automate too
Post reply on HN