ahk_parser.js (convert v1->AHK_H v2) and what else ?

Post your working scripts, libraries and tools for AHK v1.1 and older
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

ahk_parser.js (convert v1->AHK_H v2) and what else ?

23 May 2021, 16:20

https://github.com/FuPeiJiang/ahk_parser.js#readme

convert v1->AHK_H v2
try here! https://fupeijiang.github.io/ahk_parser.js/

(everything will be on github so I don't have to copy twice + it has version control)
Last edited by MrDoge on 26 May 2021, 08:26, edited 1 time in total.
User avatar
JoeSchmoe
Posts: 129
Joined: 08 Dec 2014, 08:58

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

24 May 2021, 16:13

This looks amazing!

In the readme, you wrote:
Make a website so it could be used online (github.io ?) (your code is not sent nor stolen: just disconnect internet and you'll see that it still works)
That sounds brilliant. Would it be a place where I could upload my v1 code and have it converted to v2? Are you seriously considering that?
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

24 May 2021, 16:29

ty!

a place where I could upload my v1 code and have it converted to v2
this SHOULD be the easy part (2 <textarea> and 1 <button> and connect it)
I want github.io to automatically update the website whenever I push to default branch

but weekdays are starting.. might have to wait, I am more impatient
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

26 May 2021, 08:52

@JoeSchmoe
gg the site is live : https://fupeijiang.github.io/ahk_parser.js/

though idk how to cache the website with github.io yet (for offline)

you CAN perfectly ctrl+s to save the website
and you will have:
Downloads\fupeijiang.github.io_files
Downloads\fupeijiang.github.io.html
then disconnect internet and open `fupeijiang.github.io.html` with chrome or another browser
it will work THE SAME
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

26 May 2021, 10:35

very nice

this was an older attempt here:
https://github.com/mmikeww/AHK-v2-script-converter
it might not be useful for you, but you could check all the Tests to confirm your parser fixes them all

User avatar
JoeSchmoe
Posts: 129
Joined: 08 Dec 2014, 08:58

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

26 May 2021, 12:11

MrDoge wrote:
26 May 2021, 08:52
gg the site is live : https://fupeijiang.github.io/ahk_parser.js/
That looks great.

As we approach the first beta of v2.0, this could be a very useful resource for the community as more people want to convert from 1.1 to 2.0beta. I'm using it now and much prefer it, but I still have an enormous old script that runs 1.1.

Right now I'm super busy, but I'll post more when I am able to do more AHK work.
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

04 Jun 2021, 07:46

converted another script : https://raw.githubusercontent.com/FuPeiJiang/ahk_parser.js/convert_this/tov2/!get%20colour_mid.ahk
try converting it here : https://fupeijiang.github.io/ahk_parser.js/
did: CoordMode, MouseGetPos, MouseMove, PixelGetColor, PixelSearch

wrap
f3::
ExitApp
into
f3::
{
ExitApp
}
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

04 Jun 2021, 08:04

ty @guest3456

I will extract the tests from https://github.com/mmikeww/AHK-v2-script-converter/blob/master/tests/Tests.ahk
they know a lot
now, there's more understanding to do..

but first, I want to convert this :) https://www.autohotkey.com/boards/viewtopic.php?f=6&t=74647
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

04 Jun 2021, 08:28

MrDoge wrote:
04 Jun 2021, 08:04
I will extract the tests from https://github.com/mmikeww/AHK-v2-script-converter/blob/master/tests/Tests.ahk
they know a lot
now, there's more understanding to do..
keep in mind, those Tests are for an older version of AHK v2, but they still might be useful to add to your tests

MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

12 Jun 2021, 20:03

RunCMD() converted! : RunCMD.ah2
file.ReadLine() includes EOL(end of line) in V1, but not in V2, so I had to append a "`n" manually
lines 31 : sOutput .= Fn ? Fn.Call(Line, LineNum++) : Line "`n"
anyone has an idea how to do it automatically ? without sacrificing performance ?
instead of using `Global A_Args.RunCMD.PID` I replaced it with `Global RunCMD_PID`

fixed: so that it removes: #NoEnv, SetBatchLines
fixed: #SingleInstance

added Mocha unit tests: `yarn test`
here: mocha/test.ts
add tests like this : doIt('v:={}','v:=Map()')
or for files : doItFiles('../tests3/listlines.ahk','correct/listlines.ah2')

fixed: when you paste a large script, then it freezes when you paste something else.. OR cannot read property .text of undefined
User avatar
JoeSchmoe
Posts: 129
Joined: 08 Dec 2014, 08:58

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

30 Jul 2021, 20:23

Hey, @MrDoge, did you see the following post from Lexikos?
lexikos wrote:
24 Jul 2021, 19:28
AutoHotkey v2.0-beta.1 is now available.

Any further changes prior to the final v2.0.0 release should be of a minor nature (such as improvements to the error and warning dialogs), and should not affect the functionality of scripts. In other words, future releases are expected to be backward-compatible.
Your script could be quite useful to those who want to update to the v2beta! With future releases expected to be backward compatible, now seems to be the time to switch to v2.

I was quite happy to see that you made a commit on the very day that Lex posted the announcement. Does this mean that your script is up to date on beta 1?

Here's the announcement thread:
https://www.autohotkey.com/boards/viewtopic.php?f=24&t=93011
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

01 Aug 2021, 20:12

@JoeSchmoe thanks for linking the thread, it seems like a rejoice/party

Does this mean that your script is up to date on beta 1?
no, I use AHK_H v2, which hasn't been updated
there is another button for AHK_L v2 though, but there isn't much difference now

it's a bit, exhausting, to work on this
if I work on this, it will probably be 1-3 fixes every few days
if you look at this graph, you can see periods of [], then, the decline..
(if I were to guess, the 1st hill/bump is the parser, 2nd hill, the converter, then, lost of intense interest (cause, not fully clear to me)

I'm learning parsing pdf now, I want to replace text in pdf, to translate pdf
User avatar
JoeSchmoe
Posts: 129
Joined: 08 Dec 2014, 08:58

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

01 Aug 2021, 22:46

Thank you for fixing the last issue I posted on Github. I was able to get through a 3000 line script with only that error and one more (I just posted the second one as an issue on Github).

I hope you continue with occasional updates. The code is quite useful!
MrDoge
Posts: 151
Joined: 27 Apr 2020, 21:29

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

02 Aug 2021, 15:13

omg, @guest3456, I thought https://github.com/mmikeww/AHK-v2-script-converter was owned by @ mikeyww, but is this you ?
I mean, are you mmikeww? It was the same name to me
mmikeww
mikeyww
ok, now I see it
guest3456
Posts: 3453
Joined: 09 Oct 2013, 10:31

Re: ahk_parser.js (convert v1->AHK_H v2) and what else ?

02 Aug 2021, 16:48

MrDoge wrote:
02 Aug 2021, 15:13
omg, @guest3456, I thought https://github.com/mmikeww/AHK-v2-script-converter was owned by @ mikeyww, but is this you ?
I mean, are you mmikeww? It was the same name to me
mmikeww
mikeyww
ok, now I see it
i dont know who mikeYww is, but yes that github account is mine, not his


Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: furqan and 76 guests