2009年写的了,翻了旧帖贴出来
这样用的:
- @echo off&title Code by Taurus&mode con: cols=21 lines=1&color 0a
- set TRW1=%~1
- if not defined TRW1 exit
- set/p= Loading <nul
- set o6=F&set o5=F&set o4=0&set o3=F&set o2=0&set o1=F
- set RBHTA="%~dp0\Rainbowtext.hta"
- set RBCODE="%tmp%\Discuzcode"
- set RBHC="%tmp%\HTMLCode"
- (
- echo ^<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"^>
- echo ^<html^>
- echo ^<head^>
- echo ^<script laguage="javascript"^>
- echo window.resizeTo^(768,452^);
- echo window.moveTo^(257,-500^);
- echo var y=-500;
- echo show=setInterval^("move()",1^);
- echo function move^(^){
- echo if^(0^>y^){
- echo y+=20;
- echo window.moveTo^(257,y^);
- echo } else {
- echo clearInterval^(show^);
- echo }
- echo }
- echo function move2^(^){
- echo if^(y^>-500^){
- echo y-=20;
- echo window.moveTo^(257,y^);
- echo } else {
- echo window.close^(^);
- echo }
- echo }
- echo ^</script^>
- echo ^<hta:application border="dialog" maximizebutton="no" scroll="no" MinimizeButton="no" caption="no" ID="oHTA" SysMenu="no" icon="C:\windows\system32\cmd.exe"^>
- echo ^<meta http-equiv="Content-Type" content="text/html"^>
- echo ^<title^>Taurus's Rainbow Text^</title^>
- echo ^<style type="text/css"^>
- echo p{
- echo overflow: scroll;
- echo width: 688px;
- echo height: 150px;
- echo padding: 1em;
- echo border: 4px solid #FF0000;
- echo line-height: 1.5;
- echo color: #FF0000;
- echo background: #000000;
- echo margin-left: auto; margin-right: auto; margin-top: 0px;
- echo }
- echo h1{
- echo width: 351px;
- echo background: #FF0000;
- echo font-size: 16px;
- echo font-weight:bold;
- echo margin-left: auto; margin-right: auto; margin-bottom: 3px;
- echo }
- echo form{
- echo width: 728px;
- echo margin-left: auto; margin-right: auto; margin-top: 0px;
- echo }
- echo textarea{
- echo width: 339px;
- echo height: 100px;
- echo background: #FFFFFF;
- echo border: 5px solid #FF0000;
- echo margin-left: auto; margin-right: auto; margin-top: 0px;
- echo }
- echo body{
- echo background: #000000;
- echo }
- echo table{
- echo border: 8px solid #FF0000;
- echo margin-left: auto; margin-right: auto; margin-top: 0px;
- echo }
- echo ^</style^>
- echo ^</head^>
- echo ^<body^>
- echo ^<H1 style="width: 728px;"^>·Effect of Sample^</H1^>
- echo ^<p^>
- echo ^<marquee direction=down scrollamount=6^>
- )>%RBHTA%
- (
- echo ^<H1^>·Discuz Code^</H1^>
- echo ^<center^>
- echo ^<textarea name=txt1^>
- )>%RBCODE%
- for /f "delims=:" %%i in ('findstr /n .* "%~1"') do set lines=%%i
- for /f "delims=" %%Z in ('findstr .* "%~1"') do (
- set "str=%%Z"
- set /a strnub=0
- set /a line+=1
- call :Printing
- )
- type %RBHC%>>%RBHTA%
- (
- echo ^</marquee^>
- echo ^</p^>
- echo ^<table^>
- echo ^<tr^>
- echo ^<td^>
- echo ^<H1^>·HTML Script^</H1^>
- echo ^<center^>
- echo ^<textarea name=txt2^>
- )>>%RBHTA%
- type %RBHC%>>%RBHTA%
- (
- echo ^</textarea^>
- echo ^</center^>
- echo ^</td^>
- echo ^<td^>
- )>>%RBHTA%
- type %RBCODE%>>%RBHTA%
- (
- echo ^</textarea^>
- echo ^</center^>
- echo ^</td^>
- echo ^</tr^>
- echo ^</table^>
- echo ^<table style="width:734px;border:0px"^>
- echo ^<td^>
- echo ^<INPUT onclick=javascript:document.all['txt2'].focus^(^);document.all['txt2'].select^(^);word=document.all['txt2'].createTextRange^(^);word.execCommand^(^"Copy^"^);alert^("...Complete!...................."^) type=button value="Copy HTML Script"^>
- echo ^<INPUT onclick=javascript:document.all['txt1'].focus^(^);document.all['txt1'].select^(^);word=document.all['txt1'].createTextRange^(^);word.execCommand^(^"Copy^"^);alert^("...Complete!...................."^) type=button value="Copy Discuz Code"^>
- echo ^</td^>
- echo ^<td style="text-align:right"^>
- echo ^<u^>
- echo ^<font size="2" color="#FF0000"^>Taurus Script PointTM ^(R^)2009^</font^>
- echo ^</u^>
- echo ^<input type=button value=" EXIT " onclick=setInterval^("move2()",1^);^>
- echo ^</td^>
- echo ^</table^>
- echo ^</body^>
- echo ^</html^>
- )>>%RBHTA%
- del %RBHC%
- del %RBCODE%
- start "" %RBHTA%
- exit
- :Printing
- setlocal enabledelayedexpansion
- set /a cope=!line!00/%lines%
- if !cope!==100 set copes=Complete:!cope!%%
- if !cope! lss 100 set copes=Complete: !cope!%%
- if !cope! lss 10 set copes=Complete: !cope!%%
- :Printing2
- if not defined str (
- if !findW!==1 (
- echo.>>%RBCODE%
- echo.^
- >>%RBHC%
- )
- goto :eof
- )
- if not "!str:~0,1!"=="" if not "!str:~0,1!"==" " set findW=1
- if !Loading!==10 set Load=
- if !Loading!==20 set Load=.
- if !Loading!==30 set Load=. .
- if !Loading!==40 set Load=. . .
- set/p=<nul
- set/p= !copes!<nul
- title Loading !Load!
- if !Loading!==60 (
- set Loading=0
- ) else (
- set /a Loading+=1
- )
- for /l %%a in (1,1,6) do (
- set /a nn=%%a+1
- if "!o%%a!" == "10" set o%%a=A
- if "!o%%a!" == "11" set o%%a=B
- if "!o%%a!" == "12" set o%%a=C
- if "!o%%a!" == "13" set o%%a=D
- if "!o%%a!" == "14" set o%%a=E
- if "!o%%a!" == "15" set o%%a=F
- if "!o%%a!" == "16" set o%%a=0&call set /a o!nn!=0x%%o!nn!%%+1
- if "!o%%a!" == "-1" set o%%a=F&call set /a o!nn!=0x%%o!nn!%%-1
- )
- set HEX=!o6!!o5!!o4!!o3!!o2!!o1!
- if !HEX!==FF0F0F set digit=4&set FML=+
- if !HEX!==FFFF0F set digit=6&set FML=-
- if !HEX!==0FFF0F set digit=2&set FML=+
- if !HEX!==0FFFFF set digit=4&set FML=-
- if !HEX!==0F0FFF set digit=6&set FML=+
- if !HEX!==FF0FFF set digit=2&set FML=-
- call set /a o!digit!=0x%%o!digit!%%!FML!3
- set /p "var=^<font color^=#!HEX!^>!str:~0,1!^<^/font^>"<nul>>%RBHC%
- set /p "var=[color^=#!HEX!]!str:~0,1!"<nul>>%RBCODE%
- endlocal&set o6=%o6%&set o5=%o5%&set o4=%o4%&set o3=%o3%&set o2=%o2%&set o1=%o1%&set FML=%FML%&set digit=%digit%&set line=%line%&set findW=%findW%&set "loading=%loading%"&set /a strnub+=1&set load=%Load%
- setlocal enabledelayedexpansion
- set "str=!str:~%strnub%,1!"
- goto :Printing2
复制代码
|