Search found 4124 matches

by swagfag
14 Dec 2020, 03:00
Forum: AutoHotkey v2 Development
Topic: [v2.122] Class.New() memory leak Topic is solved
Replies: 2
Views: 273

Re: [v2.122] Class.New() memory leak Topic is solved

im not convinced it's the .New() thats causing the supposed leaks. this script declares a bunch of global(but this probably doesnt matter) variables. they have to be stored somewhere, which takes up some bit of space. im not sure whether theres any kind of mechanism built into ahk to prune blanked-o...
by swagfag
14 Dec 2020, 02:46
Forum: Ask For Help
Topic: Safe to link two objects together? Topic is solved
Replies: 2
Views: 90

Re: Safe to link two objects together? Topic is solved

If both objects are created and linked inside of a function as local variables, will both objects be released when it exits while still linked together this way? no they wont be, and if u for some reason lose ur only handle to those objects, u will have leaked them. there is more(although not much)...
by swagfag
11 Dec 2020, 08:13
Forum: Ask For Help
Topic: Sending class members to functions?
Replies: 4
Views: 113

Re: Sending class members to functions?

its something specific to ahk in general(and v2, hopefully, only for the time being) object properties cannot be the target of OutputVar function(command) parameters(fails silently in v1; u get an error in v2) workarounds are: introduce a method that queries the x/y and assigns them to the propertie...
by swagfag
08 Dec 2020, 06:38
Forum: AutoHotkey v2 Help
Topic: Working directory for Loop Files?
Replies: 1
Views: 455

Re: Working directory for Loop Files?

it uses whatever directory was the default one prior to the loop starting. basically it takes a snapshot, it doesnt matter what u set the default to afterwards
by swagfag
07 Dec 2020, 03:06
Forum: AutoHotkey v2 Help
Topic: Is empty return still required in V2? Topic is solved
Replies: 1
Views: 665

Re: Is empty return still required in V2? Topic is solved

its not required. v2 hotkeys are now entirely based on functions instead of labels. a function whose scope ends implicitly returns an empty string. single line hotkeys implicitly return(same as in v1)
by swagfag
06 Dec 2020, 03:25
Forum: AutoHotkey v2 Help
Topic: GDI+ MeasureString function not working in v2-alpha
Replies: 3
Views: 896

Re: GDI+ MeasureString function not working in v2-alpha

Ptr := A_PtrSize ? "UPtr" : "UInt" not needed, replace all ptr types with 'Ptr' declare library functions force- local or declare their variables local , Ptr, StrPtr(sString) this could probably just be 'Str', sString, but i cant check for sure ObjPtr(RC) returns the address of where the AHK object...
by swagfag
03 Dec 2020, 04:58
Forum: AutoHotkey v2 Help
Topic: Create nested class instance from variable Topic is solved
Replies: 5
Views: 693

Re: Create nested class instance from variable Topic is solved

C is just a variable name i chose cause i couldnt come up with anything better. u should probably rename it to something more meaningful. it doesnt refer to the class class c {} (in ur code). Where can I find documentation about this? Don*t have even an idea where to search for ... u cant search fo...
by swagfag
02 Dec 2020, 07:32
Forum: AutoHotkey v2 Help
Topic: Create nested class instance from variable Topic is solved
Replies: 5
Views: 693

Re: Create nested class instance from variable Topic is solved

u have to parse the string and iterate through the classes until u get to the one u wish to new up #Requires AutoHotkey v2.0-a122-f595abc2 class b { class c {} } cn := "b.c" o4 := newFromString(cn) newFromString(str, Args*) { ClassNames := StrSplit(str, '.') C := %ClassNames.RemoveAt(1)% for name in...
by swagfag
01 Dec 2020, 17:58
Forum: Gaming
Topic: Finding centre of an object
Replies: 3
Views: 850

Re: Finding centre of an object

is it possible this, is it possible that. many things are possible. and many are not. depending on the degree of expertise and all. what ure describing is possible. is it possible out of the box? no, ull have to implement the algorithms that make it possible urself. i dont know why u would want to w...
by swagfag
01 Dec 2020, 11:49
Forum: Gaming
Topic: Finding centre of an object
Replies: 3
Views: 850

Re: Finding centre of an object

with opencv, first u isolate the red channel(or whichever one gives u the most consistent outline), then u clean it up with some morphological transformations, blurs/sharpens if need be, then u make a cv contour out of it. divide its moments to obtain the centroid(if thats what u meant by "center". ...
by swagfag
01 Dec 2020, 08:53
Forum: Ask For Help
Topic: Hardware for data crunching and large arrays
Replies: 2
Views: 192

Re: Hardware for data crunching and large arrays

but if u do want to throw hardware at ahk in particular, get the one with the highest sustained single core clock count this will net u virtually no gains whatsoever in comparison with improving ur number crunching algorithms or simply rewriting the logic in native code. u should probably just do th...
by swagfag
01 Dec 2020, 05:49
Forum: Ask For Help
Topic: Closing File Objects on the Object Topic is solved
Replies: 1
Views: 146

Re: Closing File Objects on the Object Topic is solved

its not needed, releasing the last reference to a FileObject closes it automatically

FO := is a syntax error though
by swagfag
30 Nov 2020, 18:41
Forum: Ask For Help
Topic: Excess of Goto to the same label?
Replies: 5
Views: 897

Re: Excess of Goto to the same label?

ive explained the nature of the error already: firing up too many pseudothreads without allowing them to finish. u have a menu action button that clears a flag( condition ) and a MsgBox confirmation button that sets it. the flag is evaluated at the very beginning of each outer while loop iteration( ...
by swagfag
30 Nov 2020, 16:50
Forum: AutoHotkey v2 Help
Topic: Conditional Hotkeys without labels? Topic is solved
Replies: 5
Views: 879

Re: Conditional Hotkeys without labels? Topic is solved

#Requires AutoHotkey v2.0-a122-f595abc2 MySimpleHotkey(hotkeyTrigger, whatToSend) { MyCustomSendFunc(ThisHotkey) { ; hotkey callbacks require at least one argument Send(whatToSend) } Hotkey(hotkeyTrigger, 'MyCustomSendFunc') } HotIfWinActive "ahk_class Notepad" MySimpleHotkey "^!c", "^c" ; sends CT...
by swagfag
30 Nov 2020, 16:26
Forum: Ask For Help
Topic: Excess of Goto to the same label?
Replies: 5
Views: 897

Re: Excess of Goto to the same label?

If this directive is unspecified in the script, it will behave as though set to 10 . ur outer while loop doesnt have a terminating condition(the variable i is never touched). when u press the "Start" button and then confirm the MsgBox, the subroutine StartNewCount: is launched in a new pseudothread...
by swagfag
30 Nov 2020, 05:20
Forum: Ask For Help
Topic: How to pass a function like WinActivate as an argument to another function?
Replies: 2
Views: 99

Re: How to pass a function like WinActivate as an argument to another function?

if were talking ahk v1, there are no functions called WinActivate and WinActivateBottom. those are commands. to pass them as arguments to other functions, ull have to write function wrappers for them on ur own, then pass the name of the function wrapper(or a Func() reference) and invoke it as seen i...
by swagfag
25 Nov 2020, 05:21
Forum: General Discussion
Topic: Common Scripts Sharing Method
Replies: 2
Views: 473

Re: Common Scripts Sharing Method

if u got scripts u wanna share, just share them. it doesnt matter whether u do it on the forums, github or someplace else(though a git repo is preferable). if theyre good, people are bound to find a use for them
by swagfag
24 Nov 2020, 11:47
Forum: Suggestions on documentation improvements
Topic: IniRead suggestion
Replies: 2
Views: 399

Re: IniRead suggestion

this has already been documented https://www.autohotkey.com/docs/commands/IniRead.htm#Remarks Unicode: IniRead and IniWrite rely on the external functions GetPrivateProfileString and WritePrivateProfileString to read and write values. These functions support Unicode only in UTF-16 files; all other f...
by swagfag
24 Nov 2020, 10:07
Forum: AutoHotkey v2 Help
Topic: VarSetCapacity to BufferAlloc Topic is solved
Replies: 3
Views: 281

Re: VarSetCapacity to BufferAlloc Topic is solved

Sometimes I can't pass VarSetCapacity to BufferAlloc, when it is a string. there isnt a VarSetCapacity() in v2(anymore), so ur "sometimes being unable to pass it to BufferAlloc() , when it is a string" is a sentence that makes literally no sense at all. local char := ( a_isunicode ? "W" : "A" ) hav...
by swagfag
24 Nov 2020, 09:56
Forum: Ask For Help
Topic: ImageMagick - MagickCore C API - ReadImage() issue
Replies: 1
Views: 85

Re: ImageMagick - MagickCore C API - ReadImage() issue

i cant be bothered researching this api, but if ur comments are correct, some of ur dllcall definitions arent, eg: ; ImageInfo *CloneImageInfo(const ImageInfo *image_info) DllCall("CORE_RL_MagickCore_.dll\CloneImageInfo", "Ptr") invoking undefined behavior by providing an incorrect number of functio...

Go to advanced search