Tweets from pichat
| Two songs from the year I created my first web sites. http://t.co/8eHrOA9K + http://t.co/AuWb2etI #video #retro About 1 day, 1 hour ago from pichat (Mark Seuffert) |
Tweets from 600infos
| I HAVE NYANED FOR 888.4 SECONDS! http://t.co/JQYOZebv via @nyannyancat About 1 week, 5 days ago from 600infos (Wolf) |
Trace: » HTTP_USER_AGENT ändern » embedding sound » Backup a FTP Directory with wget » klassische Suche aktivieren mit der Suche in PHP oder CPP-Files » Kopiert eine Liste von Dateien in einer Batch Datei » Creates a colored Banner Text for Pichat
You are here: Pichat Wiki (en) » Snippets » Creates a colored Banner Text for Pichat
Creates a colored Banner Text for Pichat
File: create_banner.cmd
@echo off
REM ############################################################################
REM
REM create_banner.cmd
REM
REM Version 0.1 Mark Wolfgruber 2009/07/24
REM
REM HTTP://www.pichat-wiki.de
REM HTTP://www.600infos.de
REM
REM external used Program Files:
REM extract the files from the Cygwin-Project or download it
REM to the same folder or into the path enviroment
REM
REM banner.exe
REM sed.exe
REM
REM ############################################################################
if /i #%1==#-h goto help
if /i #%1==#/h goto help
if /i #%1==#-? goto help
if /i #%1==#/? goto help
if not #%1==# set _text=%1
set _tmp=%CD%\banners
if not exist %_tmp% md %_tmp%
if not exist %_tmp% set _tmp=%CD%
:set_color_codes
set _red=1
set _green=2
set _blue=3
set _blank=
:set_default_colors
if #%_color_code%==# set _color_code=10
call :set_color
:main_loop
:input
call :header
echo type /H for Help
if "%_text%"=="" (
set /p _text=Text :
) ELSE (
set /p _text=Text [%_text%]:
)
if "%_text%"=="" goto input
:check_input
if /i "%_text%"=="/Q" goto end
if /i "%_text%"=="-?" set _text=&& call :help && goto input
if /i "%_text%"=="/?" set _text=&& call :help && goto input
if /i "%_text%"=="/H" set _text=&& call :help && goto input
if /i "%_text%"=="/E" set _text=&& call :explore && goto input
if /i "%_text%"=="/D" set _text=&& call :del_temp && goto input
if /i "%_text%"=="/C" set _text=&& call :change_color && goto input
:work_in_progress
call :create_banner_simple
call :create_banner_pichat
start notepad "%_tmp%\banner_pichat.tmp"
goto main_loop
::functions
:del_temp
call :header
if exist "%_tmp%\banner_*.tmp" (
echo try to delete all banner_*.tmp ...
del "%_tmp%\banner_*.tmp"
call :header
echo all banner_*.tmp are deleted
)
goto :EOF
:set_color
REM 10er = Color Font + 1er = Color Background
set /a _color_code=%_color_code%+0
if %_color_code% LSS 0 set _color_code=10
if %_color_code% GTR 33 set _color_code=10
set /a _ccf=%_color_code%/10
set /a _cc=%_ccf%*10
set /a _ccb=%_color_code%-%_cc%
REM if %_ccf% GTR 3 set _ccf=0
REM if %_ccb% GTR 3 set _ccb=0
set _cf=%_red%
set _cb=%_blank%
if %_ccf% EQU 0 set _cf=%_blank%
if %_ccf% EQU 1 set _cf=%_red%
if %_ccf% EQU 2 set _cf=%_green%
if %_ccf% EQU 3 set _cf=%_blue%
if %_ccb% EQU 0 set _cb=%_blank%
if %_ccb% EQU 1 set _cb=%_red%
if %_ccb% EQU 2 set _cb=%_green%
if %_ccb% EQU 3 set _cb=%_blue%
REM ColorCode 0 is empty (without format code)
if %_color_code% EQU 0 (
set _cf=
set _cb=
)
goto :EOF
:change_color
call :header
echo not implemented yet
echo available Colors:
echo.
echo 0 = blank font + blank background
echo 1 = blank font + red background
echo 2 = blank font + green background
echo 3 = blank font + blue background
echo 10 = red font + blank background
echo 11 = red font + red background
echo 12 = red font + green background
echo 13 = red font + blue background
echo 20 = green font + blank background
echo 21 = green font + red background
echo 22 = green font + green background
echo 23 = green font + blue background
echo 30 = blue font + blank background
echo 31 = blue font + red background
echo 32 = blue font + green background
echo 33 = blue font + blue background
echo.
set /p _color_code=Color Code [%_color_code%]:
call :set_color
goto :EOF
:explore
call :header
echo start %windir%\explorer.exe /n,/e, %_tmp%
start %windir%\explorer.exe /n,/e, %_tmp%
goto :EOF
:header
cls
echo.
echo BANNER for Pichat
echo.
goto :EOF
:help
call :header
echo.
echo /C = change colors
echo /D = delete all banner-temp-files
echo /E = explore banner-temp-files
echo /H = this Help
echo /Q = Quit
echo.
echo more info look at: HTTP://www.pichat-wiki.de
echo Your Adminwolf (Mark Wolfgruber)
echo.
pause
goto :EOF
:create_banner_simple
echo. > "%_tmp%\banner_simple.tmp"
echo %date% %time% %_text% > "%_tmp%\banner_error.tmp"
banner.exe %_text% | find /i "x" | sed.exe 's/\ /_/g' 2> "%_tmp%\banner_error_11.tmp" | sed.exe 's/X/o/g' >> "%_tmp%\banner_simple.tmp" 2> "%_tmp%\banner_error_12.tmp"
REM type "%_tmp%\banner_simple.tmp"
goto :EOF
:create_banner_pichat
echo _ > "%_tmp%\banner.2.tmp"
type "%_tmp%\banner_simple.tmp" | sed.exe 's/_/%_cb%_/g' 2> "%_tmp%\banner_error_21.tmp" | sed.exe 's/_%_cb%/_/g' 2> "%_tmp%\banner_error_22.tmp" | sed.exe 's/o/%_cf%o/g' 2> "%_tmp%\banner_error_23.tmp" | sed.exe 's/o%_cf%/o/g' >> "%_tmp%\banner.2.tmp" 2> "%_tmp%\banner_error_24.tmp"
echo. >> "%_tmp%\banner.2.tmp"
echo _ >> "%_tmp%\banner.2.tmp"
find "_" "%_tmp%\banner.2.tmp" > "%_tmp%\banner.3.tmp"
findstr "_" "%_tmp%\banner.3.tmp" > "%_tmp%\banner_pichat.tmp"
goto :EOF
:end
REM EXIT