Free console module

BlitzMax Forums/BlitzMax Programming/Free console module

Filax(Posted 2005) [#1]
Hi :)

This is a little console module for help you to debug or use your
software. It's very easy to use :)

Installation :

Extract 'console.mod' from the zip to you 'mod/pub' directory
use the test.bmx program for test the console.

http://www.blitz3dfr.com/console_projet/console.zip

Enjoy :)


Filax(Posted 2005) [#2]
Note :

In the test code, the line :
RefreshConsole(9)

9 is the keycode ... you can use another keycode :)

If you try only :
RefreshConsole()

The default key for show/hide console is the TAB key.


klepto2(Posted 2005) [#3]
I always get an error:

undefined reference to ....

Could it be, that you have forgotten to put the console.bmx
to your package?


Sarge(Posted 2005) [#4]
That error is because your not putting the filax's module in the pub.mod folder.


klepto2(Posted 2005) [#5]
I have it in the pub.mod folder.
It was a compatibility error with my own console.mod.
So I had forgotten to deactivate Quick build after solving it.


Filax(Posted 2005) [#6]
I have update the console, redownload it

Added : FPS counter and lisibility with alpha 1


klepto2(Posted 2005) [#7]
Nice one. Maybe you can add something to cycle through the
ConsoleItems like in mine.


Filax(Posted 2005) [#8]
Yes i'll do this stuff, but i have updated the module now you can
import your hown background image


Muttley(Posted 2005) [#9]
That's really great. :)

Any chance of an option to have the console appear at the bottom of the screen? How about command history scrollback?

I'm sure I'll think of some more ideas... ;)

Thanks

Muttley


Filax(Posted 2005) [#10]
I take note about you idea ! thanks :)


Filax(Posted 2005) [#11]
Update redownload :

Internal command added

$help : This help
$cls : Clear console buffer
$version : Console version
$mem : Display current memory
$time : Display current time
$date : Display current date
$mouse : Display current mouse position X,Y,Z

You can now repeat the last command with KEY UP and DOWN


Muttley(Posted 2005) [#12]
That's what I call service! :)

Thanks

Muttley


Filax(Posted 2005) [#13]
You can redownload it now you can scroll console text with PAGE UP / DOWN key :)

The command list :

' Init the console
InitConsole(Title:String="Console",NumLine:Int=20,Red:Byte=0,Green:Byte=128,Blue:Byte=192,Alpha:Float=0.5,Background:String="")

' Refresh the console
Console_Refresh(KeyCode)

' This line reset the console command
Console_Flushcmd()

'Send a message to the console
Console_AddString("")

' Clear the console buffer
Console_Clear()

The var :
Console_IsOpen (True or False)

If you ask this var you can know if the console is open or not
but if you modify this var you can open or close the console from
your code.


amonite(Posted 2005) [#14]
Super handy !!

thanks for sharing :)


Filax(Posted 2005) [#15]
Nothing :)


Muttley(Posted 2005) [#16]
Just noticed that after handling the built in $ commands ther module doesn't do a console_flushcmd(), so the next console_return() still contains the command.

Cheers

Muttley


Scott Shaver(Posted 2005) [#17]
Since this is free can we get the code for it so we can have mac and linux support as well?


Perturbatio(Posted 2005) [#18]
I was thinking it would be handy in conjunction with Noel's AngelScript mod.


Filax(Posted 2005) [#19]
don't panic :) i'll trye to compile this module on mac soon :)


Muttley(Posted 2005) [#20]
Another useful enhancement might be to return an array of strings from console_return() which would contain each command entered on a line (space delimited). So for example:

load map test-map.map

would return an array of 3 items containing:

array[0] = load
array[1] = map
array[2] = test-map.map

If you see what I mean?

Cheers

Muttley


Filax(Posted 2005) [#21]
I think you can do this but not directly from console :) check space
char under your string and when you find " " you put this string
under an array ?


Muttley(Posted 2005) [#22]
Yeah, it's something I'm working on currently. I'm just saying it would be nice as part of the core functionality of the module, because I suspect many people will need to split the results of console_return() anyway to handle more complex input from the user.

Just an idea. :)

Muttley


klepto2(Posted 2005) [#23]
It also works directly from the Console. I have just integrated this feature in my Module. You only have to take care of the array length by yourself.


Filax(Posted 2005) [#24]
Hi all :)

Please redownload the console, two little bug removed
and ... surprise :) Mac version :)


Muttley(Posted 2005) [#25]
Any chance of a Linux version? I'm willing to help out if you don't have access to a Linux system.

Cheers

Muttley


Filax(Posted 2005) [#26]
of course ! i'm working on :)


Filax(Posted 2005) [#27]
Re download the file :) now the console module is compatible with

PC
MacOS
Linux

Note for linux user : rename directory "Linux version" to "Linux_version"


Muttley(Posted 2005) [#28]
Excellent. Cheers mate. :)

As a note, you can actually use spaces in directories/filenames in Linux, you just need to escape the space character when referring to it.

So to access a directory called "Linux version" you would use "Linux\ version".

Keep up the great work. :)

Muttley


Filax(Posted 2005) [#29]
Linux is hell :) !!!!

So i'm happy if you like this console module :)


Muttley(Posted 2005) [#30]
Linux is very nice.... if you know UNIX. ;)

If not there's quite a steep learning curve. It's worth trying Ubuntu though, they seem to be heading for an Apple style "It just works!" kinda thing. Extremely simple to setup, and I've got BlitzMax working nicely in it too. :)

Cheers

Muttley


Hotcakes(Posted 2005) [#31]
Ubuntu - as recommended by BRL. Only $20 with your order of a 3D teapot.


Filax(Posted 2005) [#32]
I have try to install Ubuntu and blitzmax but ... blitzmax won't
compile my file :( for a strange reason, and i have other to do
than install PKG file :) My linux is KNOPPIX very easy to install
and blitzmax work directly wihout addon.

But i'm not a linux lover :) It's a good free OS but ... I prefer XP :)


AntonyWells(Posted 2006) [#33]
Any plans to do a new version for v1.16?


Booticus(Posted 2006) [#34]
PLEEEEEEASE FILAX!!!! The console was soo great to have.


Robb(Posted 2006) [#35]
If possible it'd be really great if you could get this working on the latest build. I got part way through a project that used your console module and at the moment I can't compile it on the latest version :(

...Even if you don't have time, thanks for creating such a neat little module in the first place!