Hacker News new | ask | show | jobs
by iamjason89 1030 days ago
Back when Lenovo ran their outlet for refurbished laptops on very database heavy oracle backend (2011?), our little computer shop would buy stuff from them. If you added an item to your cart, it would hold it for 10 min and prevent others from purchasing.

I used AHK to script a process that would automatically add laptops to our cart based on certain search criteria. Then we could sift through their inventory and release what we didn't want.

It was running great until one day it went rouge (okay, was prob human error) and it added EVERY item to our cart and crashed their website. Database error came up, I called them and told them what I did and they were happy to know why it went down.

1 comments

Every AHK I've made has gone rogue because I want it to do things and it does it well but without guard rails i overwhelm my target every time. Thankfully the target is usually my local and I just mostly reboot

You'd think I'd learn but my scripts usually start small for with one specific use and i enlarge it Unsafely once I think of another use for it

Loops are my danger zone. After a few crashes the first guardrail I end up adding to a script is a stop key combo interrupt. Then figure out what bounds to put only after every mistake. I don't have the foresight to prevent "rogue" behavior

from the V1 docs,

To avoid [infinite loops] add the $ prefix to the hotkey definition (e.g. $^c::) so that the hotkey cannot be triggered by the Send command.

or a very restrictive #MaxHotkeysPerInterval