Search found 1429 matches

by Chunjee
Yesterday, 22:48
Forum: Ask for Help (v1)
Topic: Cannot pickup data from a file
Replies: 2
Views: 85

Re: Cannot pickup data from a file

I prefer fileRead, OutputVar, Filename just read the whole file as one long string. Skip the Text := middleman

https://www.autohotkey.com/docs/v1/lib/FileRead.htm
by Chunjee
02 May 2024, 20:22
Forum: Scripts and Functions (v1)
Topic: [Class] expect.ahk (rapid unit testing)
Replies: 23
Views: 3726

Re: [Class] expect.ahk (rapid unit testing)

That's fantastic, well done :thumbup: Would be great to post in the v2 scripts and functions A short blurb like "Inspired in part by expect.ahk (v1)" would be appreciated but not required. If you would like a more visual link this could be cool: https://img.shields.io/badge/inspired_by-expect.ahk-g...
by Chunjee
02 May 2024, 12:15
Forum: Ask for Help (v1)
Topic: Need help with a project
Replies: 4
Views: 277

Re: Need help with a project

vvdee wrote:
02 May 2024, 09:57
I would use one array otherwise you may end up juggling 300+ variables 😱🙅🚫


Additionally you can shuffle an array, and pull from the end. If a random non-repeating order is ever desired
by Chunjee
01 May 2024, 07:51
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

autohotkey has these things called function objects, you can also put those in an array and call them like so: funcObj := func("myCoolFunc") myArray := {"func1": funcObj, "func2": funcObj, "func3": funcObj} myArray["func2"].call(10) ; => 20 myCoolFunc(parameter) { msgbox, % parameter * 2 } You may f...
by Chunjee
30 Apr 2024, 09:44
Forum: Ask for Help (v1)
Topic: Get longest line's character count in multiline string Topic is solved
Replies: 5
Views: 525

Re: Get longest line's character count in multiline string Topic is solved

Hopefully this is obvious but if you just want the character count you can fit it in one line simply enough: myMultiLineStr := "hello`nworld`nfoobar" msgbox, % A.size(A.maxBy(strSplit(myMultiLineStr, "`n"), A.size)) ; => 6 https://biga-ahk.github.io/biga.ahk/#/?id=map https://biga-ahk.github.io/biga...
by Chunjee
30 Apr 2024, 09:36
Forum: Ask for Help (v1)
Topic: Get longest line's character count in multiline string Topic is solved
Replies: 5
Views: 525

Re: Get longest line's character count in multiline string Topic is solved

Just for fun:

Code: Select all

A := new biga() ; requires https://github.com/biga-ahk/biga.ahk

longestString := A.maxBy(["string1", "string12", "string123"], A.size)
msgbox, % longestString
; => "string123"

msgbox, % A.size(longestString)
; => 9
I find this very readable and portable
by Chunjee
28 Apr 2024, 23:05
Forum: Ask for Help (v1)
Topic: POST to unsigned HTTPS
Replies: 1
Views: 274

Re: POST to unsigned HTTPS

Your title says POST but the code posted is sending "GET"
by Chunjee
23 Apr 2024, 07:37
Forum: Ask for Help (v1)
Topic: Translation hotkey
Replies: 6
Views: 205

Re: Translation hotkey

I like the DeepL API. it is free if you keep your translations under {{x}} per month.


Here is a simple one I saw once for looking up singular words on Jisho.org

Code: Select all

!j::
run, %comspec% /c start https://jisho.org/search/%clipboard%
return
by Chunjee
22 Apr 2024, 15:41
Forum: Ask for Help (v1)
Topic: Easy licensing script
Replies: 3
Views: 133

Re: Easy licensing script

I'm also interested in this
by Chunjee
19 Apr 2024, 13:33
Forum: Ask for Help (v1)
Topic: How to make this script automatically activate in every 20 second? Topic is solved
Replies: 5
Views: 262

Re: How to make this script automatically activate in every 20 second? Topic is solved

zerox wrote:
17 Apr 2024, 05:15
How to make this script automatically activate in every 20 second?
A timer could be cool
by Chunjee
18 Apr 2024, 15:20
Forum: Ask for Help (v1)
Topic: V1: Reload script when Dropbox finishes syncing
Replies: 4
Views: 150

Re: V1: Reload script when Dropbox finishes syncing

One other idea is you can reload when a change is detected and static for over {{x}} seconds. It sounds like there may be more than one file involved in the sync. If not you can just reload after any file change is detected.
by Chunjee
16 Apr 2024, 11:00
Forum: Ask for Help (v1)
Topic: Trim sentences
Replies: 2
Views: 46

Re: Trim sentences

Just for fun: A := new biga() ; requires https://github.com/biga-ahk/biga.ahk str := " This is the first sentence. `n This is the second. `n Here comes the the third sentence. " str2 := A.join(A.map(strSplit(str, "`n"), A.trim), "`n") ; => "This is the first sentence.`nThis is the second.`nHere come...
by Chunjee
13 Apr 2024, 12:21
Forum: Gaming Help (v1)
Topic: click on image text
Replies: 11
Views: 417

Re: click on image text

For games you can post here: viewforum.php?f=18
by Chunjee
13 Apr 2024, 12:19
Forum: Scripts and Functions (v1)
Topic: [Class] expect.ahk (rapid unit testing)
Replies: 23
Views: 3726

Re: [Class] expect.ahk (rapid unit testing)

v1 has if var contains as standard syntax, but this has been removed in v2 - which is a shame imho. Huh did not know that was removed in v2. Obviously since it is not a function in v1 it does not fit comfortably in one line expect.true(UserInput not in yes,no) or whatever it would be. My current pl...
by Chunjee
12 Apr 2024, 15:46
Forum: Ask for Help (v1)
Topic: Is it possible to output several voices in one audio file?
Replies: 2
Views: 69

Re: Is it possible to output several voices in one audio file?

I believe the answer is yes. On cellphone at the moment will have to sit with my computer for a test and code :thumbup:

Sorry I misunderstood the question as speaking two voices at the same time. I don't know anything about file output.
by Chunjee
11 Apr 2024, 22:14
Forum: Scripts and Functions (v1)
Topic: [Class] expect.ahk (rapid unit testing)
Replies: 23
Views: 3726

Re: [Class] expect.ahk (rapid unit testing)

Yes inStr returns the location. v1 does not have a built-in 'contains' function or that would be better. I believe most examples have been switched to a perhaps clearer expect.true((1 == 1))

Additionally ahk cannot differentiate true from 1
by Chunjee
10 Apr 2024, 11:36
Forum: Scripts and Functions (v1)
Topic: [Class] expect.ahk (rapid unit testing)
Replies: 23
Views: 3726

Re: [Class] expect.ahk (rapid unit testing)

I for sure see an issue with .writeResultsToFile and that's my fault as I don't use that feature much yet. Fix should be on github hopefully today along with some tests as there are currently NONE for that method :o
by Chunjee
05 Apr 2024, 10:05
Forum: Ask for Help (v1)
Topic: Find color closest to cursor and click Topic is solved
Replies: 24
Views: 656

Re: Find color closest to cursor and click Topic is solved

You didn't use any arrays :think:


What if user wanted to find a purple pixel or a green one? Not just variations :lolno:
by Chunjee
03 Apr 2024, 15:09
Forum: Ask for Help (v1)
Topic: Find color closest to cursor and click Topic is solved
Replies: 24
Views: 656

Re: Find color closest to cursor and click Topic is solved

this is my first time hearing about matching three possible different colors.


I would use an array
ForEach() {
if match { sortClosest => click location }
}

You get the general idea

Go to advanced search