Using AHK for large scale software development

Post your working scripts, libraries and tools for AHK v1.1 and older
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Using AHK for large scale software development

17 Dec 2020, 09:26

Hello,

I am new to this community (really, my first post), and also quite new to AHK as well. To be precise, I've come across AHK three months ago, cause I've been looking for a macro processor to automate some tasks in a virtual racing simulator. As usual, things got complex quite fast, I learned a lot about AHK and the list of ideas for my simulation automation software got really long. In the end, I decided to conduct a complete rewrite using the object oriented capabilites of AHK. I ended up with almost 8000 lines of code, several independent applications integrated with interprocess communication, a rules based build system similar to the good old make, but written competely in AHK, and a very capable plugin mechanism for extending the solution at the users site, since every simulation rig is different.

If you're interested take a look at the GitHub repository and the quite extensive documentation. Feel free to use parts of the code for any of your own projects, if you find something useful.

GitHub: https://github.com/SeriousOldMan/Simulator-Controller
Documentation: https://github.com/SeriousOldMan/Simulator-Controller/wiki

Have fun...

TheBigO
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Using AHK for large scale software development

17 Dec 2020, 10:55

That is some fantastic stuff. Will definitely pick your brain when I start building my own. AWESOME!
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

18 Dec 2020, 03:56

Yeah, thanks. It was quite some task. The biggest challenge was the fact, that finding errors in complex code ist not quite easy in AutoHotkey, since

Code: Select all


foo := false

foo.callBar()[42]

evaluates without error. Maybe something to change by a #Warn option in the future...
User avatar
Relayer
Posts: 160
Joined: 30 Sep 2013, 13:09
Location: Delaware, USA

Re: Using AHK for large scale software development

18 Dec 2020, 08:27

Impressive. You must have a strong background in programming. I have written assembly code and some C but I have learned most of what I know from AHK. I'm basically a hack with no formal training. I can learn a lot from looking at your code. I love classes but I can tell from your work that I have a long way to go to fully take advantage of what they can do.

Thanks for sharing.

Relayer
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

23 Dec 2020, 01:51

Version 1.2 is available for download. Lot's of new stuff, including a themes editor for your own simulation worlds, like Rallye, F1, Flight Sim 2020, and so on.
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

29 Dec 2020, 14:07

Version 1.3 is out since a few days. The Button Box visual representation now uses photorealistic graphics and you can interact with it using the mouse.
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

01 Jan 2021, 13:22

Hi, I wish everyone here on the board a happy new year.

And I have a new release out. This time with a very interesting feature also for non-gaming projects, a multibyte, multilanguage translation system for each and every text used (> 400 entries). A graphical user interface that helps to define the translation rules for a new language is there as well.

TheBigO
User avatar
iilabs
Posts: 296
Joined: 07 Jun 2020, 16:57

Re: Using AHK for large scale software development

02 Jan 2021, 14:13

That would be awesome. Really appreciate it!
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

03 Jan 2021, 07:27

iilabs wrote:
02 Jan 2021, 14:13
That would be awesome. Really appreciate it!
It's all there already. You need to extract a few functions from Functions.ahk and isolate the TranslationsEditor classes from "Simulator Configuration.ahk". Nothing very complicated, I think it is doable in about 30 minutes.

Best, Oliver
User avatar
Delta Pythagorean
Posts: 627
Joined: 13 Feb 2017, 13:44
Location: Somewhere in the US
Contact:

Re: Using AHK for large scale software development

03 Jan 2021, 17:27

Give me a few days and I can port an error system that's somewhat similar to python. I use it everyday when creating script sand it works extensively well. Just have to extract it from my own libraries and not have it hard coded lol

[AHK]......: v2.0.12 | 64-bit
[OS].......: Windows 11 | 23H2 (OS Build: 22621.3296)
[GITHUB]...: github.com/DelPyth
[PAYPAL]...: paypal.me/DelPyth
[DISCORD]..: tophatcat

TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

08 Sep 2021, 08:50

Time for an update. My software package is growing and growing. As of today, it consists of more than 15 separate applications with about 50.000 lines of AHK code and roughly 10.000 lines of C, C++ and C# code. I have even written a compiler and runtime environment for a hybrid logical programming language completely in plain AHK. This rules engine is used for voice chat capable digital assistants similar to Alexa (domain knowledge is of course racing simulations).

There are lot's of goodies, that might be useful in other AHK projects as well, for example a build pipeline (written in AHK) or a complete automatic software download, installation and update process (written in AHK), just to name a few. Please feel free to use this. I will also help, if you want to separate this from the rest of the system.
SandroPaling
Posts: 1
Joined: 24 Oct 2022, 10:23

Re: Using AHK for large scale software development

24 Oct 2022, 10:25

Welcome to the community! Your project sounds really impressive - it's great to see what can be done with AHK with a bit of creativity and effort. I'm sure other community members will be interested in looking at your code and learning from it.
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

26 Oct 2022, 07:11

SandroPaling wrote:
24 Oct 2022, 10:25
Welcome to the community! Your project sounds really impressive - it's great to see what can be done with AHK with a bit of creativity and effort. I'm sure other community members will be interested in looking at your code and learning from it.
Hey, thank you. It is quite a long time, I posted here, but I a still producing tons of AHK code each day. And it is amazing, that it is possible to build really serious applications using a language which started like a simple automation macro language.

Latest addition to my framework, which might be of interest to the AHK community, is a task and coroutining library. I think that it can easily be used standalone with a couple of simple changes: https://github.com/SeriousOldMan/Simulator-Controller/blob/main/Sources/Libraries/Task.ahk

Usage is absolutely simple. Example:

new PeriodicTask(Func("keepAlive").Bind(connector, connection), 10000, kInterruptPriority).start()

This starts a Task, which runs every 10 seconds on interrupt priority level. The obvious question: Why not use SetTimer? Answer: Because you have full control over priority levels, can start, stop and suspend tasks, and things look familar to the coders eye.
murataygun
Posts: 104
Joined: 07 Aug 2015, 15:53

Re: Using AHK for large scale software development

26 Oct 2022, 12:11

How come you got familiar with AHK so fast. You must be a genius :D
TheBigO
Posts: 26
Joined: 17 Dec 2020, 09:11

Re: Using AHK for large scale software development

18 Apr 2023, 04:49

Puuh, ported roughly 120.000 lines to AHK 2. What a journey. Took 6 weeks almost fulltime. Tools like AHK2 Converter help a little bit, but in the end you have to take a look at every single line of code.

Learnings:

1. Performance increased by big numbers, especially when working with (hash) maps.
2. AHK2 is much more bullet-proof for the developer and finds many coding problems at startup time.
3. New type system is very flexible. I created a subclass of Gui, for example, which seamlessly implements a window reszing framework with rules integrated into the standard options of a new control (extended the Gui.Add method)
4. It is now very important to handle errors correctly. A lot more try / catch blocks are necessary to keep things running.

Next on my whish list for AHK: Optionally strongly typed variables!

Return to “Scripts and Functions (v1)”

Who is online

Users browsing this forum: Descolada, KruschenZ and 191 guests