Search found 2521 matches

by swagfag
Yesterday, 21:23
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

no, i just assumed. lo and behold my assumption was correct, turns out. strings are slow, yes? #NoEnv #SingleInstance Force #Warn ClassOverwrite SetBatchLines -1 DllCall("QueryPerformanceFrequency", "Int64*", frequency) Timings := {} whr := ComObjCreate("WinHttp.WinHttpRequest.5.1") whr.Open("GET", ...
by swagfag
Yesterday, 15:27
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

the problem is that both interfaces are separate from each other. u can either start processing a json string as an AHK object(in which case, true becomes -1 , null gets mangled, and possibly other weird things, etc) OR u can start processing the json string in the context of the JS comobject(in whi...
by swagfag
Yesterday, 14:12
Forum: Ask For Help
Topic: controlsend not working in game
Replies: 8
Views: 175

Re: controlsend not working in game

Looping a key may emulate holding it down, however, its not quite the same as actually holding it down
by swagfag
Yesterday, 13:44
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

if im gonna have to copy paste .GetKey() a thousand times cuz i cant use foreach, then yes, very much so
by swagfag
Yesterday, 12:24
Forum: Ask For Help
Topic: Can you include a .cs file in an AHK script?
Replies: 4
Views: 80

Re: Can you include a .cs file in an AHK script?

uh yeah i dont know, maybe? typically ud LoadLibrary at the start, GetProcAddress all the exported functions u plan on calling throughout ur script and FreeLibrary if ure not gonna use the dll anymore the error handling pertains to whether a given DllCall was successful or not, eg heres what it says...
by swagfag
Yesterday, 12:10
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

great, so it works correctly now, although we've truly gone back to square 1
the pain in the ass is that u have to juggle strings back and forth every time u want to do anything useful
:roll:
at least ur lib allows one to choose
by swagfag
Yesterday, 11:45
Forum: Ask For Help
Topic: Can you include a .cs file in an AHK script?
Replies: 4
Views: 80

Re: Can you include a .cs file in an AHK script?

u could probably do it using CLR.ahk , but i dont see the point in going ahk->c#->logitech, when u can just go ahk->logitech. they gave u a dll , so use that DLL := DllCall("LoadLibrary", "Str", "LogitechLedEnginesWrapper.dll", "Ptr") LogiLedInitWithName := DllCall("GetProcAddress", "Ptr", DLL, "ASt...
by swagfag
Yesterday, 10:32
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

Code: Select all

;                  v----------+
sJSON = {"key1": true} ;      |
ahkObj := JSON.Parse(sJSON) ; |
MsgBox % ahkObj.key1 ; -1 <---+
-1 is truthy in ahk and most people probably dont do math with booleans, but thats wrong
by swagfag
Yesterday, 08:06
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

teadrinker yep u right, json is a javascript based format. except for being aware of the fact that arrays are 0-based, zero javascript knowledge is required for u to start working with the object returned by JSON.Load . only ahk knowledge is required i think the json lib is simple, yes. u only need...
by swagfag
Yesterday, 07:15
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

ah yes, enumerators are the fir- no, scratch that. AHK enumerators are the first thing that pops into one's head when they hear the word "simple" i wanted to use it on JSON = (Join {"data":[ { "Name": "John", "phone": [ { "type": "home", "number": "212 555-1234" }, { "type": "mobile", "number": "123...
by swagfag
Yesterday, 06:30
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

teadrinker the pain in the ass is that u have to juggle strings back and forth every time u want to do anything useful can u rewrite this? i need an ahk array of all phone numbers AllPhoneNumbers := [] for each, Person in Obj.data for each, Phone in Person AllPhoneNumbers.Push(Phone.number) yeah, t...
by swagfag
Yesterday, 05:36
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

afe if uve ever used an ahk associative array, u already know how to use it. theres nothing new to learn teadrinker i didnt know about this error. it looks like he has some things builtin to address that( JSon.Undefined ) but havent been able to figure out what to do with them yet. i dont even know...
by swagfag
23 Jun 2019, 18:29
Forum: Ask For Help
Topic: Translate PowerShell to AHK - possible?
Replies: 31
Views: 569

Re: Translate PowerShell to AHK - possible?

simple = 302;"Emelie";"111,174,50" misidentified := "0,001; 0,002; 0,003" ambiguous := "1,5;2,5;3" MsgBox % mostLikelyDelimiter(simple) ; ';' MsgBox % mostLikelyDelimiter(misidentified) ; ',' MsgBox % mostLikelyDelimiter(ambiguous) ; throws mostLikelyDelimiter(line) { Delimiters := {} for each, cha...
by swagfag
23 Jun 2019, 13:30
Forum: Ask For Help
Topic: controlsend not working in game
Replies: 8
Views: 175

Re: controlsend not working in game

well if u have controlsen t , Edit1, {x}, Untitled written in ur script, then this is what ure doing wrong otherwise, make sure u run the script as admin and make sure there's no winTitle mismatch, ie ure targetting the right window and doing it correctly(in accordance to the current TitleMatchMode ...
by swagfag
23 Jun 2019, 09:29
Forum: Ask For Help
Topic: Get a control position on screen Topic is solved
Replies: 5
Views: 149

Re: Get a control position on screen Topic is solved

WinGetPos for the window's screen x, y
the control's screen x, y are then the window's screen x, y + the control's relative x, y
by swagfag
23 Jun 2019, 09:21
Forum: AutoHotkey v2 Help
Topic: [v2] ComObjConnect not working
Replies: 1
Views: 67

Re: [v2] ComObjConnect not working

it has to do with https://www.autohotkey.com/boards/viewtopic.php?f=37&t=2120&start=40#p276644 OnQuit doesnt have any parameters, Params in PrefixEventName([Params..., ComObject]) { ... event-handling code ... return ReturnValue } is empty, but ahk additionally passes to the event handler ComObject ...
by swagfag
23 Jun 2019, 08:34
Forum: Ask For Help
Topic: controlsend not working in game
Replies: 8
Views: 175

Re: controlsend not working in game

i think ControlSend has 0% chance of working but u could try the following regardless. run the game, set it up so theres some observable behavior that u can observe when a key is pressed(eg space => jump, but urs might be different so ud have to change that), run the script, sit through 500 tests an...
by swagfag
22 Jun 2019, 12:42
Forum: Ask For Help
Topic: Is there a simple and reliable way to process JSON data? Topic is solved
Replies: 33
Views: 521

Re: Is there a simple and reliable way to process JSON data? Topic is solved

besides having to #Include it(i trus u know how to do this), its literally a single function call u have to make: Obj := JSON.Load(theJsonString), then u access it as if it were a normal ahk object, u know? Obj.data[0].name etc
by swagfag
22 Jun 2019, 12:22
Forum: Ask For Help
Topic: Get mouse position in NoActivate GUI ?
Replies: 3
Views: 126

Re: Get mouse position in NoActivate GUI ?

subtract the gui's x, y from the mouse's screen x, y

Go to advanced search