AHKonsole - Class Based Console Library - Tetris!

Post your working scripts, libraries and tools
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

AHKonsole - Class Based Console Library - Tetris!

23 Oct 2014, 21:21

I present https://github.com/G33kDude/Console

It's a wrapper for the win32 console. Currently pretty small, but still very flexible.

Examples:

A syntax highlighter proof of concept:
Image

A (working) IRC client:
Spoiler


Tetris clone!:
Spoiler
Last edited by GeekDude on 17 Nov 2014, 09:53, edited 3 times in total.
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Win32 Console Wrapper Library

23 Oct 2014, 21:30

Very nice!
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: Win32 Console Wrapper Library

30 Oct 2014, 14:36

Hey @Lexikos, Would it be possible to add a #directive that would make AHK not detach from the command line?

So that something like this won't look so odd, and that the attachconsole call won't be necessary

Code: [Select all] [Download] (Script.ahk)GeSHi © Codebox Plus

DllCall("AttachConsole", "UInt", -1)
FileOpen("CONOUT$", "w").Write("Test")
MsgBox
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Win32 Console Wrapper Library

30 Oct 2014, 15:20

Well i'm not lexikos but, i can tell you that ahk is compiled as a GUI application.. What you probably want is the Console Subsystem. In the preview2 of ahk2exe there is a compile directive that can set the subsystem to console. I made a little ahk2exe wrapper that compiles ahk scripts to exe with the console subsystem.... I could probably make it a lot better.. But What you really want to look at here is this script by Lexikos that changes it for you: https://github.com/joedf/LibCon.ahk/blo ... hk2CLI.ahk
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: Win32 Console Wrapper Library

31 Oct 2014, 10:42

That script turns a gui application into a console application? Neato! Any reason you're not in the IRC channel joedf?
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Win32 Console Wrapper Library

31 Oct 2014, 12:29

Sometimes I'm there but no so much recently.. :P
I'll try to pop on more often then ;)
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Win32 Console Wrapper Library

01 Nov 2014, 18:23

Bejeebus.... Dats Awesome. :D
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: Win32 Console Wrapper Library

03 Nov 2014, 20:44

I've updated the palette in Syntax.ahk slightly, and fixed a bug in the hex detection (it didn't used to detect hex numbers with 0s in them).

Also, I added a new example script, Embed.ahk. It's a proof of concept for embedding a console as a control in your own gui. I wasn't sure how to fix a rendering issue until I saw @Ronin 's code that had a style which I did not (WS_CLIPCHILDREN). So, thanks Ronins! If you want, I can put you in the ReadMe
GeekDude
Posts: 695
Joined: 02 Oct 2013, 22:13

Re: Win32 Console Wrapper Library - Tetris!

10 Nov 2014, 23:59

Added a new sample script, Tetris.ahk!

I added some methods for creating and manipulating console buffers, thus allowing me to double buffer my output. This means I can output (in color) the Tetris game screen seamlessly.

Image
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: Win32 Console Wrapper Library - Tetris!

11 Nov 2014, 09:28

Shizzle! At this rate, I'll just deprecated Libcon.ahk ;)
User avatar
joedf
Posts: 5328
Joined: 29 Sep 2013, 17:08
Facebook: J0EDF
Google: +joedf
GitHub: joedf
Location: Canada, Quebec
Contact:

Re: AHKonsole - Class Based Console Library - Tetris!

24 Nov 2014, 20:26

I gotz an Idea, Now as a class it will be much easier!
Console GUI! :D lol AHKonsole.GUI() :D
Image

Return to “Scripts and Functions”

Who is online

Users browsing this forum: No registered users and 17 guests