Page 1 of 1

Help making a script to use mouse scroll wheel for item hotbar in Grounded

Posted: 08 Jan 2022, 18:18
by trackhawk
Found a thread on steam that led me here but the solution posted was for Ark Survival Evolved. Can someone help me with this for the game Grounded?

Thanks

Re: Help making a script to use mouse scroll wheel for item hotbar in Grounded

Posted: 11 Jan 2022, 19:49
by YoucefHam
trackhawk wrote:
08 Jan 2022, 18:18
Found a thread on steam that led me here but the solution posted was for Ark Survival Evolved. Can someone help me with this for the game Grounded?
Thanks
Hi, try this

Code: Select all

#NoEnv
SendMode Input
SetWorkingDir %A_ScriptDir%
#SingleInstance force

keyi := 1
lastKey := 0

*~WheelUp::
*~WheelDown::
IfInString, A_ThisHotkey, Up
	keyi += ((keyi < 10 and keyi >= 1) ? 1 : 0)
else
	keyi -= ((keyi <= 10 and keyi > 1) ? 1 : 0)
if (lastKey = keyi)
	return
keysOn := false
SetTimer, SendKey, Off
if lastKey = keyi
	return
lastKey := keyi
keysOn := true
SetTimer, SendKey, -350
return

*~SC002::
*~SC003::
*~SC004::
*~SC005::
*~SC006::
*~SC007::
*~SC008::
*~SC009::
*~SC00A::
*~SC00B::
keyi := GetKeySC(strReplace(A_ThisHotkey,"*~","")) - 1
return

SendKey:
if !keysOn
	return
Send, % "{SC00" format("{:X}",keyi+1) " Down}"
Sleep, 61
Send, % "{SC00" format("{:X}",keyi+1) " Up}"
return