Grey Hack
What you will find in this repository
Here you can find the scripts used by the QTG team to play Grey Hack.
Who are we?
QTG means “Qu’est-ce que tu GEEKes ?” We are a french YouTube channel explaining various things about computing. We decided that Grey Hack would be one of the tools we use to explain things!
Why those scripts?
Grey Hack is a great game offering an internal programming language, GreyScript, based on MiniScript. This language is used internally to build all the scripts, and can be used to do whatever you can think of in the game. A few things are missing to fully automate the actions you can do in the game, so we decided to create the tools we needed.
In the repo you can find a very simple preprocessor which allows us to include scripts into others, a JSON parser originally made for MiniScript we adapted to GreyScript, and some other tools to automate actions in the game.
How does the preprocessor work?
It is very simple, it detects the “#//import file.gs” pattern and includes the file at this place.
We decided that the “importable” files should have a .gs
extension, and the result of the preprocessor is stored as file_pp.src
. Then it is compiled and the source file is removed. The executable file is created with no extension.
The preprocessor is also able to remove everything located after a line starting with “//#UnitTests“ to be able to add tests to our files without including them into final executable files.
Warning: the preprocessor does not remove the Grey Hack limitation of 80000 characters for a compilable script.