Search found 7672 matches

by Rohwedder
Today, 01:51
Forum: Gaming
Topic: If the game shuts down, shut down OBS too
Replies: 1
Views: 118

Re: If the game shuts down, shut down OBS too

Hallo, start Wordpad, Notepad and this script: #Requires AutoHotkey v2.0 Persistent Timer := () => !WinExist("ahk_exe wordpad.exe") And WinExist("ahk_exe notepad.exe")?WinClose():"" SetTimer Timer, 1000 ; every second If you exit Wordpad, the script also exits Notepad. Replace Wordpad with your game...
by Rohwedder
Today, 01:24
Forum: Ask for Help (v1)
Topic: need help switching keybinds
Replies: 1
Views: 86

Re: need help switching keybinds

Hallo, I interpret this as follows: If you press LShift + d, your game should only see the pressed d. Try: #Warn #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #SingleInstance Force ; Ensures only one instance of the script is running. SetBatchLines, -1 ; Set...
by Rohwedder
Today, 00:43
Forum: Ask for Help (v1)
Topic: Help executing/running a function
Replies: 1
Views: 106

Re: Help executing/running a function

Hallo, try: TeleportPosX = 1536 TeleportPosY = 39 TeleportSearchPosX = 1351 TeleportSearchPosY = 250 AreaToGoToX = 956 AreaToGoToY = 353 ^F1::GoToArea("Void Spiral", false) GoToArea(Area, AutoFarm) { Global ; <<<<<< MouseMove, TeleportPosX, TeleportPosY Click Click MouseMove, TeleportSearchPosX, Tel...
by Rohwedder
Yesterday, 03:38
Forum: Gaming Help (v1)
Topic: Hypixel Skyblock farm
Replies: 3
Views: 289

Re: Hypixel Skyblock farm

Hallo, try: x := 2, y := 3, k := 5 q:: ; Start with Key Q Loop { Loop, 3 Hold("a", x), Hold("s", y), Hold("d", x) Sleep, 1000*k } Hold(Key, Seconds) { SendEvent, {%Key% Down} Sleep, Seconds*1000 SendEvent, {%Key% Up} } ; Hold(Key, Seconds) ; { ; with AutoRepeat ; SetKeyDelay, 30 ; Loop,% Seconds*100...
by Rohwedder
Yesterday, 02:14
Forum: Ask for Help (v1)
Topic: Long press is not working Topic is solved
Replies: 72
Views: 2554

Re: Long press is not working Topic is solved

E.g.: q:: KeyWait,% Counter() ; counts every 500 ms Switch No { Case 1:MsgBox do first Task Case 2:MsgBox do second Task Case 3:MsgBox do third Task ; ... } Return !w:: KeyWait,% Counter(1000) ; counts every 1000 ms Switch No { Case 1:MsgBox do first Task Case 2:MsgBox do second Task Case 3:MsgBox d...
by Rohwedder
02 May 2024, 10:53
Forum: Ask for Help (v1)
Topic: Need help with a project
Replies: 4
Views: 282

Re: Need help with a project

Hallo,
use Arrays https://www.autohotkey.com/docs/v1/Objects.htm#Usage_Simple_Arrays

Code: Select all

Text := {} ; Array
Text.Push("A example","B example","C example","D example","E example")
F2::
Random, randNum, 1, Text.Length()
SendInput,% Text[randNum]
Return
by Rohwedder
02 May 2024, 10:27
Forum: Ask for Help (v2)
Topic: nested functions with assume-global
Replies: 3
Views: 276

Re: nested functions with assume-global

Hallo, the "assume global" mode of inner2() apparently causes it to regard the inner1() function as a global variable. Try: #Requires AutoHotkey v2.0 #Warn All, Off outer(1) ListVars outer(x) { inner1(y) { global SoundBeep(4000, 20) iTest := 1 } inner2(z) { global SoundBeep(1000, 20) Try inner1(1) }...
by Rohwedder
02 May 2024, 00:22
Forum: Ask for Help (v1)
Topic: Toggle NumLock ScrollLock & CapsLock Issue
Replies: 2
Views: 250

Re: Toggle NumLock ScrollLock & CapsLock Issue

Hallo, GetKeyState has no “F” mode! Try: TOGGLE_CapsLock: If GetKeyState("CapsLock", "T") = 1 SetCapsLockState, Off Else If GetKeyState("CapsLock", "T") = 0 SetCapsLockState, On Return RETURN TOGGLE_NumLock: If GetKeyState("NumLock", "T") = 1 SetNumLockState, Off Else If GetKeyState("NumLock", "T") ...
by Rohwedder
02 May 2024, 00:00
Forum: Gaming
Topic: tap left shift and r to spam f
Replies: 4
Views: 348

Re: tap left shift and r to spam f

Then try:

Code: Select all

#Requires AutoHotkey v2.0
<+r:: { ; LShift & r
 SetKeyDelay 50
 While GetKeyState("r", "P") && GetKeyState("Lshift", "P")
  SendEvent "{Blind}f"
}
by Rohwedder
01 May 2024, 03:01
Forum: Gaming
Topic: tap left shift and r to spam f
Replies: 4
Views: 348

Re: tap left shift and r to spam f

Hallo,
perhaps?:

Code: Select all

<+r::f
or?:

Code: Select all

#HotIf GetKeyState("LShift","P")
r::f
#HotIf
by Rohwedder
01 May 2024, 02:23
Forum: Ask for Help (v1)
Topic: Call a function whose name is stored in an associative array
Replies: 4
Views: 356

Re: Call a function whose name is stored in an associative array

Hallo.
Or, as this is the v1.1 and older forum:

Code: Select all

#Requires AutoHotkey v1.1.33
FuncNames := {MyFunc:"Func1", YourFunc:"Func2"}

FuncNames.MyFunc()
FuncNames.YourFunc()
; or
; FuncNames["MyFunc"]()
; FuncNames["YourFunc"]()

Func1() {
	MsgBox This is function 1
}

Func2() {
	MsgBox This is function 2
}
by Rohwedder
01 May 2024, 01:11
Forum: Ask for Help (v1)
Topic: Set before last window on top possible? Topic is solved
Replies: 3
Views: 286

Re: Set before last window on top possible? Topic is solved

Hallo, try: DllCall("RegisterShellHookWindow", "UInt", A_ScriptHwnd) OnMessage(DllCall("RegisterWindowMessage", "Str", "SHELLHOOK"), "WinActivated") Return q::WinActivate,% PreviousWin ; activates the previously active window WinActivated(wParam, lParam) { Global ActiveWin, PreviousWin If (wParam = ...
by Rohwedder
30 Apr 2024, 07:07
Forum: Ask for Help (v1)
Topic: Sendlevel and modifier key problem... Topic is solved
Replies: 2
Views: 218

Re: Sendlevel and modifier key problem... Topic is solved

Hallo,
try:

Code: Select all

a::send {s down}{d down}
a up::send {s up}{d up}
shift::send {s down}{d down}
shift up::send {s up}{d up}
#InputLevel 1
w::send {a down} ; hotkey 1
w up::send {a up}
q::shift ;hotkey 2 
#InputLevel 0
by Rohwedder
29 Apr 2024, 05:59
Forum: Ask for Help (v2)
Topic: Please test AHK v2 with Win11 and two monitors
Replies: 4
Views: 352

Re: Please test AHK v2 with Win11 and two monitors

Hallo, works! Test it yourself: #Requires AutoHotkey v2.0 #SingleInstance force ; skips the dialog box and replaces the old instance of the script automatically GroupAdd("Microsoft", "ahk_exe ONENOTE.EXE") ; Microsoft OneNote GroupAdd("Microsoft", "ahk_exe OUTLOOK.EXE") ; Microsoft Outlook GroupAdd(...
by Rohwedder
29 Apr 2024, 05:35
Forum: Gaming Help (v1)
Topic: Retrigger script if trigger key pressed again Topic is solved
Replies: 2
Views: 282

Re: Retrigger script if trigger key pressed again Topic is solved

Hallo,
try:

Code: Select all

e::
Send, {m Down}
SetTimer, MTimer, -1000
Return
MTimer:
Send, {m Up}
Return
by Rohwedder
29 Apr 2024, 00:30
Forum: Ask for Help (v2)
Topic: Block input
Replies: 4
Views: 342

Re: Block input

You must not have done anything wrong. According to the manual, BlockInput On/Off sometimes does not work: https://www.autohotkey.com/docs/v1/lib/BlockInput.htm#Remarks https://www.autohotkey.com/docs/v2/lib/BlockInput.htm#Remarks Note: The OnOff and SendMouse modes might have no effect if UAC is en...
by Rohwedder
28 Apr 2024, 10:24
Forum: Gaming
Topic: Change left clicks to right clicks at screen border
Replies: 6
Views: 321

Re: Change left clicks to right clicks at screen border

Perhaps?: #Requires AutoHotkey v2.0 SetTimer TEdge, 200 #HotIf Edge LButton::RButton #HotIf TEdge() { Global Edge InstallMouseHook() CoordMode("Mouse", "Screen"), MouseGetPos(&posX, &posY) IF (!Edge := posX < 5 or posY < 5 or posX > 3835 or posY > 2155) And GetKeyState("RButton") And !GetKeyState("R...
by Rohwedder
27 Apr 2024, 09:02
Forum: Gaming
Topic: Change left clicks to right clicks at screen border
Replies: 6
Views: 321

Re: Change left clicks to right clicks at screen border

Then perhaps?:

Code: Select all

#Requires AutoHotkey v2.0
SetTimer TEdge, 200
~*LButton Up::Click("Up Right")
#HotIf Edge
*LButton::Click("Down Right")
#HotIf
TEdge() {
	Global Edge
	CoordMode("Mouse", "Screen"), MouseGetPos(&posX, &posY)
	Edge := posX < 5 or posY < 5 or posX > 3835 or posY > 2155
}
by Rohwedder
26 Apr 2024, 10:31
Forum: Gaming
Topic: Change left clicks to right clicks at screen border
Replies: 6
Views: 321

Re: Change left clicks to right clicks at screen border

Hallo,
try:

Code: Select all

#Requires AutoHotkey v2.0
SetTimer TEdge, 200
#HotIf Edge
LButton::RButton
#HotIf
TEdge() {
	Global Edge
	CoordMode("Mouse", "Screen"), MouseGetPos(&posX, &posY)
	Edge := posX < 5 or posY < 5 or posX > 3835 or posY > 2155
} 
by Rohwedder
26 Apr 2024, 02:16
Forum: Ask for Help (v2)
Topic: Block input
Replies: 4
Views: 342

Re: Block input

Hallo,
try (not tested with MMO mouse):

Code: Select all

#Requires AutoHotkey v1.1.33
+F23 Up::BlockInput,% (Block:=!Block)?"On":"Off"
or:

Code: Select all

#Requires AutoHotkey v2.0
+F23 Up:: {
	Static Block := False
	BlockInput (Block:=!Block)
}
Such a big mouse with 12 side keys should better be called a rat.

Go to advanced search