Keystroke hotbar numbers using scroll wheel

Ask gaming related questions (AHK v1.1 and older)
ardeact
Posts: 2
Joined: 07 Feb 2023, 20:22

Keystroke hotbar numbers using scroll wheel

Post by ardeact » 07 Feb 2023, 20:26

Hello, I need a script that on each scroll, it goes through value range 0-9 and keystrokes them. For example, in Roblox, there are games that use a number system to select inventory, I want to be able to select them using the scroll wheel. Thanks :D

[Mod action: Moved topic to “Gaming”]

ardeact
Posts: 2
Joined: 07 Feb 2023, 20:22

Re: Keystroke hotbar numbers using scroll wheel

Post by ardeact » 07 Feb 2023, 22:12

Here's what I managed to write

Code: Select all

#Requires AutoHotkey v2.0
; WheelDown WheelUp
numvar := 0
WheelUp::
{
	global numvar += 1
	SendInput numvar
}
WheelDown::
{
	global numvar -= 1
	SendInput numvar
}
It's real ugly and I made it using the doc, but it works. I don't know how to create a toggle for it though.


[Mod edit: Added [code][/code] tags. Please use them yourself when posting code.]

off
Posts: 176
Joined: 18 Nov 2022, 21:54

Re: Keystroke hotbar numbers using scroll wheel

Post by off » 09 Feb 2023, 22:01

Hello, perhaps:
tested in notepad work perfectly
tested in keyboardchecker . com website work perfectly

Code: Select all

#Requires AutoHotkey v1.1.33
; i use v1.1.33 for easy scripting
numvar := 0
WheelUp::
{
numvar += 1
if numvar >= 10 ; if more than 9, switch back to 0
{
numvar := 0
}
Send, %numvar%
}
return

WheelDown::
{
numvar -= 1
if numvar <= -1 ; if less than 0, switch back to 9
{
numvar := 9
}
Send, %numvar%
}
return

Post Reply

Return to “Gaming Help (v1)”