Tråd: Hello World.
View Single Post
Haha, Plohg, der sa du noe! Her er min batchkode som ennå ikke funker har ikke gjort noe i batch på et par år, så denne er ikke helt i topp stand. Beklager at den er usansynlig lang

Kode

:main
@echo off
cls
Title Hello... who%?%
cls
echo Lets greet someone..:
echo Loading list of users to greet...
@ping 127.0.0.1 -n 2 -w 500 > nul
echo Loading..
@ping 127.0.0.1 -n 2 -w 500 > nul
echo Loading...
@ping 127.0.0.1 -n 2 -w 500 > nul
echo Loading....
@ping 127.0.0.1 -n 2 -w 500 > nul
echo 100%%% loaded!
echo Press any key to continue
pause > nul

:main
echo Welcome!
SET $g=H
SET $8=e
SET $jjj=l
SET $e=o
SET $t= 
SET $23235io=W
SET $arnold=r
SET $hgy=d
echo.
echo Who would you like to greet%?%
echo Available choices:
echo 1: Harry Potter
echo To greet Harry Potter, enter harry or Harry.
echo.
echo 2: NFF
echo To greet NFF, enter NFF
echo.
echo 3: The World
echo To greet the world, enter world or World
echo.
echo Or just cancel to exit :)
echo.
SET /p input=[1,2,3,4]? > nul
IF %input%=="" (
 echo Input er obligatorisk
 goto helloloop
)
IF %input%=="Harry" (
 goto harry
)
IF %input%=="NFF" (
 goto nff
)
IF %input%=="World" (
 goto world
)
IF %input%=="cancel" (
 goto exit
)

:helloloop
echo.
echo.
echo.
echo.
echo.
echo Welcome!
SET $g=H
SET $8=e
SET $jjj=l
SET $e=o
SET $t= 
SET $23235io=W
SET $arnold=r
SET $hgy=d
echo.
echo Who would you like to greet%?%
echo Available choices:
echo 1: Harry Potter
echo To greet Harry Potter, enter harry or Harry.
echo.
echo 2: NFF
echo To greet NFF, enter NFF
echo.
echo 3: The World
echo To greet the world, enter world or World
echo.
echo Or just cancel to exit :)
echo.
SET /p input=[1,2,3,4]? > nul
IF %input%=="" (
 echo Input er obligatorisk
 goto helloloop
)
IF %input%=="harry" (
 goto harry
)
IF %input%=="NFF" (
 goto nff
)
IF %input%=="world" (
 goto world
)
IF %input%=="cancel" (
 goto exit
)

:harry
echo Harry Potter magically forces you to greet the world instead!
echo.
echo.
echo You greet the world. %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%!
echo %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%
echo %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%
goto helloloop
pause > nul

:nff
echo NFF thinks you should greet the world instead
echo You greet the world! %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%!
echo.
goto helloloop
pause > nul

:world
echo %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%!
echo %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%!
echo %$g%%$8%%$jjj%%$jjj%%$e%%$t%%$23235io%%$e%%$jjj%%$hgy%!
echo You greet the world! Hello, World!
goto helloloop
pause > nul

:exit
exit