Search found 1444 matches

by iseahound
21 Jan 2024, 23:03
Forum: Wish List
Topic: A more precise sleep()
Replies: 12
Views: 843

Re: A more precise sleep()

You need to run tests without any applications in the background and unplug your laptop and enable every power-saving feature possible. Programs like VSCode and Spotify and Chrome/Firefox/Edge are setting the global timer resolution via timeBeginPeriod to 1. See: https://news.ycombinator.com/item?id...
by iseahound
21 Jan 2024, 17:48
Forum: Tutorials (v2)
Topic: How to use CapsLock as a modifier key in ahk v2
Replies: 1
Views: 1893

How to use CapsLock as a modifier key in ahk v2

There's a few variants of this code posted on this forum. Just wanted to make it easier to find for everyone. The goal is to turn CapsLock into a proper modifying key, and not do simple combos like CapsLock & q:: MsgBox . The good part about this is that the CapsLock functionality is preserved. Just...
by iseahound
20 Jan 2024, 09:52
Forum: Wish List
Topic: [Suggestion:] v in RegExMatch('x','y',&v) should return 0 or false
Replies: 5
Views: 620

Re: [Suggestion:] v in RegExMatch('x','y',&v) should return 0 or false

Completely agree at how frustrating this is. I'm just using type(c) == RegExMatchInfo for now, but in my opinion an empty array with a default of "" should fix most errors like v[1]. Also Lexikos might make it unset because that should be the default return value for v2.1
by iseahound
19 Jan 2024, 22:53
Forum: Scripts and Functions (v2)
Topic: [FUNCTION][Modified from v1.1] Base64 encode/decode a string
Replies: 8
Views: 2036

Re: [FUNCTION][Modified from v1.1] Base64 encode/decode a string

For posterity, I'll leave a copy of my Base64Encode / Base64Decode for AutoHotkey v2 (ahk v2) here: jNizM I managed to solve the issues related to determining the size of the output. Note that the Crypt functions really suck and are slow (why Microsoft?), so calling them twice doesn't do any favors....
by iseahound
19 Jan 2024, 22:45
Forum: Scripts and Functions (v2)
Topic: Collection of useful AutoHotkey v2 scripts and functions
Replies: 8
Views: 10717

Re: Collection of useful AutoHotkey v2 scripts and functions

Why did I write my own version of Base64 encode / decode when you already had one... Google search didn't manage to find your page for AutoHotkey v2.

and I noticed I commented on the thread that led me here... viewtopic.php?t=112821
by iseahound
18 Jan 2024, 12:23
Forum: Scripts and Functions (v2)
Topic: Noise.ahk by Skrommel - Prevents Sleep, Jiggler, Stay Awake
Replies: 0
Views: 539

Noise.ahk by Skrommel - Prevents Sleep, Jiggler, Stay Awake

I made some changes to Skrommel’s old Noise.ahk script. The main change was to use ControlSendText which is newer in AHK v2, and to wait for the release of modifier keys (to prevent user held modifiers from being cancelled by SendText). This class of keep my computer awake programs falls under the t...
by iseahound
17 Jan 2024, 17:35
Forum: AutoHotkey Development
Topic: What to do when "A" getting the current active window misses?
Replies: 11
Views: 1058

Re: What to do when "A" getting the current active window misses?

The main problem is that it's a categorization error. It's easy to write logic for when ahk_class notepad isn't found, but it's harder to deal with "A" . Especially since it fails very rarely, but still non-zero. Suggestions It could just fail silently, but this probably isn't the v2 way of doing th...
by iseahound
15 Jan 2024, 20:53
Forum: Scripts and Functions (v2)
Topic: Pangrams
Replies: 1
Views: 387

Re: Pangrams

Anyways feel free to add more pangrams to this list. NOTE: Similar pangrams have been selected against. So you'll find 200 UNIQUE pangrams here.
by iseahound
15 Jan 2024, 20:41
Forum: Scripts and Functions (v2)
Topic: Pangrams
Replies: 1
Views: 387

Pangrams

I happen to love pangrams, mostly because they're the best way to view all the letters of a font. Well, I don't know why myfonts.com stopped using quicky and panache pangrams in a desultory manner, but here's an equally quixotic list of pangrams d: Note the last time I searched the web for pangrams ...
by iseahound
15 Jan 2024, 20:24
Forum: Ask for Help (v2)
Topic: [v2.0.11; v2.1-alpha.8] Command Syntax doesn't work when there are brackets in the command?
Replies: 7
Views: 576

[v2.0.11; v2.1-alpha.8] Command Syntax doesn't work when there are brackets in the command?

[Moderator's note: Topic moved from Bug Reports.]
Not sure if it's a bug when the parenthesis are omitted when the function call has []

Code: Select all

a := []
a.push "test"
MsgBox a[1]

m := Map()
m['a'] := []
m['a'].push "test"
MsgBox m['a'][1]
by iseahound
14 Jan 2024, 12:57
Forum: Tutorials (v2)
Topic: Communicating between scripts (IPC, inter-process communication)
Replies: 9
Views: 1966

Re: Communicating between scripts (IPC, inter-process communication)

Great tutorial. I think this covers all of them, the advanced methods shown are very useful. This might be the first time I've seen semaphores and mutexes (done via WINAPI) in AutoHotkey. One note however: I don't believe the semaphore or mutex shares memory across scripts at all. It only manages th...
by iseahound
14 Jan 2024, 12:46
Forum: Ask for Help (v2)
Topic: How to output ico file from blob data type of sqlite database? Topic is solved
Replies: 10
Views: 522

Re: How to output ico file from blob data type of sqlite database? Topic is solved

wait, you're probably overthinking this one. There's a shortcut, because Microsoft allows you to use PNGs as ICO files. Source: https://www.autohotkey.com/boards/viewtopic.php?style=7&t=36636&p=168805 Modified: https://www.autohotkey.com/boards/viewtopic.php?p=524692 Persistent Base64PNG := ' ; Smal...
by iseahound
13 Jan 2024, 18:41
Forum: AutoHotkey Development
Topic: What to do when "A" getting the current active window misses?
Replies: 11
Views: 1058

What to do when "A" getting the current active window misses?

There's a non-zero chance that any code that uses "A" will bring up a Target not found error. It's not clear to me why it fails, seemingly randomly, but should there be a best practice or some codebase change to mitigate this error? For example, often simple code like: ; Closes the window PostMessag...
by iseahound
11 Jan 2024, 14:32
Forum: Ask for Help (v2)
Topic: Someone explain this Fibbanochi code Topic is solved
Replies: 4
Views: 429

Re: Someone explain this Fibbanochi code Topic is solved

Got it, turns out the answer was easier than I expected. Using a formally untyped lambda calculus, a one line Loop n {} can be written as: Z := f => (x => f(v => x(x)(v)))(x => f(v => x(x)(v))) L := g => y => (y > 0 ? (MsgBox(), g(y - 1)) : 0) Z(L)(10) or in a single line: (f => (x => f(v => x(x)(v)...
by iseahound
11 Jan 2024, 11:41
Forum: Ask for Help (v2)
Topic: Someone explain this Fibbanochi code Topic is solved
Replies: 4
Views: 429

Re: Someone explain this Fibbanochi code Topic is solved

I think the problem I was having was: How do I create something like:

Code: Select all

Loop 6
   MsgBox
in one line:

Code: Select all

(f := (n) => ((n < 0) || (MsgBox(n), f(n-1))))(6)
except you can't use :=.

You could use the Y or Z combinators though.

Code: Select all

Z := f => (x => f(v => x(x)(v)))(x => f(v => x(x)(v)))
by iseahound
11 Jan 2024, 11:27
Forum: Ask for Help (v2)
Topic: Someone explain this Fibbanochi code Topic is solved
Replies: 4
Views: 429

Re: Someone explain this Fibbanochi code Topic is solved

Oh yeah, I think I was playing around with the fixed point combinator (Z). It's not really meant to calculate the Fibonacci sequence, but rather demonstrate the possibility of recursion (via higher order functions (a.k.a. consumes functions and returns functions)) without relying on keywords such as...
by iseahound
10 Jan 2024, 15:41
Forum: Ask for Help (v2)
Topic: Someone explain this Fibbanochi code Topic is solved
Replies: 4
Views: 429

Someone explain this Fibbanochi code Topic is solved

#Requires AutoHotkey v2.0 global count := 0 MsgBox fib(20) fib(n) { global count F := f => x => (count++, x < 2 ? 1 : f(x - 2) + f(x - 1)) Z := f => (x => f(v => x(x)(v)))(x => f(v => x(x)(v))) return Z(F)(n) } MsgBox count I don't remember where I was going with this. This is called Combinators.ah...
by iseahound
31 Dec 2023, 11:25
Forum: Scripts and Functions (v2)
Topic: ImagePut - A core library for images in AutoHotkey (Now supports HEIC & WEBP)
Replies: 82
Views: 28458

Re: ImagePut - Image library for converting to files, streams, windows, base64, urls, cursors, screen coordinates, clipb

I'm not sure if I understand your question. I assume you're asking about JPG / PNG etc. ImagePut will choose the fastest route for conversions. In the case a JPG is input, and the output "type" supports JPG, then no decoding will be done. This is the case for "cats.jpg" → base64 string . It would no...
by iseahound
24 Dec 2023, 18:15
Forum: AutoHotkey Development
Topic: Is the "`n" option in FileAppend and FileRead confusing?
Replies: 29
Views: 4533

Re: Is the "`n" option in FileAppend and FileRead confusing?

image.png
image.png (61.06 KiB) Viewed 1411 times
by iseahound
24 Dec 2023, 00:03
Forum: Tutorials (v2)
Topic: MCode Tutorial (Compiled Code in AHK)
Replies: 16
Views: 2593

Re: MCode Tutorial (Compiled Code in AHK)

Honestly, if you want my feedback, it's too complex. (All of it). Even I don't understand the problem that is being solved. The reason for machine code (as I see it) is speed. That means assembly. We only use C because hand writing assembly is hard. So your wiki should be more focused on methods to ...

Go to advanced search