Server Message
Server Message

Auto-Accept AutoHotKey Script feat. Pushbullet Mobile Notification (iOS friendly)

2025-04-28 11:20:44
After reading [this post](https://www.www.reddit.com/r/DotA2/comments/3pp5mq/dota_2_mobile_accept_desktop_and_android_app/), I decided to help [this guy](https://www.www.reddit.com/r/DotA2/comments/3pp5mq/dota_2_mobile_accept_desktop_and_android_app/cw88k3g) (and hopefully some other people too).
So I scraped some examples on the internet for code, and came up with my own Auto-Accept Autohotkey Script with mobile notification using Pushbullet API (the Pushbullet app is available for both Android and iOS devices).

**How it works: The point of view of a user**

1. You run the script.
2. Start a match search (both standard and custom maps should work).
3. Alt-tab to a different window.
4. Take your phone (internet connection required) and go on your smoke break or smth.
5. When the match is found the script will auto accept the match and you should get a notification on your phone.
6. Walk back to the PC at a slow relaxed pace while your game is loading.

**How it works: Script mechanics**

* the game window has to be in the background, because the script is using the windows_taskbar_program_icon_flash™ to determine when the game is found
* after the match-found, the dota 2 window in the background plays the sound and flashes the taskbar icon
* the flashing triggers the script
* the script makes the dota2 window active, and sends an "ENTER" key press to the dota2 window twice

**Warning #1:** Use at your own risk. I didn't have much time to test it, so it's not 100% foolproof. (You can flame me in the comments if you lose mmr because of this script).

**Warning #2**: Some manual actions needed to set it all up.

**Warning #3:** If you use this script: Please be responsible to get in the game - nobody likes minute-one-afk-without-a-hero teammate.

**Warning #4:** The script doesn't spam accept, so if someone declines the game, and you return to matchmaking with high priority, it will NOT accept the second game. (To cover this case, an activation hotkey and some changes in the logic are probably necessary)

**Warning #5:** Push notifications are unreliable and cannot be guaranteed that they have been delivered.

**Bonus Warning (script logic bug/feature):** False-positive triggers, such as party invites and game unpause events (only if you are tabbed out of dota) will make the taskbar icon flash. On these triggers the script will send a notification that a game is found, and it'll open the game window. This will happen because the script can't tell the difference between the invite/unpause event and the game being found.

**Step-by-step guide:**

1. Go to http://www.autohotkey.com/ to download AutoHotkey and install it.
2. Download the [script](https://dl.dropboxusercontent.com/u/16640637/Auto-Accept%2BPushbullet_public.ahk) or copy the code from this post, and save as an *.ahk file.
3. Visit https://www.pushbullet.com/ and register with your Google account.
4. Install the Pushbullet App ([iPhone](https://itunes.apple.com/us/app/pushbullet/id810352052?ls=1&mt=8) or [Android](https://play.google.com/store/apps/details?id=com.pushbullet.android&referrer=utm_source%3Dpushbullet.com)) . Run the app once to make sure it's connected to the google account.
5. Visit https://www.pushbullet.com/account and get the Access Token (e.g. G8aldIDL87ldFADFwp9065ADF2klj3ld).
6. Include your Access Token in the script using any text editor. Look for line 3 => PB_Token := "token_goes_here" (e.g. PB_Token := "G8aldIDL87ldFADFwp9065ADF2klj3ld").
7. Save changes and run the script.
8. Start a match search, and Alt-Tab to another window (This is MANDATORY)
9. Go do your stuff, but take your phone with you
10. When you get the notification, the match was already accepted, so you only have the loading time to get back.
11. To exit the script: right-click the "H" in the notification area (system tray) and click "Exit"

I can add a toggle activation-deactivation hotkey if you like (not sure if it's actually better with one).

I've test it on Windows 7 / 10 in borderless and fullscreen modes.

Special thanks go to

jNizM @ http://ahkscript.org/boards/viewtopic.php?t=4842

SKAN @ http://autohotkey.com/board/topic/54990-find-the-blinking-window-on-the-taskbar/

Sorry for bad english, not a native speaker here (I even use google translate to check the spelling cause I’m awful at it).

**Script code**


#SingleInstance force ; version 1.0 Early Access™
; You can change this part below
PB_Token := "token_goes_here"
PB_Title := "Game found"
PB_Message := "Get your ass in here"
; That's all you are advised to change

; set trigger for flashing window
InitFlashingWinTrigger:
Gui +LastFound
hWnd := WinExist() , DllCall( "RegisterShellHookWindow", UInt,hWnd )
MsgNum := DllCall( "RegisterWindowMessage", Str,"SHELLHOOK" )
OnMessage( MsgNum, "ShellMessage" )
Return

ShellMessage( wParam,lParam ) {
global bActivate
If ( wParam = 0x8006 ){
WinGet, flashingProcessName, ProcessName, ahk_id %lParam%
If (flashingProcessName = "dota2.exe") {
WinActivate, ahk_id %lParam%
ControlSend, , {Enter}, ahk_id %lParam%
Sleep 1000
ControlSend, , {Enter}, ahk_id %lParam%
Sleep 1000
ControlSend, , {End}, ahk_exe LA.exe
Loop, 5 {
global PB_Token
global PB_Title
global PB_Message
if (PB_PushNote(PB_Token, PB_Title, PB_Message) = 200){
Break
}
}
}
}
}

PB_PushNote(PB_Token, PB_Title, PB_Message) {
WinHTTP := ComObjCreate("WinHTTP.WinHttpRequest.5.1")
WinHTTP.SetProxy(0)
WinHTTP.Open("POST", "https://api.pushbullet.com/v2/pushes", 0)
WinHTTP.SetCredentials(PB_Token, "", 0)
WinHTTP.SetRequestHeader("Content-Type", "application/json")
PB_Body := "{""type"": ""note"", ""title"": """ PB_Title """, ""body"": """ PB_Message """}"
WinHTTP.Send(PB_Body)
Result := WinHTTP.ResponseText
Status := WinHTTP.Status
return Status
}
View orginal article
Livegames
YoungMinds
vs
NANG DUDUROG NG
YoungMinds
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
Willie Revillame`(RapGod)81183602522829
Larin Chushka27927158988
Mikameister101182352218259
Facepalm6121079229698
Sileeeeeeent7682192417690
NANG DUDUROG NG TANGA
HeroNameKillsAssistsDeathsLast hitsLevel
$on@L!181042092519991
GND13981912519983
Hello ^^1198832111298
?316841179518
M1TOS_71253212521945
Fro-Zen Gaming
vs
Boon Lay Kids
Fro-Zen Gaming
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
DaRk07595136168
F|G.HartbreakKid4211701712023
LSD.Buron13513102550
MrAbraxas?04424104109
El_Shai_Ftw4231541510032
Boon Lay Kids
HeroNameKillsAssistsDeathsLast hitsLevel
IS KAREN MOK HOT!?111331135316
Rukamon47247126653
MiNigga7402122014378
ALL MIGHT5811931813442
Intervention110320103056
First Games
vs
{LEMONADE}
First Games
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
Professor516735157276
old man1243962011856
Musang68866158637
Kaunas4131013134949
KubaBoss61171631711560
{LEMONADE}
HeroNameKillsAssistsDeathsLast hitsLevel
MNT51121962213408
Татарин216790177883
Sobr hellcase.com8141023178814
xxy414745179296
Aldo Gusye Adrian1289102199833
Team_Dangers
vs
Aqua Spiritka
Team_Dangers
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
4-5 пик разьеб мид000621013
Akikavasakipvpro.com00002792
FRQQST00101617
Х Л Ы С Т000621095
[Eva <3] Yukitero00031897
Aqua Spiritka
HeroNameKillsAssistsDeathsLast hitsLevel
Желтозубый01022992
Merratti (mute)01023992
F3310001924
devil00051980
ПИЗДОС01001702
NANG DUDUROG NG
vs
Team OpeL
NANG DUDUROG NG TANGA
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
Why le?00000625
-2500000625
Winter Soldier00000625
KODOMO00000625
ACE | Drag2Death.com00000625
Team OpeL
HeroNameKillsAssistsDeathsLast hitsLevel
OpEL Biceps™00000625
i'mPOSSIBLE00000625
radioactive00000625
55500000625
Ezy Pussy!!!™00000625
Deus Vult
vs
[Adventid]
Deus Vult
HeroNameKillsAssistsDeathsLast hitsLevelNet Worth
Lucky Izya2101431839
La Di Da0002141871
Enalax12033910
要Hokage 要 望030321267
WhiteFiL00033865
[Adventid]
HeroNameKillsAssistsDeathsLast hitsLevel
-(=_=)-0001541609
Koo$ty00101468
ArtEansory00173841
[Anti].kiLLeR001841159
BibleThump00002957
Help us stay online!
Advertisement