Page 1 of 1

Clean console command.

Posted: Wed Apr 09, 2014 10:03 am
by Lamkefyned
Good afternoon

I wanted to ask if there is any command to clear the console and how to use it in a script of rombot?

Re: Clean console command.

Posted: Wed Apr 09, 2014 11:58 am
by Administrator

Code: Select all

clearScreen()
Will clear the screen of all input.


At the script prompt, you can enter "clear" to clear the screen:

Code: Select all

Script> clear

Re: Clean console command.

Posted: Wed Apr 09, 2014 1:26 pm
by Lamkefyned
Hello, good evening

I have an error when making clearScreen()
Error.jpg

Re: Clean console command.

Posted: Wed Apr 09, 2014 1:49 pm
by Administrator
I see. Try this:

Code: Select all

function _clear()
	local _, _, x, y = getConsoleAttributes();
	for j = 1, y do
		printf(string.rep(' ', x));
	end
	clearScreen();
end
Then clear the screen by using _clear().

Re: Clean console command.

Posted: Wed Apr 09, 2014 5:43 pm
by Lamkefyned
Thank you it worked