Code: Select all
;--------------------------------------------------------------------------------
;STANDARD BUTTONS AND FUNCTIONS
;--------------------------------------------------------------------------------
;Can change buttons in next section "FUNCTION VARIABLES AND CHOSEN BUTTONS"
;numpad1 = equip shield or weapon 2 of cursor
;numpad2 = equip armor of cursor
;numpad3 = equip boot of cursor
;numpad4 = equip ring 1 of cursor
;numpad5 = equip amulet of cursor
;numpad6 = equip ring 2 of cursor
;numpad7 = equip weapon 1 or book of cursor
;numpad8 = equip helmet of cursor
;numpad9 = equip glove of cursor
;numpad+ = equip belt of cursor
;--------------------------------------------------------------------------------
;FUNCTION VARIABLES AND CHOSEN BUTTONS
;--------------------------------------------------------------------------------
;Can put chosen button after =
key_shield_weapon2 = numpad1
key_armor = numpad2
key_boots = numpad3
key_ring1 = numpad4
key_amulet = numpad5
key_ring2 = numpad6
key_weapon1_book = numpad7
key_helm = numpad8
key_glove = numpad9
key_belt = numpadadd
;--------------------------------------------------------------------------------
;EQUIPMENT SLOTS, SCREEN POSITIONS
;--------------------------------------------------------------------------------
;Only need to change if default values don't work
;Can put chosen position after =
slot_shield_weapon2_X = 1161
slot_shield_weapon2_Y = 202
slot_armor_X = 1216
slot_armor_Y = 199
slot_boots_X = 1270
slot_boots_Y = 193
slot_ring1_X = 1157
slot_ring1_Y = 142
slot_amulet_X = 1214
slot_amulet_Y = 140
slot_ring2_X = 1269
slot_ring2_Y = 142
slot_weapon1_book_X = 1158
slot_weapon1_book_Y = 82
slot_helm_X = 1216
slot_helm_Y = 85
slot_glove_X = 1273
slot_glove_Y = 89
slot_belt_X = 1326
slot_belt_Y = 145
;--------------------------------------------------------------------------------
;SCRIPT SPEED
;--------------------------------------------------------------------------------
;Script speed moving cursor and clicking, 1000 is 1 second (mileseconds).
;Sometimes AHK scripts fails in some actions depending on the system where it works if it is too fast
;but in the case of this script for me the value 1 is good.
;Can put chosen value after =
time = 1
;--------------------------------------------------------------------------------
;SCRIPT WORKING ONLY IN THE GAME WINDOW
;--------------------------------------------------------------------------------
;Disabled by default
;Apparently the name of the game window has a version number, maybe the name will change with game update
;To enable can remove ; in the lines 102, 103, 315
;--------------------------------------------------------------------------------
;--------------------------------------------------------------------------------
pos_x = 0
pos_y = 0
SetTimer, Button_Pressed, 1
return
Button_Pressed:
;if WinActive("LOOP HERO 1.154 (win)")
;{
GetKeyState, state, %key_belt%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_belt_X%, %slot_belt_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_shield_weapon2%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_shield_weapon2_X%, %slot_shield_weapon2_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_armor%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_armor_X%, %slot_armor_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_ring1%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_ring1_X%, %slot_ring1_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_boots%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_boots_X%, %slot_boots_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_amulet%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_amulet_X%, %slot_amulet_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_ring2%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_ring2_X%, %slot_ring2_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_weapon1_book%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_weapon1_book_X%, %slot_weapon1_book_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_helm%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_helm_X%, %slot_helm_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
GetKeyState, state, %key_glove%
if state = D
{
MouseGetPos , pos_x, pos_y, , ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, %slot_glove_X%, %slot_glove_Y%, ,
sleep, %time%
send {click down}
sleep, %time%
send {click up}
sleep, %time%
MouseMove, pos_x, pos_y, ,
}
else
{}
;}
return
F10::
{
ExitApp
}