Hello everyone seems like the code will not work like that. so I did another way that will work for everyone. I'll do the tutorial later but for people that want to try now:
1 - I will give 2 codes
2 - save these 2 different codes in 2 .ahk files
3 - the first code will be the fast loot program
4 - the second code is the file that you will use to configure your .ahk for the first time (you just need to configure it 1 time)
Fast loot script (you need to set configuration)
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ;It allows to run only one at the same time.
SetTitleMatchMode, 2 ;Matching for window title.
#ifwinactive, PLAYERUNKNOWN'S BATTLEGROUNDS ;Active only when in PUBG.
IniRead up_item_posX, config.ini, Coordinates, up_item_posX
IniRead up_item_posY, config.ini, Coordinates, up_item_posY
IniRead up2_item_posX, config.ini, Coordinates, up2_item_posX
IniRead up2_item_posY, config.ini, Coordinates, up2_item_posY
IniRead down_item_posX, config.ini, Coordinates, down_item_posX
IniRead down_item_posY, config.ini, Coordinates, down_item_posY
IniRead down2_item_posX, config.ini, Coordinates, down2_item_posX
IniRead down2_item_posY, config.ini, Coordinates, down2_item_posY
IniRead inv_posX, config.ini, Coordinates, inv_posX
IniRead inv_posY, config.ini, Coordinates, inv_posY
;#####################
;# Fast Loot #
;#####################
~V:: ; Change your hotkey here
if (isMouseShown() == true)
{
Sleep 1
MouseClickDrag, Left,up_item_posX, up_item_posY, inv_posX, inv_posY , 0
Sleep 1
MouseClickDrag, Left, up2_item_posX, up2_item_posY, inv_posX, inv_posY , 0
Sleep 1
MouseClickDrag, Left, down_item_posX, down_item_posY, inv_posX, inv_posY , 0
Sleep 1
MouseClickDrag, Left, down2_item_posX, down2_item_posY, inv_posX, inv_posY , 0
Sleep 1
}
return
isMouseShown()
{
StructSize := A_PtrSize + 16
VarSetCapacity(InfoStruct, StructSize)
NumPut(StructSize, InfoStruct)
DllCall("GetCursorInfo", UInt, &InfoStruct)
Result := NumGet(InfoStruct, 8)
if Result > 1
Return true
else
Return false
}
Configuration script
1 - run it
2 - in game press numpad 1~4 to set the position of each item in your inventory
3 - in game press numpad5 to set the position of your character head in your tab menu
4 - when you set all positions close config .ahk and just run your fast loot script, it will work 100%
Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance force ;It allows to run only one at the same time.
SetTitleMatchMode, 2 ;Matching for window title.
#ifwinactive, PLAYERUNKNOWN'S BATTLEGROUNDS ;Active only when in PUBG.
up_item_posX := 200
up_item_posY := 200
up2_item_posX := 300
up2_item_posY := 300
down_item_posX := 400
down_item_posY := 400
down2_item_posX := 500
down2_item_posY := 500
inv_posX := 600
inv_posY := 600
Loop{
ToolTip, Item 1, up_item_posX, up_item_posY
sleep 1000
ToolTip, Item 2, up2_item_posX, up2_item_posY
sleep 1000
ToolTip, Item 3, down_item_posX, down_item_posY
sleep 1000
ToolTip, Item 4, down2_item_posX, down2_item_posY
sleep 1000
ToolTip, Inventory, inv_posX, inv_posY
sleep 1000
}
*NumPad1::
MouseGetPos, xpos, ypos
up_item_posX = %xpos%
up_item_posY = %ypos%
IniWrite, %up_item_posX%, config.ini, Coordinates, up_item_posX
IniWrite, %up_item_posY%, config.ini, Coordinates, up_item_posY
ToolTip, Item 1, up_item_posX, up_item_posY
return
*NumPad2::
MouseGetPos, xpos, ypos
up2_item_posX = %xpos%
up2_item_posY = %ypos%
IniWrite, %up2_item_posX%, config.ini, Coordinates, up2_item_posX
IniWrite, %up2_item_posY%, config.ini, Coordinates, up2_item_posY
ToolTip, Item 2, up2_item_posX, up2_item_posY
return
*NumPad3::
MouseGetPos, xpos, ypos
down_item_posX = %xpos%
down_item_posY = %ypos%
IniWrite, %down_item_posX%, config.ini, Coordinates, down_item_posX
IniWrite, %down_item_posY%, config.ini, Coordinates, down_item_posY
ToolTip, Item 3, down_item_posX, down_item_posY
return
*NumPad4::
MouseGetPos, xpos, ypos
down2_item_posX = %xpos%
down2_item_posY = %ypos%
IniWrite, %down2_item_posX%, config.ini, Coordinates, down2_item_posX
IniWrite, %down2_item_posY%, config.ini, Coordinates, down2_item_posY
ToolTip, Item 4, down2_item_posX, down2_item_posY
return
*NumPad5::
MouseGetPos, xpos, ypos
inv_posX = %xpos%
inv_posY = %ypos%
IniWrite, %inv_posX%, config.ini, Coordinates, inv_posX
IniWrite, %inv_posY%, config.ini, Coordinates, inv_posY
ToolTip, Inventory, inv_posX, inv_posY
return
Quick video:
basically just put your mouse in your first item and press numpad1
put in the second item press numpad2
until numpad 4
and then use numpad5 in your character head in your tab menu
then just close the config .ahk and use the fast loot .ahk