Oh derp, my bad I was just doing obj = new C(), not :=
Thanks to both of you for helping.
Search found 62 matches
- 25 Oct 2018, 13:59
- Forum: Ask for Help (v1)
- Topic: Dynamically Using a Method/Field in a Class Topic is solved
- Replies: 4
- Views: 970
- 25 Oct 2018, 13:41
- Forum: Ask for Help (v1)
- Topic: Dynamically Using a Method/Field in a Class Topic is solved
- Replies: 4
- Views: 970
Re: Dynamically Using a Method/Field in a Class Topic is solved
I'm confused. Are you saying to do something like this?
It runs now, but it doesn't do anything. It doesn't call someMethod, and doesn't change someField.
Code: Select all
var := this["some" . m]("hi")
this["some" . f] := var
- 25 Oct 2018, 12:57
- Forum: Ask for Help (v1)
- Topic: Dynamically Using a Method/Field in a Class Topic is solved
- Replies: 4
- Views: 970
Dynamically Using a Method/Field in a Class Topic is solved
Not sure if this is intentional, but you cannot do this, or at least not the way I would expect. Example below: class C { someField := "hello" test() { f := "field" m := "method" var := this.some%m%("hi") ;Error: 'Ambiguous or invalid use of "."' this.some%f% := var ;Error: 'This line does not conta...
- 16 Oct 2018, 22:35
- Forum: Ask for Help (v1)
- Topic: Copy Text via DllCall Topic is solved
- Replies: 2
- Views: 737
Re: Copy Text via DllCall Topic is solved
I had no idea Ctrl+Insert was a thing!
From what I can tell, that seems to be good enough for my uses, though I'm still curious how one would go about solving my original problem.
Thanks again :)
From what I can tell, that seems to be good enough for my uses, though I'm still curious how one would go about solving my original problem.
Thanks again :)
- 16 Oct 2018, 22:18
- Forum: Ask for Help (v1)
- Topic: only works if INPUTBOX is active Topic is solved
- Replies: 3
- Views: 960
Re: only works if INPUTBOX is active Topic is solved
For multiple InputBoxes, I would say that there are probably 2 things that are universally the same. That would be their ahk_class and ahk_exe. You can determine what those are using WinGetClass, winClass, A and WinGet, winProcessPath, ProcessPath, A respectively when the InputBox is active. You can...
- 16 Oct 2018, 22:01
- Forum: Ask for Help (v1)
- Topic: Copy Text via DllCall Topic is solved
- Replies: 2
- Views: 737
Copy Text via DllCall Topic is solved
Hi all, I would like to make a function that copies highlighted text, but cannot use ^c because that is a defined hotkey, and I don't want to trigger it. If you instead have an idea of how to do that instead, that'd be great, but keep in mind: I can't use $^c because I DO want other parts to trigger...
- 15 Oct 2018, 15:40
- Forum: Ask for Help (v1)
- Topic: Asynchronous API data obtaining
- Replies: 5
- Views: 979
Re: Asynchronous API data obtaining
I'm confused, are you saying that the curl command will crap out after 40 seconds? If so, I'm not totally sure. Looking at the documentation, [url=https://curl.haxx.se/docs/manpage.html]documentation], you could try to set a timeout with -m with some large number (assuming there is a default max), o...
- 15 Oct 2018, 13:03
- Forum: Ask for Help (v1)
- Topic: Asynchronous API data obtaining
- Replies: 5
- Views: 979
Re: Asynchronous API data obtaining
The only suggestion I can think of is using curl . You can try to run 2000 commands via loop 2000 { command := "curl " yourCommand " > " tmpFile%A_Index% Run, %ComSpec% /c %command%,, Hide } If you use Run instead of RunWait, your script can run the 2000 commands fairly quickly, and each one may tak...
- 25 Sep 2018, 14:35
- Forum: Scripts and Functions (v1)
- Topic: Greek Alphabet + Diacritics
- Replies: 3
- Views: 1204
Re: Greek Alphabet + Diacritics
παρακαλὡ!
- 25 Sep 2018, 01:30
- Forum: Scripts and Functions (v1)
- Topic: Greek Alphabet + Diacritics
- Replies: 3
- Views: 1204
Greek Alphabet + Diacritics
Here's a script I wrote a while back when I took an ancient greek class in college. It remaps the standard english keyboard to greek, as well as the ability to easily add diacritics to the vowels (type a vowel, then one of the diacritic keys). Running the script will give you info of how to use it. ...
- 25 Sep 2018, 01:01
- Forum: Scripts and Functions (v1)
- Topic: Gamma Function
- Replies: 0
- Views: 791
Gamma Function
I'm sure someone's done it already, but screw it; here you go. gamma(n) { static pi := 3.14159265358979323846 static g := 5.2421875 static coeffs := [.99999999999999709182, 57.156235665862923517, -59.597960355475491248, 14.136097974741747174, -0.49191381609762019978, .000033994649984811888699, .0000...
- 24 Sep 2018, 13:17
- Forum: Ask for Help (v1)
- Topic: Pixel search in diffeent coordinates
- Replies: 3
- Views: 1441
Re: Pixel search in diffeent coordinates
In this case, I would PixelSearch in the square, and use math on the found location to see if it's in the circle. ;update coordinates to top left of square and bottom right of square x1 := 100 y1 := 100 x2 := 200 y2 := 200 PixelSearch, x, y, %x1%, %y1%, %x2%, %y2%, 0x3A6EA5,, Fast RGB if(!ErrorLevel...
- 24 Sep 2018, 01:56
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2324
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Well, you did mention that this program is pretty laggy and requires some delays. Perhaps: ControlSend,, {Down down}, ahk_exe KeyingTool.exe sleep, 100 ControlSend,, {Down up}, ahk_exe KeyingTool.exe sleep, 100 ControlSend,, {Down down}, ahk_exe KeyingTool.exe sleep, 100 ControlSend,, {Down up}, ahk...
- 24 Sep 2018, 01:03
- Forum: Ask for Help (v1)
- Topic: clear cache in web browsers (Internet Explorer / Firefox / Chrome)
- Replies: 1
- Views: 1183
Re: clear cache in web browsers (Internet Explorer / Firefox / Chrome)
Send, ^{f5} ...In all seriousness though, the way I would consider doing this is manually deleting all of the cached files. In chrome, for example, cached files are stored in AppData\Local\Google\Chrome\User Data\Default\Cache\ After a quick google search, it looks like firefox's cache is at AppDat...
- 24 Sep 2018, 00:49
- Forum: Ask for Help (v1)
- Topic: Pixel search in diffeent coordinates
- Replies: 3
- Views: 1441
Re: Pixel search in diffeent coordinates
Since you are only checking one pixel, you could use PixelGetColor and see if any of the points are the color you are looking for CoordMode, Pixel, Window PixelGetColor, clr1, 896, 221, RGB PixelGetColor, clr2, 291, 295, RGB PixelGetColor, clr3, 450, 700, RGB PixelGetColor, clr4, 920, 300, RGB if(cl...
- 24 Sep 2018, 00:40
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2324
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Hmmm, not sure. Is the program you want to send key presses to publicly available? I can try messing around and see if I can get anything to work.
- 23 Sep 2018, 03:20
- Forum: Ask for Help (v1)
- Topic: Trigger action by tapping different keys in rapid succession
- Replies: 6
- Views: 1703
Re: Trigger action by tapping different keys in rapid succession
I would do this by setting '1' as an individual hotkey, and then look for another key press in the near future via getkeystate(). ~1:: t := A_TickCount + 200 ;adjust number to alter how quickly double tapping should occur while(getkeystate("1", "p")) {} while(A_TickCount < t) { Loop 10 { key := A_In...
- 23 Sep 2018, 03:05
- Forum: Ask for Help (v1)
- Topic: Sending keys only to a particular window, possibly unfocused Topic is solved
- Replies: 11
- Views: 2324
Re: Sending keys only to a particular window, possibly unfocused Topic is solved
Yes! There is in fact a way. Since you are pretty vague on what you are trying to accomplish, I will just direct you to the documentation for ControlSend and ControlClick. Using these, you can send key presses and mouse clicks to any window, even if it's minimized or out of focus.
- 23 Sep 2018, 02:59
- Forum: Ask for Help (v1)
- Topic: Kill a process Topic is solved
- Replies: 5
- Views: 10238
Re: Kill a process Topic is solved
I've never used Process before, so I can't tell you why it isn't working. Have you tried using WinClose instead?
Code: Select all
WinClose, ahk_pid %PID%
- 23 Sep 2018, 02:50
- Forum: Ask for Help (v1)
- Topic: Adding a "Stop" button to a function
- Replies: 2
- Views: 777
Re: Adding a "Stop" button to a function
Creating a file seems overkill, I would just set a flag, and check that in your loop
Code: Select all
Gui, Add, Button,, Start
Gui, Add, Button,, Stop
Gui, Show
return
ButtonStart:
Loop
{
tooltip, looping
if(stop)
{
ToolTip
return
}
}
return
ButtonStop:
stop := true
return