Hacker News new | ask | show | jobs
by Tomte 964 days ago
> Also, ChatGPT is a big help with AutoHotKey script

I've tried that extensively, with no luck.

I have some experience with AHK1 and wanted ChatGPT to basically convert scripts to AHK2.

It's pretty much a loop: first response gives a syntax error. When I reply with the error message, it apologizes, explains where the error is, and gives another solution. That solution has different errors. When pasting the error message, it apologizes again, and gives a third version with syntax errors. And then it starts with the first version again, and I can repeat the loop.

5 comments

Yea that can happen. I found the best way to do it is baby steps. I asked it to do point a then it will create a simple small script. Then I follow up with how I do point a to point b, then it will start to add or revise the code a bit. Then I do point c and keep adding it. It is better to break down the process and provide it in chucks of what you want it to do, it fare better to provide you something.

If it start to get off the rail, I copy the code and close the chat. Then I create a new chat and tell it to use this code as a strict reference. And I tell it what I am trying to do, then it starts to improve the code further.

I found that it is best to give it my snippet of code and it will be able to use it as a template and modify it from there.

For your case, if you want to convert it from ahk1 to ahk2, give it a small section of the script. And it should be able to convert it from there. If that didn't work, then you could start from fresh and tell it of what you want in ahk2 script.

I recently discover Plind [0], it is a ChatGPT that specialized in programming. It managed to get me a specific code that actually work with keycombo that ChatGPT struggling to produce. Maybe Plind can help you out with that?

[0] https://www.phind.com

this is amazing, so far getting great results with this
That has been my experience too with more complicated scripts/tasks. If it's something beyond basics, GPT seems to be lost in its own dreamscape and never get out of it. Then again, sometimes it produces enough pointers/links to useful docs that I can figure out the rest of the problem. So I presently use it as a slightly kooky search engine which understands the natural language questions pretty well but shouldn't be trusted literally with the results.
Yeah, I had the exact same experience.

I am surprised how bad it is with ahk scripts and wonder why. What is indeed "original" is that it gives code with unexisting functions, which it never does for the other languages (in my experience).

Perhaps the language is not that famous compared to js or C but i doubt. There are tons of forums discussing issues... Strange.

ChatGPT relies on examples to get the idea of what to do. Likely that ChatGPT don't have enough samplings across the web to know how to convert it. Even through there are documentations and man pages, but they tend to lack examples of how to do it. Usually I see in forums and discussion board that they are snippets of code that didn't provide enough context of the whole script. ChatGPT is doing its best to provide the code based on the knowledge it has. Perhaps it didn't scrap AHK scripts enough to provide a better code? Possible it didn't have enough information of how to convert ahk1 to ahk2? If that is the case, then it would be best to start fresh.
Same. I think it's due to a lack of example code on the web for it. There's some, but nowhere near eg Python.