Test Foro de elhacker.net SMF 2.1

Programación => Scripting => Mensaje iniciado por: SmartGenius en 1 Agosto 2010, 00:58 AM

Título: [Batch Game] The Labyrinth - usando COLOUS
Publicado por: SmartGenius en 1 Agosto 2010, 00:58 AM
Tal como le habia dicho a Bolivianito que haria, este juego es una demostracion de uso del comando COLOUS creado por el, para la implementacion de un Juego Batch simple, usando el sistema de coordenadas mio :P

(http://img690.imageshack.us/img690/3576/labgame.png)

Código (dos) [Seleccionar]
@Echo off
@title The Labyrinth - SmartGenius
Mode con cols=45 lines=16
Setlocal enabledelayedexpansion

:: Batch Game - The Labyrinth
:: Coded by SmartGenius
:: Using Graphic Command (colous) by Bolivianito

:Game_Vars
Set /a "LimX=44","LimY=15","IniX=1","IniY=1","MovX=0","MovY=0","Points=0"
Set "Bound=[8]$219"
Set "Space=[0] "
Set "Player=$001"
Set "Point=[5]$207"
Set "Exit=[10]$176"

:Game_Init
For /l %%a in (%IniX%,1,%LimX%) do (
For /l %%b in (%IniY%,1,%LimY%) do (
Set X%%aY%%b=%Space%))
Call :Game_Level
Call :Display
Set "X14Y4=%Player%"
Set Curpos=X14Y4
Call :Color "%Player%" "12 0"
Goto :Game_Move

:Display
For /l %%d in (%IniX%,1,%LimY%) do (
Set Lin_%%d=
For /l %%e in (%IniX%,1,%LimX%) do Set Lin_%%d=!Lin_%%d!!X%%eY%%d!)
For /l %%f in (%IniY%,1,%LimY%) do (Colous Writesec "!Lin_%%f!")
Goto :Eof

:Game_Move
Colous Readkey
If "%ErrorLevel%"=="100" (call :Mov "X" "+")
If "%ErrorLevel%"=="97" (call :Mov "X" "-")
If "%ErrorLevel%"=="115" (call :Mov "Y" "+")
If "%ErrorLevel%"=="119" (call :Mov "Y" "-")
If "%ErrorLevel%"=="88" (Goto :Win)
If "%ErrorLevel%"=="120" (Goto :Win)
Goto :Game_Move

:Mov
For /f "tokens=1,2 delims=X,Y" %%p in ("%CurPos%") do (Set "MovX=%%p"&Set "MovY=%%q")
if "!Mov%~1!"=="!Lim%~1!" Goto :Eof
Set /a Mov%~1%~2=1
Set "NMovY=!X%MovX%Y%MovY%!"
If Defined S_X%MovX%Y%MovY% (Set "S_X%MovX%Y%MovY%="&Set /a Points+=10)
If "!NMovY!"=="%Bound%" (Goto :Eof)
If "!NMovY!"=="%Exit%" (Goto :Win)
If "!NMovY!"=="%Point%" (Set /a Points+=5)
Set "X%MovX%Y%MovY%=%Player%"
Set "%CurPos%=%Space%"
Call :Color "A" "0 0"
Set "CurPos=X%MovX%Y%MovY%"
Call :Color "%Player%" "12 0"
Goto :Eof

:Color
For /f "tokens=1,2 delims=X,Y" %%p in ("%CurPos%") do (Set "ColX=%%p"&Set "ColY=%%q")
Colous %~2 %ColX%,%ColY% %~1
Colous Cursoroff
Goto :Eof

:Win
Cls
Echo.
Echo.
If %Points% GEQ 200 (Echo. Excelent %Nick%, You Get 3 Extra Lives&Set /a Lives+=3)
If %Points% GEQ 150 (If %Points% LEQ 195 (Echo. Well Done %Nick%, You Get 2 Extra Lives&Set /a Lives+=2))
If %Points% GEQ 100 (If %Points% LEQ 145 (Echo. You Did it %Nick%, You Get 1 Extra Live&Set /a Lives+=1))
If %Points% LSS 100 (Echo. Level Completed %Nick%, No Lives Won)
Echo. You Get %Points% Points
Echo.
Echo. Press any key...
Pause>nul
Goto :Eof

:Game_Level
For %%a in (X7Y10,X8Y6,X9Y2,X9Y6,X9Y14,X10Y14,X13Y8,X18Y6,X18Y10,X18Y12,X20Y12,X23Y9,X27Y7,X29Y2,X38Y10,X41Y6,X43Y14) do (
Set "%%a=%Point%")
For %%a in (
X1Y1,X1Y2,X1Y3,X1Y4,X1Y5,X1Y6,X1Y7,X1Y8,X1Y9,X1Y10,X1Y11,X1Y12,X1Y13,X2Y1,X2Y3,X2Y8,
X2Y10,X2Y13,X3Y1,X3Y3,X3Y5,X3Y8,X3Y13,X4Y1,X4Y3,X4Y5,X4Y7,X4Y8,X4Y10,X4Y11,X4Y13,
X5Y1,X5Y3,X5Y5,X5Y11,X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,X28Y4,
X28Y6,X28Y7,X28Y9,X28Y11,X28Y12,X28Y13,X28Y15,X29Y1,X29Y4,X29Y6,X29Y9,X29Y13,X29Y15,
X30Y1,X30Y2,X30Y4,X30Y6,X30Y8,X30Y9,X30Y11,X30Y13,X30Y15,X31Y2,X31Y4,X31Y6,X31Y9,
X31Y11,X31Y15,X32Y2,X32Y4,X32Y6,X32Y7,X32Y9,X32Y11,X32Y12,X32Y13,X32Y14,X32Y15,X33Y2,
X33Y4,X33Y9,X33Y13,X34Y2,X34Y4,X34Y6,X34Y7,X34Y8,X34Y9,X34Y11,X34Y13,X35Y2,X35Y4,
X35Y11,X35Y13,X35Y14,X35Y15,X36Y1,X36Y2,X36Y4,X36Y6,X36Y7,X36Y8,X36Y9,X36Y11,X36Y15,
X37Y1,X37Y4,X37Y9,X37Y10,X37Y11,X37Y13,X37Y15,X38Y1,X38Y3,X38Y4,X38Y6,X38Y7,X38Y9,
X38Y11,X38Y13,X38Y15,X39Y1,X39Y3,X39Y7,X39Y9,X39Y11,X39Y12,X39Y13,X39Y15,X40Y1,X40Y3,
X40Y5,X40Y7,X40Y9,X40Y13,X40Y15,X41Y1,X41Y3,X41Y4,X41Y5,X41Y7,X41Y9,X41Y11,X41Y15,
X42Y1,X42Y5,X42Y6,X42Y7,X42Y9,X42Y10,X42Y11,X42Y12,X42Y14,X42Y15,X43Y1,X43Y2,X43Y3,
X43Y9,X43Y12,X43Y15,X44Y3,X44Y4,X44Y5,X44Y6,X44Y7,X44Y8,X44Y9,X44Y12,X44Y13,X44Y14,X44Y15
) do (Set "%%a=%Bound%")
For %%a in (X2Y2,X2Y7,X2Y9,X16Y12,X18Y8,X20Y2,X20Y9,X25Y6,X26Y2,X36Y10,X40Y4,X41Y10) do (Set S_%%a=%Point%)
For %%a in (X20Y14) do (Set "%%a=%Exit%")
Goto :Eof



Lo pueden jugar usando las clasicas teclas de WASD, el objetivo es llegar a la salida y lograr la mayor cantidad de puntos.El Juego es un Easter Egg del WarGame Batch para poder obtener mas vidas, solo hice la adaptacion para poder usar el comando COLOUS de bolivianito.

Cualquier duda o comentario favor de hacerlos !

Saludos. :D
Título: Re: [Batch Game] The Labyrinth - usando COLOUS
Publicado por: DA KILLER en 2 Agosto 2010, 17:52 PM
Estaría bueno que dejases el link al comando ese smart, luego lo pruebo  :laugh: :laugh: ;-)
Título: Re: [Batch Game] The Labyrinth - usando COLOUS
Publicado por: Novlucker en 2 Agosto 2010, 17:56 PM
http://foro.elhacker.net/scripting/batch_ejemplos_del_comando_colous-t275591.0.html
http://foro.elhacker.net/scripting/hola_vengo_a_hacer_spambatch-t285785.0.html

Saludos
Título: Re: [Batch Game] The Labyrinth - usando COLOUS
Publicado por: FerJGS en 2 Agosto 2010, 21:04 PM
El juego sin duda promete pero...hay un pequeño fallo: NO ME FUNCIONA. ¿alguien sabe por qué es? me sale una carita roja sonriente y el _ de comando pero sin dejarme escribir anda. Tengo Windows XP, he visto que el tuyo es vista, = es por eso...