Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- ; #Warn ; Enable warnings to assist with detecting common errors.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- random, rand1, 180, 312
- random, rand2, 182, 320
- random, rand3, 280, 350
- random, rand4, 150, 222
- random, rand5, 223, 250
- Item1 = Hotkey Set 1
- Item2 = Hotkey Set 2
- Item3 = Hotkey Set 3
- AllOff = All hotkeys off
- Loop 3
- Menu, MyMenu, Add, % Item%A_Index%, HotkeySet%A_Index% ; keep this code in the "auto-execute" section
- Menu, MyMenu, Add ; adds a separator
- Menu, MyMenu, Add, %AllOff%, AllOff
- Return
- Numpad0::ExitApp
- Numpad1::Menu, MyMenu, Show
- AllOff:
- HotkeySet1:
- HotkeySet2:
- HotkeySet3:
- Loop 3
- Menu, MyMenu, Uncheck, % Item%A_Index% ; unchecks all your menus
- HotkeySet := SubStr(A_ThisLabel, 10) ; sets it to the 10th character of the label: 1, 2, 3, or blank for "AllOff"
- If HotkeySet
- Menu, MyMenu, Check, % Item%HotkeySet% ; Checks the active one
- Return
- 6::
- {
- loop
- {
- GetKeyState, state, 6, P
- if state = U ; The key has been released, so break out of the loop.
- break
- list := "rand1;rand2;rand3;rand4;rand5"
- listsize = 5
- Random, rand, 1, %listsize%
- randr = % listGet(list, rand, ";")
- If HotkeySet = 1
- Send j
- Else If HotkeySet = 2
- Send a
- Else
- Send q
- sleep (%randr%)
- ; return item at said position in said list
- listGet(list,pos=1,del=",") {
- StringSplit, item, list, %del%
- return item%pos%
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement