OpenConsole

BlitzMax Forums/BlitzMax Programming/OpenConsole

Perturbatio(Posted 2005) [#1]
I've been playing about over the last few hours and have created the beginnings of (what I believe to be) a useful tool.

OpenConsole(tm)(c)(R)(ASAP)
What it is:
A command console for adding to your apps.
Useable
pretty easy to plug in to an app
probably riddled with bugs and memory leaks


What it isn't:
anywhere near finished
attractive
a banana
related to Bob Monkhouse
riddled with spiders and leeks
perfect
properly commented


My hope is that people will add and post useful fixes/additions to it so everyone can benefit from it.

It took me two lines of code to add this to rockout.bmx so it's definitely easy to implement.



Comments and feedback welcome.


Rimmsy(Posted 2005) [#2]
What a great piece of code. Cheers for this. I was searching for a text entry function for my console but I think I'll use your console instead.

Thanks again, Perty

Matt


Perturbatio(Posted 2005) [#3]
wow! someone actually looked at the thread. I was beginning to think I'd done it all for nothing :)


Rimmsy(Posted 2005) [#4]
Which reminds me, am I allowed you use this in my game with the following: OpenConsole(tm)(c)(R)(ASAP)?

And if not, *slaps monitor* why not?


Perturbatio(Posted 2005) [#5]
Of course you are *slaps Rimmsy* it's a joke dammit! a joke!


Rimmsy(Posted 2005) [#6]
I know, I know! I was joking too. *double table slap*

my hand is hurting. I'm really slapping these things you know. I'm not just typing it.


Perturbatio(Posted 2005) [#7]
I know you were joking *triple slaps table*.
I was joking about you joking about me joking... em... or something like that.


Rimmsy(Posted 2005) [#8]
ohhhh, really? Well, cop this: I wasn't joking about your joking. I was joking *at* my joke, which was a joke in itself at my own joke.

*slaps moderator currently looking at this thread with disdain*


ninjarat(Posted 2007) [#9]
uh, gee, this looks like a pretty good tool. Too bad it got abandoned like a year ago. Anyone but me think it's a good idea to revive this thread?


Perturbatio(Posted 2007) [#10]
I do, but I'm biased :)


ninjarat(Posted 2007) [#11]
Well, duh. :P

Hey, tell you what. I'm working on a completely different project right now, but it uses a console command line in graphics mode. When I'm done with it, I'll post the command line parser I'm using, it just splits stuff up in to words based on a delineator.

That's what you have here, except that was a long time ago. I tried your old stuff, and it doesn't work in newer blitzmax at all anymore. Even after I fixed everything that generated a compile error, it still didn't work.

I'll also post an implementation of the parser in a command line like program. It uses wave~'s Max2D input module.


Perturbatio(Posted 2007) [#12]
After changing some constants and the flushmem statements to GCCollect() and commenting out the setAppTitle command (it's a custom command in a module of mine), this compiles fine on the latest version:




Koriolis(Posted 2007) [#13]
Here's a modified version that handles multiline input (but commands still are single line so as is it is not of much use; rather a starting point).
Pertubatio, would you mind if I included a modified version of this console code with BVM 2?



Perturbatio(Posted 2007) [#14]
Pertubatio, would you mind if I included a modified version of this console code with BVM 2?

No, I don't mind. :)

Obviously I would like it, if you made any changes, for you to post them here.

(ideally in a codebox :) )


Koriolis(Posted 2007) [#15]
Well, no problem, but the idea is to use the console to allow the execution of BVM scripts, as the application runs. So without BVM itself it won't be of much use. What I posted in the previous post will most probably be the only change I do to your code that can be compiled on its own.

BTW, I replaced the code tag with a codebox. Well spotted :)


Perturbatio(Posted 2007) [#16]
Well, no problem, but the idea is to use the console to allow the execution of BVM scripts, as the application runs. So without BVM itself it won't be of much use. What I posted in the previous post will most probably be the only change I do to your code that can be compiled on its own.


Ah well, I've still no problem with you using this :)


altitudems(Posted 2007) [#17]
Here is my contribution, a console with debug variable watching / changing. Comes in very handy for me all the time.

Example program:


debug.bmx:
Manages the console and debug variables


console.bmx:


Feel free to make any suggestions or changes (Just make sure to post them here) and if you use this in your project let us know.

Enjoy!


altitudems(Posted 2007) [#18]
Anyone else getting slowdowns when running the code above?


altitudems(Posted 2007) [#19]
Has anyone had a chance to try this? I'm trying to figure out why I'm getting random(?) slowdowns here.