A short demo script utilizing %\E[%?25l to hide the cursor
Code: Select all
@Echo off
If Not "%~1" == "" (Exit /B)Else CLS
(For /F %%a in ('echo prompt $E ^| cmd')do (Set "\E[=%%a["&Set "\E=%%a")
%= Ascii Escape Character. Do Not Modify. =%)
(Set LF=^
%= LineFeed - Do Not Modify =%)
Echo/%\E[%?25l
Set "Roll=(For /F "Delims=" %%R in ('Set /A "D=!random! %%6 + 1"')Do (Set "#=%%R"&(!D[%%R]!)))"
Set "Roll.Anim=For %%n in (1 2) Do if %%n==2 ((If "!Repeat!"=="" Set "Repeat=15")&For /L %%x in (1 1 !Repeat!) do (%ROLL% & %Roll% & (For /L %%D in (1 1 Delay)Do Call "%~F0" 1) & CLS))Else Set "
Set "DefArr=For %%n in (1 2)Do if %%n==2 ((For /F "Tokens=1,2 Delims==" %%v in ('2^> Nul Set #[')Do Set "%%~v=" & Set "#{i}=0") & For %%G in (!list!)Do (Set /a "#{i}=!#{i}!+1" & Set "#[!#{i}!]=%%~G"))Else Set List="
Set "Select=CLS&(Title Enter a number [2-12] or [E]xit & Set "Guess=" & (For %%n in (1 2)Do If not !Guess! GTR 1 (For /F "Delims=" %%G in ('Choice /N /C:E0123456789')Do If "%%G"=="E" (TITLE & Echo/%\E[%?25h & Endlocal & Exit /B 0) Else (<nul Set /P "=%%G"& Set "Guess=!Guess!%%G")))& (if !Guess! GTR 12 (Goto :Guess)))& (If "!Guess:~0,1!"=="0" (Set "Guess=!Guess:~1,1!"))& (If !Guess! LEQ 1 Goto :Guess) & CLS"
Set "Total=(Set /A "Sum=#"&Echo/You rolled: [%\E[%33m!Sum!%\E[%0m])& (If "!Guess!" == "!Sum!" (Echo/Congrats)Else (Echo/Your Guess: [%\E[%31m!Guess!%\E[%0m] was wrong.)) & Pause > Nul & CLS & Goto :Guess )"
Setlocal EnableDelayedExpansion
%DefArr:#=D% "Echo/%\E[%31m---!LF!!LF! o!LF!!LF!---%\E[%0m!LF!" "Echo/%\E[%32m---!LF! o!LF!!LF!o!LF!---%\E[%0m!LF!" "Echo/%\E[%33m---!LF!o!LF! o !LF! o!LF!---%\E[%0m!LF!" "Echo/%\E[%34m---!LF!o o!LF!!LF!o o!LF!---%\E[%0m!LF!" "Echo/%\E[%35m---!LF!o o!LF! o!LF!o o!LF!---%\E[%0m!LF!" "Echo/%\E[%36m---!LF!o o!LF!o o!LF!o o!LF!---%\E[%0m!LF!"
:Guess
%Select%
%Roll.Anim:Delay=5%Repeat=20
%Roll:#=R[1]%&%Roll:#=R[2]%
%Total:#=R[1]+R[2]%