DotA Script - Mouse Wheel

Updated Feb 4/10
- Left/Right wheel click should be fully supported.
- Removed the previous NumLockstate due to complaints from Laptop users.

Updated Dec 24/09
- Successfully tested gaming mouse buttons 1 and 2; They were successfully mapped. Left/Right wheel click may not be supported by certain mouse types.

Updated Nov. 17/09
- Due to several comments about the use of WheelRight and WheelLeft being hard to use/not well mapped, I've moved the slot that WheelLeft aligns with to the bottom Right.
- added functionality (mapped the two buttons found on gaming mice to the same ones as WheelLeft/Right for easy use).
- Set NumLock to automatically on. Without it on the script wouldn't function on some computers without keypads.
- Added a MaxHotkeysPerInterval to prevent a possible crash.
- Changed Sendmode to 'Play' for better compatability with other scripts.

Updated Aug. 18/09
- added functionality (mapped right/left wheel clicking to inventory slots mid right and bottom left)
- improved speed and reliability

Here is a handy mouse wheel script that allows use of items in your inventory slot.

Mouse Wheel Script

#ifWinActive ahk_class Warcraft III
#SingleInstance Force
Sendmode Play ; Solves some incompatability issues.
#MaxHotkeysPerInterval 200 ;; Allows 200 hotkeys to occur within 2 seconds of time. (If greater will display a warning; prevents infinite loops).

MButton::Send ^9{F1}{Numpad8}{LButton}9 ;;Clicking the mouse wheel will use your top right item.
WheelUp::Send ^9{F1}{Numpad7}{LButton}9 ;;Scroll up will use the top left item.
WheelDown::Send ^9{F1}{Numpad4}{LButton}9 ;;Scroll down will use the middle left item.
WheelLeft::Send ^9{F1}{Numpad1}{LButton}9 ;;Clicking the wheel left will use the bottom left item.
WheelRight::Send ^9{F1}{Numpad2}{LButton}9 ;;Clicking the wheel right will use the bottom right item.
XButton1::Send ^9{F1}{Numpad1}{LButton}9 ;;Clicking the first mouse button will use the bottom left item.
XButton2::Send ^9{F1}{Numpad2}{LButton}9 ;;Clicking the second mouse button will use the bottom right item.

;;  WheelLeft, WheelRight are only active if your mouse supports such actions.
;;  XButton1 and XButton2 are the buttons found on some gaming mice. They will mirror what WheelLeft and WheelRight do (easier use).
/* 
The purpose of the ^9 and 9 are to ensure that whatever unit group you had selected before using the command are still selected after. 
F1 is used to select your main hero (even if you arn't clicked upon him).
Examples: you are watching a battle and have an enemy unit clicked (watching hp), he gets below 400hp and you mouse wheel up while hovering over him. Your hero gets selected, uses the item (ex. dagon) and stays selected (as you cannot create user groups with units you don't control).
However, if you are controlling meepo you would want that all your clones stay selected after the use of mekanism.
*/

The exe to run this script is here.