Search found 7551 matches

by Rohwedder
Today, 04:26
Forum: Ask for Help (v2)
Topic: Array v1 to v2 Topic is solved
Replies: 7
Views: 153

Re: Array v1 to v2 Topic is solved

Very good, just like with the good old v1.1!
After my first v2 attempts (I still hate the UnsetError!), I had deemed the v2 Arrays useless and only used the obviously better Map()s and Map_n()s
I was probably a bit hasty.
by Rohwedder
Today, 03:39
Forum: Ask for Help (v2)
Topic: Creating Mode Keys - Best Practice
Replies: 6
Views: 118

Re: Creating Mode Keys - Best Practice

Hallo, Your definition is not correct! single press <300 single (300 - 500) ? single hold >500 Try: #Requires AutoHotkey v2.0 q:: { ; Type Key Q Switch Pattern := Type() { Case "0":ToolTip Pattern " = quick press" Case "1":ToolTip Pattern " = single press" Case "20","21","22":ToolTip Pattern " = sin...
by Rohwedder
Yesterday, 15:35
Forum: Ask for Help (v2)
Topic: Array v1 to v2 Topic is solved
Replies: 7
Views: 153

Re: Array v1 to v2 Topic is solved

Thank you very much!
That really annoyed me. Like with a rental car. You know there's a reverse gear, just how do you put it in?
by Rohwedder
Yesterday, 12:56
Forum: Ask for Help (v1)
Topic: Need to know how to insert "["
Replies: 14
Views: 136

Re: Need to know how to insert "["

I agree with that! But unfortunately there is no VariableSend
Instead of sending to an Edit Control you could send to an InputHook(), but I was afraid that Windows might do strange things.
by Rohwedder
Yesterday, 12:38
Forum: Ask for Help (v2)
Topic: Array v1 to v2 Topic is solved
Replies: 7
Views: 153

Re: Array v1 to v2 Topic is solved

vmech What is the v2 analog to: #Requires AutoHotkey v1.1.33 Coords := {} CoordMode, Mouse, Screen RWin & LButton:: ; Click: Coordinate recording MouseGetPos, x, y Coords.Push({"x":x,"y":y}) KeyWait, LButton Return q:: ; Output of coordinates Text = For all, Coord in Coords Text .= Coord.x " > " Co...
by Rohwedder
Yesterday, 10:37
Forum: Ask for Help (v1)
Topic: Need to know how to insert "["
Replies: 14
Views: 136

Re: Need to know how to insert "["

It is easy to recognize all pressed key combinations. All currently pressed keys and buttons are displayed. A mouse wheel rotation saves it to the clipboard: #InstallKeybdHook #InstallMouseHook SetTimer, KeyCombination, 50,% ClipBoard := "" KeyCombination: IF A_TimeIdlePhysical > 100 Return KeyCombi...
by Rohwedder
Yesterday, 09:57
Forum: Ask for Help (v2)
Topic: Array v1 to v2 Topic is solved
Replies: 7
Views: 153

Re: Array v1 to v2 Topic is solved

Hallo, the v2 arrays are too cumbersome for me. I was happy when I found HelgeffegleH's Class Map_n: #Requires AutoHotkey v2.0 MyMap := Map_n() MyMap[1] := "MyText1" MyMap[2] := "MyText2" MyMap[3] := "MyText3" MsgBox MyMap[1] " > " MyMap[2] " > " MyMap[3] mn := Map_n() ; Create a new maps_n ; Store ...
by Rohwedder
Yesterday, 06:09
Forum: Ask for Help (v1)
Topic: Need to know how to insert "["
Replies: 14
Views: 136

Re: Need to know how to insert "["

This script memorizes (Array Keys) which character is written by which keys. Gui +AlwaysOnTop +HwndGUI Gui Add, Edit, vChar Gui Show SendMode, Input SetWinDelay, 0 SetBatchLines, -1 Keys := {} Loop, 0xFF IF (""<Key := GetKeyName(Format("VK{:X}", A_Index))) { ControlSend, Edit1, ^a{Bs}{%Key%}, ahk_id...
by Rohwedder
Yesterday, 04:56
Forum: Ask for Help (v1)
Topic: Need to know how to insert "["
Replies: 14
Views: 136

Re: Need to know how to insert "["

This is probably defined somewhere in the active keyboard layout. I have no idea whether Autohotkey can read this. But with the above variable InputLocaleID the script knows which keyboard layout is active and can look it up in a list (Array).
by Rohwedder
Yesterday, 04:49
Forum: Ask for Help (v1)
Topic: How Can I Have a Script Detect If a SECOND Script Is Suspended
Replies: 2
Views: 31

Re: How Can I Have a Script Detect If a SECOND Script Is Suspended

Hallo,
Do not let the Autocorrect script suspend itself, but let it suspend on/off with your main GUI script.
see https://www.autohotkey.com/docs/v1/lib/Suspend.htm#PostMessage
#2: Sends a Suspend command to another script.
Then the main GUI script knows what is going on.
by Rohwedder
Yesterday, 03:29
Forum: Ask for Help (v1)
Topic: Need to know how to insert "["
Replies: 14
Views: 136

Re: Need to know how to insert "["

Hallo, try: F1:: ControlGetFocus Focused, A ControlGet CtrlID, Hwnd,, % Focused, A ThreadID := DllCall("GetWindowThreadProcessId", "Ptr", CtrlID, "Ptr", 0) InputLocaleID := DllCall("GetKeyboardLayout", "UInt", ThreadID, "Ptr") LanguageID := Format("{:08X}", InputLocaleID & 0xFFFF) Run, http://kbdlay...
by Rohwedder
26 Mar 2024, 09:55
Forum: Ask for Help (v1)
Topic: Delete all numbers in front of a timestamp
Replies: 2
Views: 51

Re: Delete all numbers in front of a timestamp

Hallo, it would have been better if you had shown the desired result text! Try: Text = ( 1 00:00:08,929 --> 00:00:14,660 In his 1958 book Brave New World Revisited, Aldous Huxley wrote the following: 2 00:00:14,660 --> 00:00:20,118 “If the first half of the twentieth century was the era of the techn...
by Rohwedder
26 Mar 2024, 06:56
Forum: Ask for Help (v2)
Topic: Creating Mode Keys - Best Practice
Replies: 6
Views: 118

Re: Creating Mode Keys - Best Practice

Hallo, I advise every beginner to start by using less important keys than Ctrl, Shift and Alt for something like this. There are better places to learn to swim than Niagara Falls! If you absolutely must use modifier keys for something like this, then only the ones on the right, i.e. RCtrl, RShift an...
by Rohwedder
26 Mar 2024, 06:37
Forum: Gaming Help (v1)
Topic: AutoHotkey not working in a specific game
Replies: 6
Views: 7994

Re: AutoHotkey not working in a specific game

Hallo,
Mar 2022 -> Mar 2024? No hour strikes for the happy man!
But, aren't there a few Returns missing to delimit the Hotkeys?
by Rohwedder
26 Mar 2024, 06:26
Forum: Ask for Help (v2)
Topic: Disable mouse hotkeys on certain apps
Replies: 2
Views: 32

Re: Disable mouse hotkeys on certain apps

Hallo, (untested) try: #Requires AutoHotkey v2.0 ; Game window titles can be present anywhere in the window title SetTitleMatchMode 2 ; game window classess GroupAdd("Games", "ahk_class Valve001") GroupAdd("Games", "ahk_class SDL_app") ; game window titles (backup) GroupAdd("Games", "DOTA 2") GroupA...
by Rohwedder
26 Mar 2024, 04:16
Forum: Gaming Help (v1)
Topic: Counter after finishing a loop
Replies: 3
Views: 67

Re: Counter after finishing a loop

Hallo, Error: Unexpected "}" try: F5::Pause F3::ExitApp F5::MsgBox,% Info F4:: Counter := 0, Info := "", Done := "Start" Start: FormatTime, Time,% A_Now, HH:mm:ss Info .= "Counter: " ++Counter " Time: " Time " Done: " Done Loop { ; ImgSearch loop until found start button to run a set of mouse clicks...
by Rohwedder
26 Mar 2024, 02:52
Forum: Ask for Help (v1)
Topic: Extracting a specified line from a textfile
Replies: 5
Views: 91

Re: Extracting a specified line from a textfile

Hallo, for a text file the above is preferable! Otherwise: line := 3 ; Line number to extract ; Line from text: str := "Line_1`r`nLine_2`r`nLine_3`r`nLine_4`r`nLine_5`r`nLine_6`r`nLine_7`r`nLine_8`r`nLine_9" MsgBox,% RegExMatch(str, "^(.*?(\R|$)){" line "}", M)?M1:"" str := "Line_1`nLine_2`nLine_3`n...
by Rohwedder
26 Mar 2024, 01:19
Forum: Ask for Help (v1)
Topic: Run Timer
Replies: 3
Views: 64

Re: Run Timer

Hallo, try EnvAdd: #Persistent startTime := A_TickCount Gui, +AlwaysOnTop Gui, Add, Text, x20 y20 w200 h50 vRunTime, 00:00:00 Gui, Show, w240 h120, Run Time Timer SetTimer, UpdateRunTime, 1000 Return UpdateRunTime: RunTime = 20240101 ; any date you like RunTime += (A_TickCount - startTime) // 1000, ...
by Rohwedder
25 Mar 2024, 09:18
Forum: Ask for Help (v1)
Topic: Deleting a specific line with a regular expression
Replies: 9
Views: 123

Re: Deleting a specific line with a regular expression

OK!
then:

Code: Select all

I := 3
H := "Line_1`r`nLine_2`r`nLine_3_and_4`r`nLine_3_and_4`r`nLine_5`r`nLine_6`r`nLine_7`r`nLine_8`r`nLine_9"
RegExMatch(H, "(.*\R){" I "}", M)
MsgBox,% Substr(M, 1, -StrLen(M1)) StrReplace(H, M)
by Rohwedder
25 Mar 2024, 08:41
Forum: Ask for Help (v1)
Topic: Deleting a specific line with a regular expression
Replies: 9
Views: 123

Re: Deleting a specific line with a regular expression

Hallo,
or:

Code: Select all

I := 3
H := "Line_1`r`nLine_2`r`nLine_3`r`nLine_4`r`nLine_5`r`nLine_6`r`nLine_7`r`nLine_8`r`nLine_9"
RegExMatch(H, "(.*\R){" I "}", M)
MsgBox,% StrReplace(H, M1)

Go to advanced search