|
11
|
Programación / Scripting / Re: [Batch] Aporte Generador Diccionario
|
en: 14 Enero 2012, 19:43 pm
|
Podrian ahorrarse toda esa cantidad de Ciclos FOR anidados haciendo una funcion recursiva, les llevaria menos codigo y seria mas facil tener el control del resultado de la generacion del diccionario o serial.
Saludos.
|
|
|
12
|
Programación / Scripting / Re: Proyecto para los Batcheros
|
en: 28 Diciembre 2011, 18:06 pm
|
Es un malware que se aprovecha de la vulnerabilidad de los accesos directos, pero tambien crea una carpeta en las memorias llamada "RECYCLER" al igual que otros malwares previos... hace un tiempo desarrolle varios scripts de este tipo, aqui os dejo uno que les sirve para la causa, ustedes le podrian hacer la interfaz para que "se vea mas bonito" @Echo Off @title S.M.A.R.T. - RECYCLER FIX @Color 0a
::Clean .LNK and RECYCLER from USB Pendrives ::Coded by SmartGenius / thesmartgenius ::http://smart.code-makers.net
Setlocal enabledelayedexpansion
Echo. Echo. S.M.A.R.T. - RECYCLER FIX Echo. Analisis y Limpieza de Memorias USB Echo. para el Virus RECYCLER (Variante .LNK) Echo. Call :QueryDrives USBDrives Echo. Unidades USB Disponibles: %USBDrives% Echo. Echo. Presione cualquier tecla para iniciar el Analisis Pause >nul For %%U in (%USBDrives%) DO ( If Exist "%%U:" ( Echo. Analizando Disco %%U: If Exist "%%U:\RECYCLER" ( Echo. Echo. Amenaza encontrada en la Unidad "%%U:" Echo. Echo. Por favor espere... Cd %%U:>nul&%%U:&CD\ For /f "tokens=*" %%l in ('dir /b *.lnk') do ( Attrib -h "%%~nl" 2>nul Set /a "Am+=1" Echo. !Am! - %%~nl ) Echo. Del /f /q *.lnk 2>nul Echo. Total Eliminados: !Am! RD /s /q RECYCLER 2>nul ))) Echo. Echo. Analisis Finalizado Echo. Presione cualquier tecla para salir... Echo. Pause>nul&Pause>nul Exit /b 0
:QueryDrives Set "%~1=" Set "HexValue=530054004F00520041" Reg Query HKLM\SYSTEM\MOUNTEDDEVICES | Find "%HexValue%" 9>NUL 1>&9 2>&1 || Set "HexValue=550053004200530054" For /F "delims=\: TOKENS=0X3" %%D in ('Reg Query HKLM\SYSTEM\MOUNTEDDEVICES ^| FIND "%HexValue%"') DO ( VOL %%D: 8>NUL 1>&8 2>&1 && ( Set "TmpD=!TmpD!,%%D" )) Set "%~1=!TmpD:~1!" Goto :Eof Mas info: http://smart.code-makers.net/?p=27Saludos.
|
|
|
13
|
Programación / Scripting / Re: ¿Como instalar este driver de hardware (.INF) en batch o vbs?
|
en: 6 Diciembre 2011, 21:29 pm
|
Ahi lo tienes, guardalo como .BAT y ejecutalo ;@Echo Off&title INF Installer ; ;Set "Code=%~f0" ;:Init ;Cls ;Echo. ;Echo. Instalando Controlador... ;rundll32.exe advpack.dll,LaunchINFSection "%Code%",E2350_Digital.Install ;Ping -n 1 localhost >nul ;Echo. Finalizado ;Pause ;Exit /b 0
::::::::::: Codigo INF ::::
[LG] %E2350_Analog%=E2350_Analog.Install,Monitor\GSM578F %E2350_Digital%=E2350_Digital.Install,Monitor\GSM5790 %E2350_HDMI%=E2350_HDMI.Install,Monitor\GSM5791
[LG.NTamd64] %E2350_Analog%=E2350_Analog.Install,Monitor\GSM578F %E2350_Digital%=E2350_Digital.Install,Monitor\GSM5790 %E2350_HDMI%=E2350_HDMI.Install,Monitor\GSM5791
[E2350_Analog.Install] DelReg=DEL_CURRENT_REG AddReg=E2350_Analog.AddReg,1920,DPMS CopyFiles=E2350_Analog.CopyFiles
[E2350_Digital.Install] DelReg=DEL_CURRENT_REG AddReg=E2350_Digital.AddReg,1920,DPMS CopyFiles=E2350_Digital.CopyFiles
[E2350_HDMI.Install] DelReg=DEL_CURRENT_REG AddReg=E2350_HDMI.AddReg,1920,DPMS CopyFiles=E2350_HDMI.CopyFiles
[DEL_CURRENT_REG] HKR,MODES HKR,,MaxResolution HKR,,DPMS HKR,,ICMProfile
[1920] HKR,,MaxResolution,,"1920,1080"
[DPMS] HKR,,DPMS,,1
[E2350_Analog.AddReg] HKR,"MODES\1920,1080",Mode1,,"30.0-83.0,56.0-75.0,+,+" HKR,,PreferredMode,,"1920,1080,60" HKR,,ICMprofile,0,"E2350.ICM"
[E2350_Digital.AddReg] HKR,"MODES\1920,1080",Mode1,,"30.0-83.0,56.0-75.0,+,+" HKR,,PreferredMode,,"1920,1080,60" HKR,,ICMprofile,0,"E2350.ICM"
[E2350_HDMI.AddReg] HKR,"MODES\1920,1080",Mode1,,"30.0-83.0,56.0-61.0,+,+" HKR,,PreferredMode,,"1920,1080,60" HKR,,ICMprofile,0,"E2350.ICM"
[E2350_Analog.CopyFiles] E2350.ICM
[E2350_Digital.CopyFiles] E2350.ICM
[E2350_HDMI.CopyFiles] E2350.ICM
[Strings] DiskName="LG Monitor Profiles Installation Disk" LG="LG" E2350_Analog="LG E2350(Analog)" E2350_Digital="LG E2350(Digital)" E2350_HDMI="LG E2350(HDMI)"
Saludos.
|
|
|
14
|
Programación / Scripting / Re: [RETO+PYTHON] A ver quien la tiene mas corta...
|
en: 16 Diciembre 2010, 23:40 pm
|
Lo hice en batch (ya saben, me gustan los retos ) @Echo Off Setlocal enabledelayedexpansion Title Number to Roman Conversion
::Coded by SmartGenius
Set "R=1" Set "R_1=. M MM MMM" Set "R_2=. C CC CCC CD D DC DCC DCCC CM" Set "R_3=. X XX XXX XL L LX LXX LXXX XC" Set "R_4=. I II III IV V VI VII VIII IX"
:Input Set /p "N=Enter Number > " If Not Defined N Cls & Goto :Input If 0 GEQ %N% (Echo.Fuera de Rango&Goto :Input) If 3999 LSS %N% (Echo.Fuera de Rango&Goto :Input)
:Split Set /a "M_O=N%%10" Set /a "M_T=(N%%100)-M_O" Set /a "M_C=(N%%1000)-(M_T+M_O)" Set /a "M_M=N-(M_C+M_T+M_O)"
:Convert Set "Sp= %M_M:~0,1%%M_C:~0,1%%M_T:~0,1%%M_O:~0,1%" :R_to_N If 5 EQU %R% (Set "RF=!RF:.=!"&Goto :Show) Set /a "T=!Sp:~%R%,1!+1" For /f "tokens=%T%" %%b in ('Echo.!R_%R%!') do (Set "RF=!RF!%%b") Set /a "R+=1" Goto :R_to_N
:Show Echo. Number = %N% Echo. Roman = %RF% Echo. Pause Exit Aunque obviamente con las capacidaddes de los otros lenguajes se hace mas corto el codigo xD Saludos.
|
|
|
17
|
Programación / Scripting / Re: [Pregunta]Manejo de gráficos: métodos
|
en: 9 Agosto 2010, 07:39 am
|
Sin coordenadas no puedes hacer nada, como ubicas algo para dibujarlo en pantalla ?. En la CMD tienes por defecto un plano de 80x25 cuadros, y por defecto no hay nada para manejarse en eso, luego el tema de las coordenadas es importante, aplicarlo netamente en batch, ya luego estan los comandos externos que te han comentado antes, pero todos usan ese sistema, y en general pienso que cualquier lenguaje lo hace.
|
|
|
18
|
Programación / Scripting / [Batch Game] Tetris v 1 - by SmartGenius
|
en: 2 Agosto 2010, 21:26 pm
|
[Batch Game] Tetris v 1 - by SmartGenius Pensaron que era imposible hacerlo, o que consumiria una cantidad inmensa de lineas de codigo y que seria dificil controlarlo todo, y mas aun en Batch que no es un "lenguaje", pero para mi nada de eso vale 8) Descargar: http://smart.code-makers.net/BatchGames/TetrisBatchBySmartGenius.zipYa lo saben, el clasico juego del Tetris, ahora en Batch, usan las teclas A,S,D,R,X, en el mismo juego se explica como funciona, no anda solo, pero eso se acomoda con el CHOICE, salen todas las figuras y tambien rotan, tiene sus reglas para los movimientos, lo hice a modo de prueba pero es totalmente funcional, los invito a probarlo @Echo off @title Tetris v 1 @mode con cols=28 lines=24
:: Batch Game - Tetris v 1 :: Proof Of Concept :: Coded by SmartGenius :: SmartGenius, Corp. 2010
Choice /N /T:Y,1 >Nul 2>&1 If "%Errorlevel%"=="9009" (Echo. CHOICE command not found&Pause&Exit)
Set "Game=%0"
Call :Logo
:Menu Cls Echo. Echo. Echo. Tetris v 1 by SmartGenius Echo. ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ Echo. ³1.³ ³Play TETRIS ³ Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ Echo. ³2.³ ³How to Play ³ Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ Echo. ÚÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ Echo. ³3.³ ³Exit Game ³ Echo. ÀÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ Echo. CHOICE /C:123 /N >nul If "%errorlevel%"=="1" (Goto :Load) If "%errorlevel%"=="2" (Goto :Help) If "%errorlevel%"=="3" (Goto :End) Goto :Menu
:Load Setlocal enabledelayedexpansion Set /a "LimX=18","LimY=16","TBound=1","LBound=0","Turn=1","Points=0" Set /a "RBound=%LimX%","BBound=%LimY%"
:Init For /l %%a in (0,1,%LimX%) do ( For /l %%b in (0,1,%LimY%) do ( Set "X%%aY%%b= ")) Set "Bound=Û" Set "Bound2=²"
:Main Set /a "L=(%Random% %% 7)+1" Call :Figure%L% Call :Graphic Goto :Main
:Graphic Call :Clear Call :CheckL2 If "%New_F%"=="True" ( Call :Solid Set "New_F=False" Goto :Eof ) Cls Echo. Echo. Tetris v 1 by SmartGenius Echo. Echo. Points:%Points% Echo. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» For /l %%f in (0,1,%LimY%) do (Echo. º!Lin_%%f!º) Echo. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Call :Move Goto :Graphic
:Move :: Normal CHOICE (provided into ZIP package) CHOICE /C:SADRXC /N >nul :: Windows 7 or x64 system CHOICE (uncomment) REM CHOICE /C SADRXC /N If "%errorlevel%"=="1" (Call :Down) If "%errorlevel%"=="2" (Call :Left) If "%errorlevel%"=="3" (Call :Rigth) If "%errorlevel%"=="4" (Call :Rotate) If "%errorlevel%"=="5" (Goto :Menu) If "%errorlevel%"=="6" (Call :MovCR) ::Descomentar para doble movimiento REM Call :Down Goto :Eof
:::::::::::::::::::::::::::::::::::::::: :Solid For %%a in (%Table%) do (Set "%%a=%Bound2%") Goto :Eof
:Rotate Set "TmpTB=" If "%XToken%"=="11" (Set "XToken=10") If "%YToken%"=="15" (Set "XToken=14") Set /a "NextRotate=(%RotateLevel% %% 4)+1" Set "TmpTable=!Figure%CurFig%_Pos%NextRotate%! For %%R in (%TmpTable%) do ( Call :MovR "%YToken%" "%XToken%" "%%R" "Val" Call Set "TmpTB=!TmpTB!,!Val!" ) For %%c in (%TmpTB:~1%) do ( If "!%%c!"=="%Bound2%" ( For %%b in (%Table%) do (Set "%%b=%Bound%") Goto :Eof )) For %%a in (%Table%) do (Set "%%a= ") Set "Table=%TmpTB:~1%" For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "RotateLevel+=1" Goto :Eof
:MovR For /f "tokens=1,2 delims=X,Y" %%p in ("%~3") do ( Set /a MovY=%%q+%~1 Set /a MovX=%%p+%~2 Set "%~4=X!MovX!Y!MovY!" Set "%~3= ") Goto :Eof
::::::::::::::::::::::::::::::::::::::::::: :Down Set "TmpTB=" Set "TmpTable=%Table%" For %%a in (%TmpTable%) do ( Echo.!TmpTable!|Find "Y%BBound%">nul If !Errorlevel! EQU 0 (Set "New_F=True"&Goto :Eof) Call :MovYR "1" "%%a" "Val" Call Set "TmpTB=!TmpTB!,!Val!" ) For %%c in (%TmpTB:~1%) do ( If "!%%c!"=="%Bound2%" ( Set "New_F=True" For %%b in (%Table%) do (Set "%%b=%Bound%") Goto :Eof )) Set "Table=%TmpTB:~1%" For %%d in (%Table%) do (Set "%%d=%Bound%") Set /a "YToken+=1" Goto :Eof
:MovYR For /f "tokens=1,2 delims=X,Y" %%p in ("%~2") do ( Set /a MovY=%%q+%~1 Set "%~3=X%%pY!MovY!" Set "%~2= ") Goto :Eof
:MovCR Cls Echo. Echo. Call :L2 "Goto :Eof" Echo. For /f "tokens=2 skip=3" %%c in ('find "::_0" %Game%') do ( Set "Tmp_Var=%%c" Call :Key.A Tmp_Var Echo. !Tmp_Var! ) Pause >nul Goto :Eof ::::::::::::::::::::::::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::: :Rigth Set "TmpTB=" Set "TmpTable=%Table%" For %%a in (%TmpTable%) do ( Echo.!TmpTable!|Find "X%RBound%">nul If !Errorlevel! EQU 0 (Goto :Eof) Call :MovXR "+1" "%%a" "Val" Call Set "TmpTB=!TmpTB!,!Val!" ) For %%c in (%TmpTB:~1%) do ( If "!%%c!"=="%Bound2%" ( For %%b in (%Table%) do (Set "%%b=%Bound%") Goto :Eof )) Set "Table=%TmpTB:~1%" For %%d in (%Table%) do (Set "%%d=%Bound%") Set /a "XToken+=1" Goto :Eof
:Left Set "TmpTB=" Set "TmpTable=%Table%" For %%a in (%TmpTable%) do ( Echo.!TmpTable!|Find "X%LBound%">nul If !Errorlevel! EQU 0 (Goto :Eof) Call :MovXR "-1" "%%a" "Val" Call Set "TmpTB=!TmpTB!,!Val!" ) For %%c in (%TmpTB:~1%) do ( If "!%%c!"=="%Bound2%" ( For %%b in (%Table%) do (Set "%%b=%Bound%") Goto :Eof )) Set "Table=%TmpTB:~1%" For %%d in (%Table%) do (Set "%%d=%Bound%") Set /a "XToken-=1" Goto :Eof
:MovXR For /f "tokens=1,2 delims=X,Y" %%p in ("%~2") do ( Set /a MovX=%%p%~1 Set "%~3=X!MovX!Y%%q" Set "%~2= ") Goto :Eof
:::::::::::::::::::::::::::::::::::::::: :CheckL2 Echo.%Lin_1%|Find "%Bound2%">nul If !Errorlevel! EQU 0 (Goto :Lost)
Echo.!Lin_%LimY%!|Find " ">nul If !Errorlevel! EQU 0 (Goto :Eof)
Call :Solid
For /l %%x in (0,1,%LimX%) do ( For /l %%y in (%LimY%,-1,1) do ( Set /a "UpLine=%%y-1" Call Set "X%%xY%%y=%%X%%xY!UpLine!%%" )) Set /a "Points+=100" For /l %%d in (0,1,%LimX%) do (Set "X%%dY0= ") Call :Clear Goto :CheckL2
:::::::::::::::::::::::::::::::::::::::::
:Key.A If not defined %1 Goto:Eof Set "c=" Set "d=0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz =/\()[]{}_-.:,;* @#" :Key.B Set "chr=!%1:~,1!" For /l %%l in (0 1 80) do if "!chr!" equ "!d:~%%l,1!" ( set /a "x=%%l^5" call set "c=!c!%%d:~!x!,1%%" ) Set "%1=!%1:~1!" If defined %1 goto:Key.B Set "%1=!c!" Goto :Eof :::::::::::::::::::::::::::::::::::::::::
:Clear For /l %%m in (0,1,%LimY%) do (Set Lin_%%m=) For /l %%d in (0,1,%LimY%) do ( For /l %%e in (0,1,%LimX%) do ( Set Lin_%%d=!Lin_%%d!!X%%eY%%d!)) Goto :Eof
:Lost Cls Echo. Echo. Tetris v 1 by SmartGenius Echo. Echo. Has Perdido ! Echo. Echo. Points:%Points% Echo. Goto :End
:Win Cls Echo. Echo. Tetris v 1 by SmartGenius Echo. Echo. Points:%Points% Echo. Has Ganado ! Goto :End
:End Echo. Echo. Gracias por Jugar Echo. Tetris v1 by SmartGenius Endlocal Ping -n 3 localhost >nul Exit
:::::::::::::::::::::::::::::::::::::::::: :Figure1 Set Figure1_Pos1=X6Y2,X6Y1,X7Y1,X7Y0 Set Figure1_Pos2=X7Y1,X8Y1,X6Y0,X7Y0 Set Figure1_Pos3=X6Y2,X6Y1,X7Y1,X7Y0 Set Figure1_Pos4=X7Y1,X8Y1,X6Y0,X7Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure1_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=1","RotateLevel=%R%" Goto :Eof
:Figure2 Set Figure2_Pos1=X7Y2,X6Y1,X7Y1,X6Y0 Set Figure2_Pos2=X6Y1,X7Y1,X7Y0,X8Y0 Set Figure2_Pos3=X7Y2,X6Y1,X7Y1,X6Y0 Set Figure2_Pos4=X6Y1,X7Y1,X7Y0,X8Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure2_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=2","RotateLevel=%R%" Goto :Eof
:Figure3 Set Figure3_Pos1=X7Y1,X8Y1,X7Y0,X8Y0 Set Figure3_Pos2=X7Y1,X8Y1,X7Y0,X8Y0 Set Figure3_Pos3=X7Y1,X8Y1,X7Y0,X8Y0 Set Figure3_Pos4=X7Y1,X8Y1,X7Y0,X8Y0 Set /a "R=(%Random% %% 4)+1" Set "Table=!Figure3_Pos%R%!" For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=3","RotateLevel=%R%" Goto :Eof
:Figure4 Set Figure4_Pos1=X6Y1,X7Y1,X8Y1 Set Figure4_Pos2=X7Y2,X7Y1,X7Y0 Set Figure4_Pos3=X6Y1,X7Y1,X8Y1 Set Figure4_Pos4=X7Y2,X7Y1,X7Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure4_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=4","RotateLevel=%R%" Goto :Eof
:Figure5 Set Figure5_Pos1=X6Y1,X7Y1,X8Y1,X7Y0 Set Figure5_Pos2=X7Y2,X7Y1,X8Y1,X7Y0 Set Figure5_Pos3=X7Y1,X6Y0,X7Y0,X8Y0 Set Figure5_Pos4=X8Y2,X7Y1,X8Y1,X8Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure5_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=5","RotateLevel=%R%" Goto :Eof
:Figure6 Set Figure6_Pos1=X6Y1,X6Y0,X7Y0,X8Y0 Set Figure6_Pos2=X8Y2,X8Y1,X8Y0,X7Y0 Set Figure6_Pos3=X6Y1,X7Y1,X8Y1,X8Y0 Set Figure6_Pos4=X6Y2,X7Y2,X6Y1,X6Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure6_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=6","RotateLevel=%R%" Goto :Eof
:Figure7 Set Figure7_Pos1=X8Y1,X6Y0,X7Y0,X8Y0 Set Figure7_Pos2=X7Y2,X8Y2,X8Y1,X8Y0 Set Figure7_Pos3=X6Y1,X7Y1,X8Y1,X6Y0 Set Figure7_Pos4=X6Y2,X6Y1,X6Y0,X7Y0 Set /a "R=(%Random% %% 4)+1" Set Table=!Figure7_Pos%R%! For %%b in (%Table%) do (Set "%%b=%Bound%") Set /a "XToken=0","YToken=0","CurFig=7","RotateLevel=%R%" Goto :Eof
::_0 xx9tYjYxWvxPrXmoLjqfzpxx ::_0 xxxxxXhXxLBINRPFGBaxxxxxx ::_0 xxxxxxxxxxxxxxxxxxxxxxxxx ::_0 xxxxx8jYfZXojYxOtxJvxxxxx ::_0 EjXzofizgxLfmgimfjqYx9GVJ ::_0 xxxJvx8XmgfqlxNxGtyjxRxxx ::_0 xxxxxxxxxxxxxxxxxxxxxxxxx ::_0 xPrXmoLjqfzpx9tms-x7545xxx
:Help Cls Echo. Call :L2 "Goto :Eof" Echo. Echo. How to Play Batch Tetris ? Echo. Echo. Use keys A,S,D,R,X Echo. Echo. A = Move Shape Left Echo. S = Move Shape Down Echo. D = Move Shape Rigth Echo. R = Rotate Shape Echo. X = Back to Menu Game Echo. Echo. Pause >nul Goto :Menu
:Logo Cls Color 0b Echo. Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° :L2 Echo. °°ÛÛÛ°ÛÛÛ°ÛÛÛ°ÛÛ°°Û°°ÛÛ°°° Echo. °°°Û°°Û°°°°Û°°Û°Û°Û°Û°°°°° Echo. °°°Û°°ÛÛÛ°°Û°°ÛÛ°°Û°°Û°°°° Echo. °°°Û°°Û°°°°Û°°Û°Û°Û°°°Û°°° Echo. °°°Û°°ÛÛÛ°°Û°°Û°Û°Û°ÛÛ°°°° %~1 Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°±°°°°°°°°°²°°°°°°°°°°±°° Echo. °°±°²°°°²²°°²²°°°²²²°°°±°° Echo. °°±°²²°°°²°°²°°°°°°°°°°±°° Echo. °°±°°²°°°²°°°°°°²²°°°°°±°° Echo. °°±°°°°°°°°°°°°°°²²°°°°±°° Echo. °°±°°°°°°°°²°°°°°°°°°°°±°° Echo. °°±²°°°°°°°²²²°°°°°°°°°±°° Echo. °°±²°°²²°°°°°°°²°°°°°°²±°° Echo. °°±²°°²²°°°°°°²²²°°°²²²±°° Echo. °°±±±±±±±±±±±±±±±±±±±±±±°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°: SmartGenius :°°°°°° Echo. °°°°° Corp. 2010 °°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Ping -n 3 0.0.0.0 >nul Goto :Eof
Espero que les guste, cualquier comentario o sugerencia son bien recibidos. Saludos. 8)
|
|
|
19
|
Programación / Scripting / [Batch Game] Block Breaker (BRIX) - by SmartGenius
|
en: 1 Agosto 2010, 01:06 am
|
[Batch Game] Block Breaker (BRIX) - by SmartGeniusDescargar: http://smart.code-makers.net/BatchGames/BlockBreakerv1BySmartgenius.zipCreo que este juego ya lo conocen, es un clasico en el cual mueven una plataforma con una pelota y el objetivo es hacerla rebotar y que vaya agarrando puntos o bloques, la imagen lo dice todo He hecho dos versiones, una en Batch usando CHOICE.COM y el sistema de coordenadas, y el otro es el mismo juego pero agregando el comando COLOUS para que el juego salga a color y sin parpadeos de pantalla. Manejan la tabla con las teclas A (Izquierda) D (Derecha) W (Lanzar / Acelerar pelota ) y con X salen del juego. Codigo version normal: @Echo off @title BlockBreaker v 1 @mode con cols=28 lines=24
:: Batch Game - BlockBreaker v 1 :: Coded by SmartGenius :: SmartGenius, Corp. 2010
If not exist "choice.com" (Goto :NoKey)
:Load Call :Logo Setlocal enabledelayedexpansion Set /a "LimX=18","LimY=16","TBound=1","LBound=1" Set /a "RBound=%LimX%-1" Set /a "BBound=%LimY%-3" Set NLevels=1
:Init For /l %%a in (0,1,%LimX%) do ( For /l %%b in (0,1,%LimY%) do ( Set X%%aY%%b= )) Set Ball=O Set Bound=Û Set Line=Û Set Lost=ù Set Point=*
:Levels Set /a L+=1 Call :Level%L% Call :Graphic Set P%L%=%Movs% If "%LOS%"=="True" Goto :Lost If "%WIN%"=="True" Goto :Win If "%NXL%"=="True" Goto :End If "%L%"=="%NLevels%" Goto :Win ping -n 1 0.0.0.0 >nul Goto :Init
:Graphic Call :Clear Cls For /l %%d in (0,1,%LimY%) do ( For /l %%e in (0,1,%LimX%) do ( Set Lin_%%d=!Lin_%%d!!X%%eY%%d!)) Echo. Echo. BlockBreaker v 1 by Smart Echo. Echo. Lives:%Lives% Points:%Points% Echo. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» For /l %%f in (0,1,%LimY%) do (Echo. º!Lin_%%f!º) Echo. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Call :%Action% If "%Lives%"=="0" (Set LOS=True&Set NXL=True) If "%Dots%"=="0" (Set WIN=True&Set NXL=True) If "%NXL%"=="True" (Goto :Eof) Goto :Graphic
:Paused CHOICE /C:WADX /N >nul If "%errorlevel%"=="1" (Set Action=Playing) If "%errorlevel%"=="2" (call :LeftA) If "%errorlevel%"=="3" (call :RightA) If "%errorlevel%"=="4" (Set NXL=True) Goto :Eof
:Playing CHOICE /C:WADX /N /T:W,1 >nul If "%errorlevel%"=="1" (Set Action=Playing) If "%errorlevel%"=="2" (call :LeftB) If "%errorlevel%"=="3" (call :RightB) If "%errorlevel%"=="4" (Set NXL=True) Call :MovBall Goto :Eof
:RightA If ["%Table%"]==["%MaxTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX+ "%%u" "%%v" TB "!%%u!" call Set NewTable=!TB!,%Table% For /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable! call :MovAX+ "%CurPos%" "%CurPos%" CurPos "!%CurPos%!" ) Goto :Eof
:RightB If ["%Table%"]==["%MaxTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX+ "%%u" "%%v" TB "!%%u!" call Set NewTable=!TB!,%Table% For /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable!) Goto :Eof
:LeftA If ["%Table%"]==["%MinTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX- "%%v" "%%u" TB "!%%v!" call Set NewTable=%Table%,!TB! For /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable! call :MovAX- "%CurPos%" "%CurPos%" CurPos "!%CurPos%!" ) Goto :Eof
:LeftB If ["%Table%"]==["%MinTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX- "%%v" "%%u" TB "!%%v!" call Set NewTable=%Table%,!TB! For /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable!) Goto :Eof
:MovAX+ For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 call Set NMovX=%%X!MovX!Y%%q%% If "!NMovX!"=="%Bound%" (Goto :Eof) If "!NMovX!"==" " ( Set %~2= Set X!MovX!Y%%q=%~4 Set %3=X!MovX!Y%%q)) Goto :Eof
:MovAX- For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 call Set NMovX=%%X!MovX!Y%%q%% If "!NMovX!"=="%Bound%" (Goto :Eof) If "!NMovX!"==" " ( Set %~2= Set X!MovX!Y%%q=%~4 Set %3=X!MovX!Y%%q)) Goto :Eof
:MovBall Set EOM=False Call :%NextMov% "%CurPos%" If "%EOM%"=="True" Goto :Eof Goto :MovBall
:Diag1 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 Set /a MovY=%%q+1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%BBound%" (Set NextMov=Diag3) If "%%p"=="%RBound%" (Set NextMov=Diag4) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!= " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q= " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!= " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"==" " ( Set %~1= Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set %~1= Set /a Lives-=1 call :ReSet Set EOM=True) ) Goto :Eof
:Diag2 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 Set /a MovY=%%q-1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%TBound%" (Set NextMov=Diag4) If "%%p"=="%LBound%" (Set NextMov=Diag3) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!= " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q= " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!= " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"==" " ( Set %~1= Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set %~1= Set /a Lives-=1 call :ReSet Set EOM=True) ) Goto :Eof
:Diag3 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 Set /a MovY=%%q-1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%TBound%" (Set NextMov=Diag1) If "%%p"=="%RBound%" (Set NextMov=Diag2) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!= " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q= " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!= " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"==" " ( Set %~1= Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set %~1= Set /a Lives-=1 call :ReSet Set EOM=True) ) Goto :Eof
:Diag4 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 Set /a MovY=%%q+1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%BBound%" (Set NextMov=Diag2) If "%%p"=="%LBound%" (Set NextMov=Diag1) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!= " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q= " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!= " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"==" " ( Set %~1= Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set %~1= Set /a Lives-=1 call :ReSet Set EOM=True) ) Goto :Eof
:Clear For /l %%m in (0,1,%LimY%) do (Set Lin_%%m=) Goto :Eof
:Reset Set CurPos=X8Y13 Set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14 For /l %%h in (1,1,17) do (Set X%%hY14= ) For %%k in (%Init%) do (Set %%k=%Line%) For /f "tokens=1 delims=," %%j in ("%Init%") do (Set %%j=%Ball%) Set Action=Paused Goto :Eof
:Lost msg * Perdiste ! Goto :End
:Win msg * Has Ganado ! Goto :End
:End msg * Gracias por Jugar BlockBreaker v1 by SmartGenius Endlocal Exit
:Level1 Set /a "Movs=0","Points=0","Dots=36","Lives=3" Set CurPos=X8Y13 Set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14 Set MaxTable=X17Y14,X16Y14,X15Y14,X14Y14,X13Y14 Set MinTable=X5Y14,X4Y14,X3Y14,X2Y14,X1Y14 Set Init=X8Y13,X6Y14,X7Y14,X8Y14,X9Y14,X10Y14 Set Dir=N Set Action=Paused Set NextMov=Diag3 For /l %%e in (%LBound%,1,%RBound%) do (Set X%%eY1= ) For /l %%f in (6,1,10) do (Set X%%fY2=%Bound%) For %%k in (%Init%) do (Set %%k=%Line%) For /f "tokens=1 delims=," %%j in ("%Init%") do (Set %%j=%Ball%) For /l %%i in (0,1,%LimX%) do ( Set X0Y%%i=%Bound% Set X%LimX%Y%%i=%Bound% Set X%%iY0=%Bound% Set X%%iY%LimY%=%Bound%) For /l %%l in (2,1,16) do (Set X%%lY2=%Point%) For /l %%m in (4,1,14) do (Set X%%mY3=%Point%) For /l %%n in (6,1,12) do (Set X%%nY4=%Point%) For /l %%o in (8,1,10) do (Set X%%oY5=%Point%) For /l %%r in (1,1,17) do (Set X%%rY15=%Lost%) Goto :Eof
:Logo Cls Color 0b Echo. Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°ÛÛÛ°°Û°°°ÛÛÛ°°ÛÛ°Û°°Û°° Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°° Echo. °°°ÛÛÛ°°Û°°°Û°Û°Û°°°ÛÛ°°°° Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°° Echo. °°°ÛÛÛ°°ÛÛÛ°ÛÛÛ°°ÛÛ°Û°°Û°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°B°R°E°A°K°E°R°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°±°±°±°±°±°±°±°±°±°±°±°° Echo. °°±°±°±°±°±°±°±°±°±°±°±°°° Echo. °°°±°±°±°±°±°±°±°±°±°±°±°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°²°°°°°°°°°°°°°°°°°°° Echo. °°°°ÛÛÛÛÛ°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°: SmartGenius :°°°°°° Echo. °°°°° Corp. 2010 °°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° ping -n 3 0.0.0.0 >nul Goto :Eof
:NoKey @mode con cols=30 lines=20 cls Echo. Echo Uno de los archivos necesarios para el Echo funcionamiento de este Script no se Echo encuentra. Echo. Echo CHOICE.COM Echo. Echo Por favor descargue una copia del Comando Echo CHOICE de Internet... Echo. pause exit
Y aqui el codigo de la version colorida del juego @Echo off @title BlockBreaker v 1 @mode con cols=28 lines=24
:: Batch Game - BlockBreaker v 1 Colored Version :: Coded by SmartGenius :: SmartGenius, Corp. 2010
If not exist "choice.com" (Goto :NoKey)
:Load Call :Logo Setlocal enabledelayedexpansion Set /a "LimX=18","LimY=16","TBound=1","LBound=1" Set /a "RBound=%LimX%-1" Set /a "BBound=%LimY%-3" Set NLevels=1
:Init For /l %%a in (0,1,%LimX%) do ( For /l %%b in (0,1,%LimY%) do ( Set "X%%aY%%b=[0] ")) Set "Ball=[9]O" Set "Bound=[5]$219" Set "Line=[6]$219" Set "Lost=[2]$176" Set "Point=[12]*"
:Levels Set /a L+=1 Call :Level%L% Call :Graphic Set P%L%=%Movs% If "%LOS%"=="True" Goto :Lost If "%WIN%"=="True" Goto :Win If "%NXL%"=="True" Goto :End If "%L%"=="%NLevels%" Goto :Win ping -n 1 0.0.0.0 >nul Goto :Init
:Graphic Call :Clear Cls For /l %%d in (0,1,%LimY%) do ( For /l %%e in (0,1,%LimX%) do ( Set Lin_%%d=!Lin_%%d!!X%%eY%%d!)) Echo. Echo. BlockBreaker v 1 by Smart Echo. Echo. Lives:%Lives% Points:%Points% Echo. ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» For /l %%f in (0,1,%LimY%) do (Colous Writesec "[0] [11]$186!Lin_%%f![11]$186") Echo. ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ Goto :%Action%
:Check Colous 11 0 22,4 "%Points%" If "%Lives%"=="0" (Goto :Lost) If "%Dots%"=="0" (Goto :Win) If "%NXL%"=="True" (Goto :End) Goto :Eof
:Paused CHOICE /C WADX /N >nul If "%errorlevel%"=="1" (Set Action=Playing) If "%errorlevel%"=="2" (call :LeftA) If "%errorlevel%"=="3" (call :RightA) If "%errorlevel%"=="4" (Set NXL=True) Call :Check Goto :%Action%
:Playing CHOICE /C WADX /N /T:W,1 >nul If "%errorlevel%"=="1" (Set Action=Playing) If "%errorlevel%"=="2" (call :LeftB) If "%errorlevel%"=="3" (call :RightB) If "%errorlevel%"=="4" (Set NXL=True) Call :MovBall Call :Check Goto :%Action%
:RightA If ["%Table%"]==["%MaxTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( Call :MovAX+ "%%u" "%%v" TB "!%%u!" Call Set NewTable=!TB!,%Table% For /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable! Call :MovAX+ "%CurPos%" "%CurPos%" CurPos "!%CurPos%!" ) Goto :Eof
:LeftA If ["%Table%"]==["%MinTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( Call :MovAX- "%%v" "%%u" TB "!%%v!" call Set NewTable=%Table%,!TB! For /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable! Call :MovAX- "%CurPos%" "%CurPos%" CurPos "!%CurPos%!" ) Goto :Eof
:RightB If ["%Table%"]==["%MaxTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX+ "%%u" "%%v" TB "!%%u!" call Set NewTable=!TB!,%Table% For /f "tokens=1-5 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable!) Goto :Eof
:LeftB If ["%Table%"]==["%MinTable%"] (Goto :Eof) For /f "tokens=1,5 delims=," %%u in ("%Table%") do ( call :MovAX- "%%v" "%%u" TB "!%%v!" call Set NewTable=%Table%,!TB! For /f "tokens=2-6 delims=," %%t in ("!NewTable!") do (Set NewTable=%%t,%%u,%%v,%%w,%%x) Set Table=!NewTable!) Goto :Eof
:MovAX+ For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 call Set NMovX=%%X!MovX!Y%%q%% If "!NMovX!"=="%Bound%" (Goto :Eof) If "!NMovX!"=="[0] " ( Call :Color %2 "[0] " Set "%~2=[0] " Set X!MovX!Y%%q=%~4 Set %3=X!MovX!Y%%q Call :Color !%3! "%%!%3!%%" )) Goto :Eof
:MovAX- For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 call Set NMovX=%%X!MovX!Y%%q%% If "!NMovX!"=="%Bound%" (Goto :Eof) If "!NMovX!"=="[0] " ( Call :Color %2 "[0] " Set "%~2=[0] " Set X!MovX!Y%%q=%~4 Set %3=X!MovX!Y%%q Call :Color !%3! "%%!%3!%%" )) Goto :Eof
:MovBall Set EOM=False Call :%NextMov% "%CurPos%" If "%EOM%"=="True" Goto :Eof Goto :MovBall
:Color For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do (Set /a "ColX=%%p+5"&Set /a "ColY=%%q+6") Set "Symbol=%~2" rem Echo.%Symbol% Colous %Symbol:~1,1% 0 %ColX%,%ColY% "%Symbol:~3%" Colous Cursoroff Goto :Eof
:Diag1 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 Set /a MovY=%%q+1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%BBound%" (Set NextMov=Diag3) If "%%p"=="%RBound%" (Set NextMov=Diag4) Goto :Eof)
If "!NMovXY!"=="%Line%" ( If "%%q"=="%BBound%" (Set NextMov=Diag3) If "%%p"=="%RBound%" (Set NextMov=Diag4) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!=[0] " Call :Color "X%%pY!MovY!" "[0] " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q=[0] " Call :Color "X!MovX!Y%%q" "[0] " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!=[0] " Call :Color "X!MovX!Y!MovY!" "[0] " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"=="[0] " ( Call :Color "%~1" "[0] " Set "%~1=[0] " Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Call :Color "!CurPos!" "%Ball%" Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set "%~1=[0] " Set /a Lives-=1 Goto :ReSet ) ) Goto :Eof
:Diag2 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 Set /a MovY=%%q-1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%TBound%" (Set NextMov=Diag4) If "%%p"=="%LBound%" (Set NextMov=Diag3) Goto :Eof)
If "!NMovXY!"=="%Line%" ( If "%%q"=="%TBound%" (Set NextMov=Diag4) If "%%p"=="%LBound%" (Set NextMov=Diag3) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!=[0] " Call :Color "X%%pY!MovY!" "[0] " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q=[0] " Call :Color "X!MovX!Y%%q" "[0] " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!=[0] " Call :Color "X!MovX!Y!MovY!" "[0] " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"=="[0] " ( Call :Color "%~1" "[0] " Set "%~1=[0] " Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Call :Color "!CurPos!" "%Ball%" Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set "%~1=[0] " Set /a Lives-=1 Goto :ReSet ) ) Goto :Eof
:Diag3 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p+1 Set /a MovY=%%q-1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%TBound%" (Set NextMov=Diag1) If "%%p"=="%RBound%" (Set NextMov=Diag2) Goto :Eof)
If "!NMovXY!"=="%Line%" ( If "%%q"=="%TBound%" (Set NextMov=Diag1) If "%%p"=="%RBound%" (Set NextMov=Diag2) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!=[0] " Call :Color "X%%pY!MovY!" "[0] " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q=[0] " Call :Color "X!MovX!Y%%q" "[0] " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!=[0] " Call :Color "X!MovX!Y!MovY!" "[0] " Set NextMov=Diag4 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"=="[0] " ( Call :Color "%~1" "[0] " Set "%~1=[0] " Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Call :Color "!CurPos!" "%Ball%" Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set "%~1=[0] " Set /a Lives-=1 Goto :ReSet ) ) Goto :Eof
:Diag4 For /f "tokens=1,2 delims=X,Y" %%p in ("%~1") do ( Set /a MovX=%%p-1 Set /a MovY=%%q+1 call Set NMovX=%%X!MovX!Y%%q%% call Set NMovY=%%X%%pY!MovY!%% call Set NMovXY=%%X!MovX!Y!MovY!%%
If "!NMovXY!"=="%Bound%" ( If "%%q"=="%BBound%" (Set NextMov=Diag2) If "%%p"=="%LBound%" (Set NextMov=Diag1) Goto :Eof)
If "!NMovXY!"=="%Line%" ( If "%%q"=="%BBound%" (Set NextMov=Diag2) If "%%p"=="%LBound%" (Set NextMov=Diag1) Goto :Eof)
If "!NMovY!"=="%Point%" ( Set "X%%pY!MovY!=[0] " Call :Color "X%%pY!MovY!" "[0] " Set NextMov=Diag2 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovX!"=="%Point%" ( Set "X!MovX!Y%%q=[0] " Call :Color "X!MovX!Y%%q" "[0] " Set NextMov=Diag1 Set /a Points+=5 Set /a Dots-=1 Goto :Eof ) If "!NMovXY!"=="%Point%" ( Set "X!MovX!Y!MovY!=[0] " Call :Color "X!MovX!Y!MovY!" "[0] " Set NextMov=Diag3 Set /a Points+=5 Set /a Dots-=1 Goto :Eof )
If "!NMovXY!"=="[0] " ( Call :Color "%~1" "[0] " Set "%~1=[0] " Set X!MovX!Y!MovY!=%Ball% Set CurPos=X!MovX!Y!MovY! Call :Color "!CurPos!" "%Ball%" Set EOM=True) )
If "!NMovXY!"=="%Lost%" ( Set "%~1=[0] " Set /a Lives-=1 Goto :ReSet ) ) Goto :Eof
:Clear For /l %%m in (0,1,%LimY%) do (Set Lin_%%m=) Goto :Eof
:Reset Set CurPos=X8Y13 Set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14 For /l %%h in (1,1,17) do (Set "X%%hY14=[0] ") For %%k in (%Init%) do (Set %%k=%Line%) For /f "tokens=1 delims=," %%j in ("%Init%") do (Set %%j=%Ball%) Set Action=Paused Call :Check Goto :Graphic
:Lost msg * Perdiste ! Goto :End
:Win msg * Has Ganado ! Goto :End
:End msg * Gracias por Jugar BlockBreaker v1 by SmartGenius Endlocal Exit
:Level1 Set /a "Movs=0","Points=0","Dots=36","Lives=3" Set CurPos=X8Y13 Set Table=X10Y14,X9Y14,X8Y14,X7Y14,X6Y14 Set MaxTable=X17Y14,X16Y14,X15Y14,X14Y14,X13Y14 Set MinTable=X5Y14,X4Y14,X3Y14,X2Y14,X1Y14 Set Init=X8Y13,X6Y14,X7Y14,X8Y14,X9Y14,X10Y14 Set Dir=N Set Action=Paused Set NextMov=Diag3 For /l %%e in (%LBound%,1,%RBound%) do (Set "X%%eY1=[0] ") For /l %%f in (6,1,10) do (Set "X%%fY2=%Bound%") For %%k in (%Init%) do (Set "%%k=%Line%") For /f "tokens=1 delims=," %%j in ("%Init%") do (Set "%%j=%Ball%") For /l %%i in (0,1,%LimX%) do ( Set "X0Y%%i=%Bound%" Set "X%LimX%Y%%i=%Bound%" Set "X%%iY0=%Bound%" Set "X%%iY%LimY%=%Bound%") For /l %%l in (2,1,16) do (Set "X%%lY2=%Point%") For /l %%m in (4,1,14) do (Set "X%%mY3=%Point%") For /l %%n in (6,1,12) do (Set "X%%nY4=%Point%") For /l %%o in (8,1,10) do (Set "X%%oY5=%Point%") For /l %%r in (1,1,17) do (Set "X%%rY15=%Lost%") Goto :Eof
:Logo Cls Color 0b Echo. Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°ÛÛÛ°°Û°°°ÛÛÛ°°ÛÛ°Û°°Û°° Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°° Echo. °°°ÛÛÛ°°Û°°°Û°Û°Û°°°ÛÛ°°°° Echo. °°°Û°°Û°Û°°°Û°Û°Û°°°Û°Û°°° Echo. °°°ÛÛÛ°°ÛÛÛ°ÛÛÛ°°ÛÛ°Û°°Û°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°B°R°E°A°K°E°R°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°±°±°±°±°±°±°±°±°±°±°±°° Echo. °°±°±°±°±°±°±°±°±°±°±°±°°° Echo. °°°±°±°±°±°±°±°±°±°±°±°±°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°°²°°°°°°°°°°°°°°°°°°° Echo. °°°°ÛÛÛÛÛ°°°°°°°°°°°°°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Echo. °°°°°: SmartGenius :°°°°°° Echo. °°°°° Corp. 2010 °°°°°° Echo. °°°°°°°°°°°°°°°°°°°°°°°°°° Ping -n 3 0.0.0.0 >nul Goto :Eof
:NoKey Mode con cols=30 lines=20 Cls Echo. Echo Uno de los archivos necesarios para el Echo funcionamiento de este Script no se Echo encuentra. Echo. Echo CHOICE.COM Echo. Echo Por favor descargue una copia del Comando Echo CHOICE de Internet... Echo. Pause Exit
Espero que les guste, y cualquier comentario o sugerencia es bien recibido ! Saludis.
|
|
|
20
|
Programación / Scripting / [Batch Game] The Pair Game - by SmartGenius
|
en: 1 Agosto 2010, 01:00 am
|
Batch Game - The Pair Game - by SmartGeniusDescargar -->> http://smart.code-makers.net/BatchGames/ThePairGameBySmartgenius.zipEste es un pequeño Juego Batch que he diseñado, usando el comando COLOUS de Bolivianito, y cuyo objetivo es hacer parejas de objetos, es un juego clasico ya conocido, interactuan con el mouse dando click en a ficha a descubrir, te da 10 puntos por acierto en una pareja y quita 5 puntos al desacertar. @Echo Off @Title The Pair Game @Mode Con Cols=30 Lines=12
Setlocal Enabledelayedexpansion Color 0a Colous Cursoroff
::Batch Game - The Pair Game ::Coded by SmartGenius ::Using COLOUS command from Bolivianito ::SmartGenius, Corp. 2010
:Load Call :GenSymbols Call :InitVars
:Init Cls Echo. Echo. ÚÄÄÄÄÄÄ¿ Echo. ³°³°³°³°³°³°³ Puntaje:%Points% Echo. ÃÄÅÄÅÄÅÄÅÄÅÄ´ Echo. ³°³°³°³°³°³°³ Echo. ÃÄÅÄÅÄÅÄÅÄÅÄ´ Echo. ³°³°³°³°³°³°³ Echo. ÃÄÅÄÅÄÅÄÅÄÅÄ´ Echo. ³°³°³°³°³°³°³ Echo. ÀÄÁÄÁÄÁÄÁÄÁÄÙ Echo.
:Coord Set /a "R+=1" For /f "tokens=*" %%a in ('Colous Mouse') do (Call :Check %%a) Colous 14 8 24,3 "!Points! " If "%Pairs%"=="12" ( Colous 14 8 16,6 "You Win, press" Colous 14 8 16,7 " any key to" Colous 14 8 16,8 " restart game" Pause >nul Goto :Load ) Goto :Coord
:Check For /l %%X in (3,2,13) do ( For /l %%Y in (3,2,9) do ( If Defined O_%~2_%~3 (Goto :Eof) If "%~2 %~3"=="%%X %%Y" ( Colous 12 8 %2,%3 !V_%~2_%~3! If Not Defined Sel_1 ( Set "Sel_1=!V_%~2_%~3!" Set "Pos_1=%~2,%~3" Goto :Eof ) If Not Defined Sel_2 ( Set "Sel_2=!V_%~2_%~3!" Set "Pos_2=%~2,%~3" ) If Not "!Sel_1!"=="!Sel_2!" ( Set /a "Points-=5" Ping -n 2 localhost >nul Colous 10 8 !Pos_1! $176 Colous 10 8 !Pos_2! $176 Set "Sel_1=" Set "Sel_2=" Goto :Eof ) else ( Set /a "Points+=10" Set /a "Pairs+=1" Ping -n 2 localhost >nul Colous 0 8 !Pos_1! $219 Colous 0 8 !Pos_2! $219 Set "Sel_1=" Set "Sel_2=" Call :Def !Pos_1! !Pos_2! Goto :Eof )))) Goto :Eof
:Def If "%~1"=="" Goto :Eof Set "O_%~1_%~2=Nul" Shift&Shift Goto :Def
:GenSymbols Set "Symbols=$001,$002,$003,$004,$005,$006,$011,$012,$014,$015,$020,$021" For %%S in (%Symbols%) do ( Set /a "S+=1" Set "Symbol_!S!=%%S" ) Goto :Eof
:InitVars For /l %%X in (3,2,13) do ( For /l %%Y in (3,2,9) do ( Call :Generate "%%X" "%%Y" Set "O_%%X_%%Y=" )) Set /a "Points=0","Pairs=0" Goto :Eof
:Generate Set /a "RX=(!Random! %% 12)+1" If Defined Sym_%RX% (Goto :Generate) If Not Defined S1_%RX% ( Set "V_%~1_%~2=!Symbol_%RX%!" Set "S1_%RX%=Nul" Goto :Eof ) If Not Defined S2_%RX% ( Set "V_%~1_%~2=!Symbol_%RX%!" Set "S2_%RX%=Nul" Goto :Eof ) Set "Sym_%RX%=Nul" Goto :Generate Espero sea de su agrado, y cualquier duda o comentario favor hacerlos ! Saludos.
|
|
|
|
|
|
|