Search found 4586 matches

by evilC
18 Apr 2019, 04:45
Forum: Gaming
Topic: Issues with pixel comparing Topic is solved
Replies: 6
Views: 188

Re: Issues with pixel comparing Topic is solved

MouseX1 is never set. It looks like you intend to do a MouseGetPos, then do a PixelSearch where the mouse is, but that's not what that code does. ToolTip, click first KeyWait, LButton, D MouseGetPos, X1, Y1 PixelGetColor R1, %MouseX1%, %MouseY1% ; <-- Unset variables KeyWait, LButton, U ToolTip ret...
by evilC
16 Apr 2019, 11:55
Forum: Gaming
Topic: Issues with pixel comparing Topic is solved
Replies: 6
Views: 188

Re: Issues with pixel comparing Topic is solved

until %R1%!=%R1Check2% should be until R1 != R1Check2
by evilC
16 Apr 2019, 10:53
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 218
Views: 24223

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

when supplying values to AHI.SendMouseMoveRelative, x and y MUST be valid integers.
ie instead of supplying y="", you should supply y=0
by evilC
16 Apr 2019, 09:31
Forum: Ask For Help
Topic: Cycle Keys Topic is solved
Replies: 3
Views: 80

Re: Cycle Keys Topic is solved

num := 0 return F1:: num++ if (num > 16) num := 0 DoSend(num) return F2:: num-- if (num < 0) num := 16 DoSend(num) return DoSend(num){ pfx := "^" key := num if (num > 9){ pfx .= "+" key -= 9 } str := pfx "{Numpad" key "}" Send % str ;~ Tooltip % str }
by evilC
16 Apr 2019, 06:54
Forum: Ask For Help
Topic: idk how to get ahk to only work in one of my minecraft windows
Replies: 4
Views: 68

Re: idk how to get ahk to only work in one of my minecraft windows

Why would you change the title of the window, when you can just identify it by HWND? Run this code, hit F12 with the minecraft window active that you want the hotkey to take effect in The Up key will then open a msgbox, but only while that specific MC window is active F12:: mcHwnd := WinExist("A") r...
by evilC
16 Apr 2019, 06:50
Forum: Gaming
Topic: Issues with pixel comparing Topic is solved
Replies: 6
Views: 188

Re: Issues with pixel comparing Topic is solved

PixelGetColor defaults to BGR format, whereas you are probably using colours in RGB format.
Add the RGB parameter to PixelGetColor
by evilC
16 Apr 2019, 06:48
Forum: Ask For Help
Topic: How to make this script run faster?
Replies: 3
Views: 119

Re: How to make this script run faster?

No, but it can be made a ton shorter. #NoEnv Loop { IE.Visible := True WinActivate, ahk_class IEFrame WinWaitActive, ahk_class IEFrame WinGetTitle, WinTitle, ahk_class IEFrame wb:=pwb_Get() loaded := false While !loaded { try { if (wb.document.GetElementByID("wait") != "") loaded := true Sleep 100 L...
by evilC
16 Apr 2019, 06:42
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 218
Views: 24223

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

Also, why are you doing a stringsplit all the time? Use an array of arrays: #include Lib\AutoHotInterception.ahk global AHI := new AutoHotInterception() global mouseid := AHI.GetMouseId(HID, VID) no_pattern :={} ; cause error when using "|| a_index > active_pattern.maxindex()" a_pattern := [[10, 10]...
by evilC
16 Apr 2019, 04:13
Forum: Scripts and Functions
Topic: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!
Replies: 218
Views: 24223

Re: AutoHotInterception (AHI): Multi-Keyboard / Multi-Mouse support for AHK. Per-device blocking!

I am surprised that script works at all, as you are not supplying VID or PID on this line global mouseid := AHI.GetMouseId(HID, VID)
HID is unset
VID is unset
I have no idea why you used the variable names HID and VID instead of VID and PID
by evilC
15 Apr 2019, 11:08
Forum: Ask For Help
Topic: High keyrate results in unstable scripts
Replies: 10
Views: 206

Re: High keyrate results in unstable scripts

I am not sure if AHK is intended to work with non-standard keyrates If you want to be able to trap all key events *before* they are processed by windows, you can use AutoHotInterception (See link in signature), use SUBSCRIPTION mode. This hooks into the keyboard driver, so until you process each key...
by evilC
15 Apr 2019, 07:16
Forum: Ask For Help
Topic: An installer with UAC (Admin privileges)
Replies: 5
Views: 112

Re: An installer with UAC (Admin privileges)

Use RunAsTask to elevate your scripts to admin. You only need to accept the UAC prompt once, and then on subsequent runs it auto-elevates without UAC prompt
by evilC
15 Apr 2019, 07:13
Forum: Ask For Help
Topic: Number increase, decrease and memory retention. Topic is solved
Replies: 5
Views: 97

Re: Number increase, decrease and memory retention. Topic is solved

I take it you mean when you exit the script? Exiting just the Gui does not delete the variables
Save the variable to disk when the script ends using IniWrite, load it from disk when the script loads using IniRead
by evilC
15 Apr 2019, 07:11
Forum: Ask For Help
Topic: High keyrate results in unstable scripts
Replies: 10
Views: 206

Re: High keyrate results in unstable scripts

Why have you increased the key rate in windows? Purely to try and make your scripts work better? I would advise against that - you would be able to do what you want through AHK without having to mess with these windows settings If you have an AHK hotkey a:: and you hold a, if #MaxThreadsPerHotkey is...
by evilC
15 Apr 2019, 07:00
Forum: Ask For Help
Topic: Check Box to activate Hotkey?
Replies: 3
Views: 84

Re: Check Box to activate Hotkey?

Use "Context Sensitive Hotkeys" to turn on or off the hotkey depending on the value of the vLabel of the CheckBox Gui, Add, CheckBox, y40 x125 vCheckBoxDate gCheckBoxChanged, ; add gCheckBoxChanged to fire the label CheckBoxChanged when the control changes Gui, Show return #if CheckBoxDate ; Enable ...
by evilC
15 Apr 2019, 06:52
Forum: Ask For Help
Topic: remapped f10-to-mute key only works if I hold down another function key
Replies: 5
Views: 155

Re: remapped f10-to-mute key only works if I hold down another function key

What is the default mode for the Fn keys? ie do they send the normal key or the Fn version of the key when you do not hold Fn?

ie does the F8 key send F8 or Play/Pause when you don't hold the Fn key?
by evilC
15 Apr 2019, 06:49
Forum: Ask For Help
Topic: weird output with a window list function
Replies: 1
Views: 46

Re: weird output with a window list function

This code can potentially give misleading results wingettitle, win_title, % "ahk_id" win_id_list%A_Index% winget, win_state, MinMax, %win_title% You take a *unique* ID and convert it into a *non-unique* title. There is zero point to this. Just pass the ID to your WinGet, MinMax command winget, win_s...
by evilC
15 Apr 2019, 06:43
Forum: Gaming
Topic: AHK send wrong button
Replies: 2
Views: 159

Re: AHK send wrong button

toggle:=!toggle All your toggles should not be the same variable. If you hit Numpad4 while Numpad3 was running, it would try to stop the Numpad3 loop, thinking it was running, when it is not #MaxThreadsPerHotkey 2 this is a hash directive, and as such is not part of the flow of code. You should onl...
by evilC
15 Apr 2019, 06:35
Forum: Ask For Help
Topic: Number increase, decrease and memory retention. Topic is solved
Replies: 5
Views: 97

Re: Number increase, decrease and memory retention. Topic is solved

If you want the number to always be 6 digits, padded with zeros as appropriate, use Format()

Code: Select all

NextNumber:
    GuiControlGet,varN,,Number
    GuiControlGet,varS,,Serial
    ++varN
    varN := Format("{1:06d}", varN)
    GuiControl,,Number,% varN
    GuiControl,,Result,% varS varN
return
by evilC
15 Apr 2019, 05:53
Forum: Ask For Help
Topic: Blocking mouse movement on the button
Replies: 3
Views: 85

Re: Blocking mouse movement on the button

I took significant time to document how to use it - what about the instructions is not clear?
Besides, AHI is maybe overkill (You are installing a custom device driver), maybe windows hooks would be more appropriate?

Go to advanced search