Page 1 of 1
can I make a function clear the console? "clear" no good
Posted: Sat Feb 09, 2013 4:50 am
by Komag
I'd like to have a function in the game clear the console - possible?
I tried just saying "clear" like
code not accepted, doesn't work
Re: can I make a function clear the console? "clear" no good
Posted: Sat Feb 09, 2013 4:57 am
by msyblade
Hmm, this is a good question. Surprised that the function does not work. Perhaps there is a trigger function in that case, such as "print" is used before the command. like "command clear" or something. i'm gonna check it out, but it may be just obscure enough not to have an answer printed yet. (Especially if you're not aware of it, kinda think of you as "the encyclopedia" around here!

Re: can I make a function clear the console? "clear" no good
Posted: Sat Feb 09, 2013 4:58 am
by Komag
well that was fast...
I thought of a new idea, to have the gui print a blank space, so you just hold the key for a second and the console flies away upward all cleared off!
in my gui hook code:
Code: Select all
if g.keyDown("c") then pr.nt("") end -- to clear the console
works pretty well
...even better:
Code: Select all
if g.keyDown("c") then
for i=1,20 do pr.nt("") end end -- to clear the console
this clears it instantly by hitting c for a moment instead of having to hold it for a full second
Re: can I make a function clear the console? "clear" no good
Posted: Sat Feb 09, 2013 5:04 am
by msyblade
you want to do this without the player knowing, correct? so you could trigger it with a hidden plate etc. Or is this just for your personal use. (Was picturing players getting a console message that spoiled a puzzle hint on the fly.) I almost want to consider the console like an entity, where it could be id'd, like "console: clear()", now i just wanna go mess with it,lol
Re: can I make a function clear the console? "clear" no good
Posted: Sat Feb 09, 2013 5:09 am
by Komag
it could work however you want, same code really, just a for-loop 20x to print a blank line.
I'm primarily wanting it for my upcoming testing sessions of my just-completed project, so I can have my console on but clear it very easily and quickly whenever I want. And also for my testers (after my own run-through) so they can see the console but also clear it fast as well.