Search found 6 matches
- 03 Feb 2024, 07:32
- Forum: Ask for Help (v2)
- Topic: Including and running other ahk files based on active window
- Replies: 5
- Views: 392
Re: Including and running other ahk files based on active window
Thanks you, I came up with a concept that works quite well. Using #Include to separate all the profile files and in those use #HotIf for new/overriding global keybinds and in the case of programs requiring more complex code I moved most of that into a separate class for each profile where window det...
- 02 Feb 2024, 06:40
- Forum: Ask for Help (v2)
- Topic: Call function from class instance variable
- Replies: 4
- Views: 329
Re: Call function from class instance variable
Thanks, as i wrote above I figured that one out for he most part.
Do you have any idea how I can assign a code-block including control structures (if, loops, etc) like in my 2nd post as an anonymous function to a variable?
Do you have any idea how I can assign a code-block including control structures (if, loops, etc) like in my 2nd post as an anonymous function to a variable?
- 01 Feb 2024, 19:09
- Forum: Ask for Help (v2)
- Topic: Including and running other ahk files based on active window
- Replies: 5
- Views: 392
Re: Including and running other ahk files based on active window
Thanks, already testing inside a single file, but for the final thing that would be way too confusing. I already have a ton of seperate scripts (most AHK 1,which I'm converting at the moment), some quite complex with ImageSearch and special actions depending on what is rendered on the screen. Still ...
- 01 Feb 2024, 18:57
- Forum: Ask for Help (v2)
- Topic: Call function from class instance variable
- Replies: 4
- Views: 329
Re: Call function from class instance variable
Ok, I figured that out, I have to pass any parameter x := (_) => MsgBox("x") , then it works. But how can I define a code block in that format? I can do multiple simple statements with x := (_) => ( MsgBox("x") MsgBox("x") ) but nothing with control structures, like e.g. x := (_) => { MsgBox("x") if...
- 01 Feb 2024, 17:50
- Forum: Ask for Help (v2)
- Topic: Call function from class instance variable
- Replies: 4
- Views: 329
Call function from class instance variable
How can I call a function stored inside a class instance variable? class TestClass { x := () => MsgBox("x") y := "y" z { get { return this.x } set { this.x := value } } f() { this.x() } } a := () => MsgBox("a") a() test := TestClass() ;OK MsgBox(test.y) ;OK test.x() ;Error: Too many parameters passe...
- 01 Feb 2024, 16:24
- Forum: Ask for Help (v2)
- Topic: Including and running other ahk files based on active window
- Replies: 5
- Views: 392
Including and running other ahk files based on active window
Hello, I have a lot of ahk scripts for different games and programs, and I want to make an automatic profile switcher that includes those scripts based on which window is active. Tried HotIfWinActive, #HotIf, etc. in combination with #Include, but it doesn't really work out. Most of the files are si...