ForeverZer0 44 Report post Posted May 14, 2011 (edited) Console Debug Authors: ForeverZer0 Version: 1.0 Type: Scripting Tool Introduction Redirects output using the "puts" command to a seperate console, instead of using the normal pop-up windows. Not much more to it than that. Features Simple. No annoying pop-up windows, though they still do have their uses. Automatically sets the console window the background. Screenshots None. Demo None. Script Here. if $DEBUG || $TEST # Create a console object and redirect standard output to it. Win32API.new('kernel32', 'AllocConsole', 'V', 'L').call $stdout.reopen('CONOUT$') # Find the game title. ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L') title = "\0" * 256 ini.call('Game', 'Title', '', title, 256, '.\\Game.ini') title.delete!("\0") # Set the game window as the top-most window. hwnd = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', title) Win32API.new('user32', 'SetForegroundWindow', 'L', 'L').call(hwnd) # Set the title of the console debug window' Win32API.new('kernel32','SetConsoleTitleA','P','S').call("#{title} : Debug Console") # Draw the header, displaying current time. puts ('=' * 75, Time.now, '=' * 75, "\n") end To give the ouput the same functionality of the "p" method where it shows the inspected object, just add this code any 'ol where: alias zer0_console_inspect puts def puts(*args) inspected = args.collect {|arg| arg.inspect } zer0_console_inspect(*inspected) end Instructions Place the script anywhere you like. In script calls or within scripts, output to it using "puts" instead of the normal "p" or "print". Compatibility Shouldn't be any. Credits and Thanks ForeverZer0, for the script. Author's Notes Please report any bugs/issues/suggestions. I will be happy to fix them. Enjoy! Edited May 14, 2011 by ForeverZer0 Share this post Link to post Share on other sites
kellessdee 48 Report post Posted May 14, 2011 I had seen this at chaos project, AND IT IS VERY USEFUL much kudos to you for this :D Share this post Link to post Share on other sites