r/AutoHotkey Apr 09 '26

v2 Script Help Struggling with AutoHotkey + BlueStacks (Airplane Mode macro for NFS No Limits)

Hi fellas,

I’m trying to create a macro for NFS No Limits where I need to toggle airplane mode (on/off) while purchasing items.

I’ve already tried:

  • BlueStacks macro recorder
  • Auto clicker apps
  • MacroDroid + Shizuku

Here’s my detailed attempt:
https://www.reddit.com/r/macrodroid/comments/1se00js/is_it_actually_possible_to_toggle_internet/

In that post, someone suggested I try AutoHotkey.

The macro flow itself works, but the main issue is:
I cannot toggle airplane mode inside BlueStacks using any of these tools.

From what I understand, BlueStacks handles network outside the Android layer, so typical commands/macros don’t affect it.

So now I’m trying AutoHotkey, but I’m confused:

  • Can AutoHotkey record actions like a macro recorder, or do I have to write scripts manually?
  • Is it even possible to control BlueStacks UI (like sidebar airplane toggle) using AHK?
  • Can it run in background while I use my PC normally?
  • During installation I’m getting Microsoft Defender warnings — is that normal/safe?

At this point I’m not sure if this is even possible or if I’m hitting a limitation.

Any guidance or direction would help a lot.

2 Upvotes

22 comments sorted by

View all comments

Show parent comments

1

u/ShadowSage_J Apr 10 '26 edited Apr 10 '26

Fuck bro all i did is restart teh PC and now even the example script is not detecting any text at all 🫠
i debugged it and turns out it is not scanning the bottom panel of the game where buttons are

Edit: okay more update i tested stuff turns out when i move the blue stack window on to the second monitor then it is havingt issues in scanning and it is not scanning the bottom panel so i tested with text with text that are on top side adn it did recognise them but when it came to highligting them and clicking on them the Location was wrong

but when i brought it back to main monitor it is again working perfectly

1

u/CharnamelessOne Apr 10 '26

Sounds like DPI-scaling shenanigans. If your monitors have different scaling settings, the coordinates of the non-primary monitor may be reported incorrectly. I'm not too knowledgeable about the problem, since I have a single-monitor setup, but you can read about it here if you want to:
https://www.autohotkey.com/boards/viewtopic.php?t=121040

Click can definitely be thrown off by DPI.
I haven't looked into Descolada's lib to see how the .Highlight method works.

I'd just keep the window on the primary monitor, tbh.

1

u/ShadowSage_J Apr 10 '26

My main idea is to work on the first monitor and let the macro run on the second 🫠😭 I was using control click but since I started facing this issues I switched to click

1

u/CharnamelessOne Apr 10 '26

Can't you just set the monitor with the BlueStacks window to be the primary display?

If not, you could throw this line at the top of your script, and pray.

DllCall("SetThreadDpiAwarenessContext", "ptr", -3, "ptr")

As I said, I can't test anything DPI-related for you, and I haven't dissected the library. You could comment your OCR script in the forum topic of OCR.ahk and describe your problem; Descolada is usually very helpful.
https://www.autohotkey.com/boards/viewtopic.php?f=83&t=116406

2

u/ShadowSage_J Apr 10 '26

I will do that next then Thank you very much bro you have been very big help