Search found 294 matches

by Osprey
14 Aug 2018, 22:06
Forum: Tutorials
Topic: How to Make AHK Work in Most Games - The Basics
Replies: 17
Views: 32489

Re: How to Make AHK Work in Most Games - The Basics

In fullscreen DirectX games, if you try to take a screenshot or use the PixelGetColor, PixelSearch or ImageSearch commands, you may find (depending on the video card that you have) that they don't work and return only the color black or only the color white. All of those do work if the game is in wi...
by Osprey
17 Mar 2018, 17:19
Forum: Ask For Help
Topic: Trouble with Multiple Copy/Paste Function
Replies: 5
Views: 267

Re: Trouble with Multiple Copy/Paste Function

Try modifying the parameters of ClipWait. For example, try ClipWait, 2, 1. That's my only idea at the moment.
by Osprey
08 Feb 2018, 16:31
Forum: Ask For Help
Topic: How to place text cursor?
Replies: 4
Views: 164

Re: How to place text cursor?

You could automate the Find dialog, if the text viewer supports it... something like: Send, ^{home}^f ; Ctrl+Home moves the caret to the start of the document. Ctrl+F opens the Find dialog. WinWait, Find Send, Text string to find{enter}{esc}^{left} ; Enter begins the search. Esc closes the Find dial...
by Osprey
08 Feb 2018, 15:57
Forum: Ask For Help
Topic: How to place text cursor?
Replies: 4
Views: 164

Re: How to place text cursor?

You could do it by sending the left arrow key once while the text is still selected to un-select it and move the caret to the start of the line, then sending the right arrow key a number of times equal to the position that you retrieved with InStr.
by Osprey
08 Feb 2018, 15:50
Forum: Ask For Help
Topic: Trying to make advance SingleInstance force Topic is solved
Replies: 8
Views: 331

Re: Trying to make advance SingleInstance force Topic is solved

If I'm understanding your situation correctly, it's the same that I had and which I addressed with this little function: ; Check if a script of the same name is already running (from a different location) and, if so, close the older process CheckProcess() { PID := DllCall("GetCurrentProcessId") Proc...
by Osprey
08 Feb 2018, 15:27
Forum: Ask For Help
Topic: PixelSearch saying it found the right color even though it's not there
Replies: 2
Views: 101

Re: PixelSearch saying it found the right color even though it's not there

As Exaskryz suggested might be the case, your Errorlevel logic is backwards. PixelSearch returns 0 if the color is found and 1 if it was not found, so you need to do: if ErrorLevel { MsgBox, Color not found! break } else { tooltip, color currently found Sleep 500 tooltip } Note the removed exclamati...
by Osprey
05 Feb 2018, 19:18
Forum: Ask For Help
Topic: Get the key code of omen command center button Topic is solved
Replies: 10
Views: 1794

Re: Get the key code of omen command center button Topic is solved

Since it's an omen, have you tried a scan code of 666? ;)

Seriously, have you snooped around the registry yet to see if your keyboard driver has added any mappings to the registry?

https://www.experts-exchange.com/articl ... eyond.html
by Osprey
03 Feb 2018, 18:46
Forum: Ask For Help
Topic: "KeyWait" - press key valid only if ...
Replies: 3
Views: 143

Re: "KeyWait" - press key valid only if ...

I thought that you wanted KeyWait to trigger over the GUI. If you want it to trigger over the original window, I think that setting up a hotkey for "k" may be more suitable. Try this: ;loop ;{ ifwinactive ahk_group xxx { wingettitle, Light, A WinGetPos, x, y, w, h, A Gui, +Lastfound +Toolwindow ; +H...
by Osprey
03 Feb 2018, 17:54
Forum: Gaming
Topic: I need a faster alternative to MouseMove which also works relative to current position
Replies: 5
Views: 232

Re: I need a faster alternative to MouseMove which also works relative to current position

Have you tried [docs]SetDefaultMouseSpeed[/docs]? The docs say that a setting of 0 will move the mouse instantly.
by Osprey
03 Feb 2018, 16:09
Forum: Ask For Help
Topic: "KeyWait" - press key valid only if ...
Replies: 3
Views: 143

Re: "KeyWait" - press key valid only if ...

Try something like this: loop { ifwinactive ahk_group xxx { wingettitle, Light, A WinGetPos, x, y, w, h, A Gui, +Lastfound +Toolwindow iw:= w + 24 ih:= h + 24 w:= w + 42 h:= h + 42 x:= x - 2 - border_thickness k y:= y - 2 - border_thickness Gui, Color, FFFF00 Gui, -Caption WinSet, Region, 0-0 %w%-0 ...
by Osprey
03 Feb 2018, 15:09
Forum: Ask For Help
Topic: Get the key code of omen command center button Topic is solved
Replies: 10
Views: 1794

Re: Get the key code of omen command center button Topic is solved

Try the following script. It'll display the name, VK code and SC code for each key pressed. CoordMode, ToolTip, Screen CleanTimer := -3000 ; Must be a negative number (the timer will run only once) Loop, 5000 { Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), GetText Hotkey, % "~*" GetKeyNa...
by Osprey
03 Feb 2018, 04:29
Forum: Ask For Help
Topic: [Q] assignment and value
Replies: 4
Views: 170

Re: [Q] assignment and value

"^+s" is not alpha-numeric. You can see this by simplifying your code to: ProgramKey := [] ProgramKey.cmd := "^+s" temp := ProgramKey["cmd"] If temp is alnum MsgBox, That is alpha-numeric! The condition is not satisfied; whereas, if you change "^+s" to, simply, "s", it is satisfied. As for why your ...
by Osprey
03 Feb 2018, 03:49
Forum: Ask For Help
Topic: Get the current directory of the active program
Replies: 5
Views: 212

Re: Get the current directory of the active program

The first method detailed here should be something that's easily scriptable in AutoHotkey:

https://www.extendoffice.com/documents/ ... older.html
by Osprey
02 Feb 2018, 17:46
Forum: Ask For Help
Topic: Responsive GUI Topic is solved
Replies: 3
Views: 183

Re: Responsive GUI Topic is solved

Have you tried using the built-in [docs]A_ScreenWidth[/docs] and [docs]A_ScreenHeight[/docs] variables? GuiWidth := A_ScreenWidth*0.50 GuiHeight := A_ScreenHeight*0.50 Gui, New Gui, Show, W%GuiWidth% H%GuiHeight% Return GuiClose: ExitApp Return Replace "50" on each of the first two lines with the pe...
by Osprey
02 Feb 2018, 00:31
Forum: Ask For Help
Topic: get key state and wildcard Topic is solved
Replies: 2
Views: 116

Re: get key state and wildcard Topic is solved

Try putting the wildcard in the hotkey label, instead, like so:

Code: Select all

f10::
Suspend
return

*f::
  While GetKeyState("f","P")
  {
    send, {3}   
    click
    Sleep, 450
    send, {2}
    click
    Sleep, 450
  }
Return
by Osprey
31 Jan 2018, 13:26
Forum: Ask For Help
Topic: Permanent Tooltip in the Upper Right-Hand corner of screen
Replies: 9
Views: 321

Re: Permanent Tooltip in the Upper Right-Hand corner of screen

Thanks for that link, jeeswg. Osprey, I tried what you posted, and it works great on its own, but it renders the rest of my code inoperable as it is in a loop...and so is my code. Do you have any suggestions on how I would incorporate your code with mine? The script that I gave contains a loop, but ...
by Osprey
31 Jan 2018, 02:59
Forum: Ask For Help
Topic: Permanent Tooltip in the Upper Right-Hand corner of screen
Replies: 9
Views: 321

Re: Permanent Tooltip in the Upper Right-Hand corner of screen

The following will put a permanent tooltip in the upper left corner that displays keypresses: CoordMode, ToolTip, Screen Loop, 5000 { Hotkey, % "~*" GetKeyName(Format("vk{:x}", a_index - 1)), GetText Hotkey, % "~*" GetKeyName(Format("sc{:x}", a_index - 1)), GetText } ; "~" keeps the button original ...
by Osprey
29 Jan 2018, 00:27
Forum: Ask For Help
Topic: Gui Editbox does not cancel? Topic is solved
Replies: 3
Views: 117

Re: Gui Editbox does not cancel? Topic is solved

Yeah, just do:

Code: Select all

TranslatorGUIShow:
  Gui, TranslatorGUI: Show, AutoSize, TranslatorGUI
return
by Osprey
29 Jan 2018, 00:23
Forum: Ask For Help
Topic: Trigger thread as long as "key1" & "key2" were pressed within "x" time of each other?
Replies: 7
Views: 272

Re: Trigger thread as long as "key1" & "key2" were pressed within "x" time of each other?

Try this: #MaxThreadsPerHotkey 2 ~1:: If (A_PriorHotkey = "Space") and (A_TimeSincePriorHotkey < 20) Goto, MySubroutine Return ~9:: If (A_PriorHotkey = "Space") and (A_TimeSincePriorHotkey < 20) Goto, MySubroutine Return Space:: If (A_PriorHotkey = "~1") and (A_TimeSincePriorHotkey < 800) Goto, MySu...
by Osprey
28 Jan 2018, 23:24
Forum: Ask For Help
Topic: Gui Editbox does not cancel? Topic is solved
Replies: 3
Views: 117

Re: Gui Editbox does not cancel? Topic is solved

Your lines that add the edit boxes are inside of the hotkey, so new edit boxes will be added each time that you use the hotkey. If you want them added only when you start the script, move all but the Show line outside of your hotkey. #SingleInstance, force TranslatorGUI: Gui, TranslatorGUI: Add, Edi...

Go to advanced search