Code:
#NoEnv
#SingleInstance force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetKeyDelay 0
SetMouseDelay 0
SetTitleMatchMode 2
x1=1650
y=900 ;edit these two values using window spy. These work for maximized (not fullscreen) on 1920x1080p screen
Suspend on
GroupAdd rotmg, Realm of the Mad God
GroupAdd rotmg, realmofthemadgod
GroupAdd rotmg, AGCLoader
GroupAdd rotmg, Play Realm of the Mad God
GroupAdd rotmg, SwiffOutRunner
GroupAdd rotmg, Adobe Flash Player 10
GroupAdd rotmg, Adobe Flash Player 11
GroupAdd rotmg, Adobe Flash Player 12
GroupAdd rotmg, fla
WinNotActive()
WinActive()
{
Suspend Off
WinWaitNotActive ahk_group rotmg
{
WinNotActive()
}
}
WinNotActive()
{
Suspend on
WinWaitActive ahk_group rotmg
{
WinActive()
}
}
E::
MouseGetPos, xpos, ypos
Send {SHIFT down}
Click, 1655, 910, 2
Send {SHIFT up}
MouseMove, %xpos%, %ypos%
Return
;fantastically useful for eating drops such as mana/hp or even pot drops if you're maxing anyway
#MaxThreadsPerHotkey 4
Q::
if qpress > 0
{
qpress += 1
return
}
qpress = 1
SetTimer, KeyWinC, 20
return
#MaxThreadsPerHotkey 1
KeyWinC:
SetTimer, KeyWinC, off
MouseGetPos, xpos, ypos
while qpress > 0 {
x:=x1+75*(A_Index-1) ;75 works for my resolution, change to width of slot on yours.
Click, %x%, %y%, 2
Sleep, 350 ;;You may want to adjust the sleep time based on lag. I find going shorter makes it skip items
qpress:= qpress-1
}
MouseMove, %xpos%, %ypos%
qpress = 0
return
;;multipress for multiple slots.