; Heroes of Neverwinter - Accept Gifts.ahk ; 2011-09-01 ; Eina Aine ; GNU General Public License (GPL), Version 3, 29 June 2007 /* Compatibility ============= This script has been tested on Google Chrome 14.0.835.186 and Firefox 6.0.2. This script may need adjustment on other browsers. Rules for this script to work ============================= 1. The entire Heroes of Neverwinter game must be visible in the browser window. 2. The game must be running in windowed mode, rather than full screen mode. 3. The vertical scrollbar must be in the full up position. 4. The horizontal scrollbar must be in the full left position. 5. The browser must show only the tabs bar and the navigation bar. No other tool bars can be visible. If you do not want to follow any of these listed rules, you'll have to customize the script to your browser. */ #SingleInstance applicationTitle = Heroes of Neverwinter on Facebook setTitleMatchMode, 2 acceptGift() { ; clicks the Accept button click 375, 590 sleep 1000 ; clicks the OK button click 375, 590 sleep 1000 IfWinNotActive, %applicationTitle% { exit } } IfWinExist, %applicationTitle% { InputBox, gifts, "Gifts", "How many gifts to auto accept?" if (ErrorLevel == 0) { ; user pressed OK, rather than Cancel if gifts is number { WinActivate, %applicationTitle% Loop %gifts% { acceptGift() } } else { MsgBox, "Invalid input. Number only." } } } else { MsgBox %applicationTitle% is not the active pane in a browser! }