All pastes #491454 Raw Edit

Chao7

public lua v1 · immutable
·published 2007-05-16 17:55 UTC
rendered paste body
local printf_console = nilfunction printf( fmt, ... )	if string.find( command_line(), "-printf", 0, true ) == nil then	    printf = printf_nil	end    if fmt == nil then		return -- formatless	end    if printf_console == nil then    	if get_console ~= nil then			printf_console = get_console()		end		return	end	if printf_console == nil then		return -- can't get console	end	printf = printf_main	printf_main( fmt, ... )endfunction printf_main( fmt, ...)    local c = select( "#", ... )    if c <= 0 then -- nothing to format        printf_console:execute( ":" .. string.gsub( fmt, " ", "\160" ) )    else        printf_console:execute( ":" .. string.gsub( string.format( fmt, ... ), " ", "\160" ) )    endendfunction printf_nil( ... )end