Using mousewheel like an adjustor

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Crazyhorse92
Posts: 5
Joined: 17 Jun 2022, 06:14

Using mousewheel like an adjustor

Post by Crazyhorse92 » 20 Mar 2023, 09:52

Howdy,
Let's say i have a simple script. Press 'a' and it sends 'b' followed by 'c'.
But i want the mousewheel to adjust the Sleep time between b and c

a::
Send, {b}
Sleep 500
Send, {c}
Return

Wheel down::
>>>Somehow increase Sleep to 600, then 700, then 800, then 900 depending on how much i rotate it
Wheel up::
>>>Somehow decrease Sleep to 500, then 400, then 300, then 200 depending on how much i rotate it

Would appreciate if someone can figure this one out. Thank you very much!


[Mod action: Topic moved from "Ask for Help (v2)" since this is v1 code.]

User avatar
mikeyww
Posts: 26931
Joined: 09 Sep 2014, 18:38

Re: Using mousewheel like an adjustor

Post by mikeyww » 20 Mar 2023, 11:36

Code: Select all

#Requires AutoHotkey v1.1.33
wait := 400
low  := 200
high := 900
incr := 100
Gosub WheelDown

WheelUp::
WheelDown::ToolTip % wait := Min(Max(wait + (InStr(A_ThisHotkey, "U") ? -incr : incr), low), high)

a::
Send b
Sleep wait
Send c
Return

Crazyhorse92
Posts: 5
Joined: 17 Jun 2022, 06:14

Re: Using mousewheel like an adjustor

Post by Crazyhorse92 » 03 Apr 2023, 09:00

Mike, it worked to perfection.
Thank you very much!

Post Reply

Return to “Ask for Help (v1)”