Search found 671 matches

by Chunjee
21 Sep 2020, 11:01
Forum: Scripts and Functions
Topic: [Class] string-similarity.ahk
Replies: 22
Views: 4648

Re: [Class] string-similarity.ahk

npm and github are both inaccessible while offline. node_modules is just a the path npm copies packages to. #Include it however you would normally when manually downloading from github. The path location is up to the user at that point; AHK has some automatic places it looks for libraries if one wis...
by Chunjee
21 Sep 2020, 08:30
Forum: Ask For Help
Topic: script skips every second item in for loop
Replies: 5
Views: 81

Re: script skips every second item in in for loop

still scratching my head over the goal of loopcount += 0
by Chunjee
21 Sep 2020, 08:13
Forum: Ask For Help
Topic: Meanwhile function
Replies: 2
Views: 62

Re: Meanwhile function

by Chunjee
20 Sep 2020, 19:49
Forum: Scripts and Functions
Topic: [Class] string-similarity.ahk
Replies: 22
Views: 4648

Re: [Class] string-similarity.ahk

The use of "API" in the documentation is not meant as http API; may update that to "Usage" or something.

This is usable offline.
by Chunjee
19 Sep 2020, 15:28
Forum: Ask For Help
Topic: Press enter at specific time
Replies: 2
Views: 44

Re: Press enter at specific time

I think a timer that performs 1 check every second would not be too taxing.

Probably the most efficient is to use windows scheduler to launch your script at the exact time you want, depending on how sensitive the time window is because it will take a few moments to launch a script from scratch.
by Chunjee
19 Sep 2020, 03:16
Forum: Ask For Help
Topic: Press key at exactly 20:00
Replies: 8
Views: 199

Re: Press key at exactly 20:00

I think a timer would be more efficient and if you put it every 1 min it can't miss the time.
by Chunjee
19 Sep 2020, 02:52
Forum: Ask For Help
Topic: Which AHK files to transfer?
Replies: 3
Views: 62

Re: Which AHK files to transfer?

yes the files
by Chunjee
19 Sep 2020, 02:39
Forum: Ask For Help
Topic: Change string letters Topic is solved
Replies: 6
Views: 110

Re: Change string letters Topic is solved

To see if I know how switches work I did it again with a switch but since ahk isn't case sensitive it requires StringCaseSense, On to differentiate between "a" and "A" StringCaseSense, On msgbox, % myChangerFunction("2A4") ; => "4Z9" msgbox, % myChangerFunction("Aa24") ; => "Zk49" myChangerFunction(...
by Chunjee
18 Sep 2020, 06:25
Forum: Ask For Help
Topic: Change string letters Topic is solved
Replies: 6
Views: 110

Re: Change string letters Topic is solved

for example: msgbox, % myChangerFunction("2A4") ; => "4Z9" msgbox, % myChangerFunction("Aa24") ; => "Zk49" myChangerFunction(param_input) { charArray := strSplit(param_input) outString := "" for _, char in charArray { if (char == 2) { outString .= 4 continue } if (char == "A") { outString .= "Z" con...
by Chunjee
18 Sep 2020, 06:15
Forum: Ask For Help
Topic: Change string letters Topic is solved
Replies: 6
Views: 110

Re: Change string letters Topic is solved

I would make a function that performs the changes on a per character level, then perform on each character (position in the string) exactly once.
by Chunjee
15 Sep 2020, 09:44
Forum: Ask For Help
Topic: Array for mouse coordinates.
Replies: 8
Views: 212

Re: Array for mouse coordinates.

Incase needed; here is how to create objects and push them onto an array; in this case when an imagesearch successfully finds an x and y to add

Code: Select all

allCoords := []

ImageSearch, x, y, 100, 100, 900, 900, % A_ScriptDir "\imgage.png"
if (x) {
	obj := {}
	obj.x := x
	obj.y := y
	allCoords.push(obj)
}
by Chunjee
15 Sep 2020, 05:48
Forum: Ask For Help
Topic: Array for mouse coordinates.
Replies: 8
Views: 212

Re: Array for mouse coordinates.

how about saving each element as an object with x and y properties? I do this often:

Code: Select all

allCoords := [{x:200, y:100}, {x:1000, y:800}]

for _, obj in allCoords {
	msgbox, % obj.x " and " obj.y
}
by Chunjee
07 Sep 2020, 23:52
Forum: Ask For Help
Topic: Is there an equivalent of InStr() in array
Replies: 4
Views: 136

Re: Is there an equivalent of InStr() in array

https://biga-ahk.github.io/biga.ahk/#/?id=includes works on arrays, objects, and strings A.includes([1, 2, 3], 1) ; => true A.includes({ "a": 1, "b": 2 }, 1) ; => true A.includes("InStr", "Str") ; => true https://biga-ahk.github.io/biga.ahk/#/?id=indexof retrns the location in the array the needle i...
by Chunjee
07 Sep 2020, 11:57
Forum: Ask For Help
Topic: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved
Replies: 10
Views: 124

Re: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved

this thread is not about personal preferences. I'm just looking for an example that will correctly illustrate what JimPerry talked about. So you just want a function that is more complex than isBigger() ? How about a function that checks 3 or 4 conditions? return (device.countryOfOrigin == "USA" &&...
by Chunjee
07 Sep 2020, 10:52
Forum: Ask For Help
Topic: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved
Replies: 10
Views: 124

Re: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved

I think the there is an argument that yourself in the future should also be considered another person.

https://twitter.com/_ericelliott/status/668459407987052544
Program readability is much more important than program writability. Be kind to your future self, and your team.
by Chunjee
07 Sep 2020, 10:50
Forum: Ask For Help
Topic: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved
Replies: 10
Views: 124

Re: Returning Bools as literal expressions. Could you show a good use-case for it? Topic is solved

Return True and Return False seems way easier to read so I'll say it's almost always justified if the code needs to be maintained by more than one person.
by Chunjee
07 Sep 2020, 05:07
Forum: Ask For Help
Topic: Problem referencing a class variable including another variable.
Replies: 13
Views: 749

Re: Problem referencing a class variable including another variable.

Why can't I click the object without this line? ob[A1] := {} ;Why it is necessary ob := {} A1 := "A_S" ob[A1] := {} ;Why it is necessary ob[A1].A1 := "try" ;It should have worked without the above line. MsgBox % ob[A1].A1 return The reason is you can't start assigning property values to something t...
by Chunjee
06 Sep 2020, 10:34
Forum: Ask For Help
Topic: Is it possible to send a string of numbers between 0000 and 9999 but not have the random string repeated?
Replies: 5
Views: 98

Re: Is it possible to send a string of numbers between 0000 and 9999 but not have the random string repeated?

You can also generate 0000 through 9999 (or text) into an array; then pull them out at random, the number will not be repeated as each is unique and only in the array. Of course this is assuming you want to send them all, otherwise there is a point at which generating at random would be more efficie...
by Chunjee
04 Sep 2020, 01:48
Forum: Ask For Help
Topic: AutoHotkey Tutoring Request? $40/hour session
Replies: 3
Views: 119

Re: AutoHotkey Tutoring Request? $40/hour session

I cannot cover everything you need in one hour.
by Chunjee
03 Sep 2020, 10:15
Forum: Scripts and Functions
Topic: [Class] permutations.ahk
Replies: 6
Views: 460

Re: [Class] permutations.ahk

Not sure how to better explain this in the readme but it needs to happen. "%A_ScriptDir%\node_modules" is just a directory packages are sent to when using the package manager. If you are manually downloading the library, you can put export.ahk anywhere AHK uses naturally ( https://www.autohotkey.com...

Go to advanced search