Clearing the debug print() log window from code

What I would like to do is to be able to clear the debug log window with code is there a function to do that ?

I want to clear it so I can have the table below show in the same position each time instead of scrolling.

|DEBUG:SCRIPT: Alien |6|
|DEBUG:SCRIPT: Alien Bullets |1347|
|DEBUG:SCRIPT: Asteroids |14|
|DEBUG:SCRIPT: Bonus |nil|
|DEBUG:SCRIPT: Bullet |3|
|DEBUG:SCRIPT: Enemy Bullet |0|
|DEBUG:SCRIPT: Explosion |10|
|DEBUG:SCRIPT: Coins |0|

I am trying to debug the quantity of game objects I have… so I put up and down counters in my code (init and final) so that I can generate a table of counts of the current game objects

function DEV_OBJECT_COUNT()
– Clear screen
print("Alien ",GLOBAL_ALIEN_COUNT)
print("Alien Bullets ",GLOBAL_ALIEN_BULLET_COUNT)
print("Asteroids ",GLOBAL_ASTEROID_COUNT)
print("Bonus ",GLOBAL_BONUS_COUNT)
print("Bullet ",GLOBAL_BULLET_COUNT)
print("Enemy Bullet ",GLOBAL_ENEMY_BULLET_COUNT)
print("Explosion ",GLOBAL_EXPLOSION_COUNT)
print("Coins ",GLOBAL_COIN_COUNT)
end

Now I switch displaying this on and off with a key…

I also do use… msg.post("@system:", “toggle_profile”) but it just shows the total object count… which would not have shown the bug I have above 1347 Alien Bullets is wrong.

Thanks I have been searching for the answer but cant find it :frowning:

There isn’t a way to clear the console that I know of, but you could use a GUI to display this information

2 Likes

Good idea :grinning: