Require for help to make a spam script when the key is pressed
Require for help to make a spam script when the key is pressed
Hello guys, can anyone tell me how to make this seript?
The thing I want to do is when u hold mouse4, it automatically starts to spam numpad4 and i can change the hotkey speed time
Hope u can help me )
The thing I want to do is when u hold mouse4, it automatically starts to spam numpad4 and i can change the hotkey speed time
Hope u can help me )
Last edited by gregster on 13 Aug 2022, 11:56, edited 1 time in total.
Reason: Thank you for using a codebox, but those boxes should be put around code, if code is present, not around normal text.
Reason: Thank you for using a codebox, but those boxes should be put around code, if code is present, not around normal text.
Re: Require for help to make a spam script when the key is pressed
Welcome to this AutoHotkey forum!
Code: Select all
delay = 25
XButton1::
SetKeyDelay, delay
While GetKeyState("XButton1", "P")
Send {Numpad4}
Return
Re: Require for help to make a spam script when the key is pressed
thanks for your help! but how can i change numpad4 to my keyboard right number 4?mikeyww wrote: ↑13 Aug 2022, 12:33Welcome to this AutoHotkey forum!
Code: Select all
delay = 25 XButton1:: SetKeyDelay, delay While GetKeyState("XButton1", "P") Send {Numpad4} Return
Re: Require for help to make a spam script when the key is pressed
It should be the same, but here are the key names. https://www.autohotkey.com/docs/commands/Send.htm#keynames
Re: Require for help to make a spam script when the key is pressed
doesn't work for me do u have way to get keyboard right numpad 4 value?mikeyww wrote: ↑13 Aug 2022, 13:00It should be the same, but here are the key names. https://www.autohotkey.com/docs/commands/Send.htm#keynames
Re: Require for help to make a spam script when the key is pressed
That is the right (correct) key name. Perhaps what you need is NumpadLeft.
Re: Require for help to make a spam script when the key is pressed
What do you mean by “right numpad4”? Do you mean you want it to press the right arrow key followed by the Numpad4 key, like below?
Code: Select all
XButton1::Send, {Right}{Numpad4}
Re: Require for help to make a spam script when the key is pressed
i mean when i press mouse4 it will spam numpad4 key (keyboard right number 4)boiler wrote: ↑14 Aug 2022, 03:12What do you mean by “right numpad4”? Do you mean you want it to press the right arrow key followed by the Numpad4 key, like below?Code: Select all
XButton1::Send, {Right}{Numpad4}
Re: Require for help to make a spam script when the key is pressed
When you tested my script in Notepad, what did it do? A description beyond "doesn't work for me" would be useful.
Re: Require for help to make a spam script when the key is pressed
You might want to check the scan code. You could then use it in your Send command. Some of the forum posts about multiple input devices may also help you.
Re: Require for help to make a spam script when the key is pressed
EDIT: More of the same....
Code: Select all
/* Scan code ----------------------------------------------------
This script gets a scan code from a key.
It copies the corresponding Send command to the clipboard.
By mikeyww on 14 August 2022 • For AutoHotkey 1.1.34.03
https://www.autohotkey.com/boards/viewtopic.php?p=477399#p477399
-----------------------------------------------------------------
*/
#InstallKeybdHook
Menu, main, Add, Exit, GuiEscape
Menu, main, Add, List
Menu, main, Add, KeyHistory, History
Menu, main, Add, About
Gui, +AlwaysOnTop
Gui, Font, s10
Gui, Menu, main
Gui, Add, Text , w230 , Press a key.
Gui, Add, Hotkey, wp vhk gGet
Gui, Add, Text , wp y+20, Scan code:
Gui, Add, Edit , wp vsc ReadOnly
Gui, Add, Edit , wp vsc2 ReadOnly
Gui, Add, Text , wp y+20, Send command:
Gui, Add, Edit , wp vcmd ReadOnly
Gui, Show,, Scan code
Return
History:
KeyHistory
Return
Get:
Gui, Submit, NoHide
GuiControl,, sc , % sc := Format("{:03X}", GetKeySC(hk))
GuiControl,, sc2, % sc2 := "SC" sc
GuiControl,, cmd, % Clipboard := "Send {" sc2 "}"
Return
List:
FileRecycle, % out := A_ScriptDir "\scanCodes.txt"
Loop, 0xFF {
n := 0x100 - A_Index
vk := Format("{:02X}", n)
key := "VK" vk
sc := GetKeySC(key)
name := GetKeyName(key)
(name != "") && list .= Format("{:03} {} {:03X} {}", n, vk, sc, name) "`n"
}
Sort, list
FileAppend, % Trim("N VK SC Key`n--- -- --- ------------`n" list, "`n"), %out%
Run, %out%
Return
About:
MsgBox, 64, About,
(
This script gets a scan code from a key.
It copies the corresponding Send command to the clipboard.
By mikeyww on 14 August 2022 • For AutoHotkey 1.1.34.03
https://www.autohotkey.com/boards/viewtopic.php?p=477399#p477399
Press CTRL-C to copy this box's text to the Windows clipboard.
)
Return
GuiClose:
GuiEscape:
ExitApp
Last edited by mikeyww on 14 Aug 2022, 08:03, edited 9 times in total.
Re: Require for help to make a spam script when the key is pressed
So much universe, and so little time. GNU Sir Terry.
Re: Require for help to make a spam script when the key is pressed
Hallo,
this script viewtopic.php?f=76&t=107250
is only the beginning of SKAN's old, but very interesting topic:
https://www.autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/
this script viewtopic.php?f=76&t=107250
is only the beginning of SKAN's old, but very interesting topic:
https://www.autohotkey.com/board/topic/21105-crazy-scripting-scriptlet-to-find-scancode-of-a-key/
Re: Require for help to make a spam script when the key is pressed
What was the key name?