Jump to content
Koumei & the Five Fates: Share Bug Reports and Feedback Here! ×

Anyone Here Familiar With .bat Files?


(PSN)IIIDevoidIII
 Share

Recommended Posts

Basically I am corrupting this pretty little tool to be turned into my first knack at game development.

 

I threw together a quick test file, and it seems to be working, though there is very little that I can find on what commands can be used and how to properly use them.

 

Basically, I'm trying to find a way to:

1) Store values/variables for later use and manipulation, if possible.

 

   1b) Allow these variables to serve as a checkpoint system if you visit the, for example, Title/Menu screen for whatever reason, or to open doors, what have you. Not if you close the game, per say, as I find that near impossible with what commands I've found. Nothing actually edits the parent file.

 

2) Slow down text speed, speed of its appearance without using ping.

 

3) Find a site that allows Batch file uploads, as they are considered exec and potentially dangerous. I don't really want people to have to format the files themselves.

 

4) Text Align?

 

5) Viewing window resizing? This file only wants to cover less than half my screen.

 

6) Have a .bat open another .bat?

 

Any help is appreciated.

 

I have my test code stoofs below. Just copy/paste this code into a notepad, and then save the file as a filename.bat

 

@echo off

:MENU
color 40
echo.
echo.
echo.
echo.
echo -=Dungeon=-
echo ---
echo The Dungeoning
echo.
echo.
echo.
ping localhost -n 3 >nul
echo Press '1' to Start.
ping localhost -n 1 >nul
echo Press '2' for Instructions.
ping localhost -n 1 >nul
echo Press '3' to Quit.
echo.
set /p input=-
if %input%==1 goto GAME
if %input%==2 goto INST
if %input%==3 exit
 
:GAME
cls
color 96
ping localhost -n 3 >nul
echo Laughter.
echo All it was was laughter.
echo.
echo.
echo.
ping localhost -n 1 >nul
echo 1) Don't move.
ping localhost -n 1 >nul
echo 2) Laugh.
ping localhost -n 1 >nul
echo 3) Run from the laughter.
ping localhost -n 1 >nul
echo 4) Seek out the laughter.
set /p input=-
if %input%==1 goto DTMO
if %input%==2 goto LAUG
if %input%==3 goto RUNL
if %input%==4 goto SEKL
pause
 
:DTMO
cls
echo You go NORTH and die horribly.
pause
goto TYPE
 
:LAUG
cls
echo You go SOUTH and die horribly.
pause
goto TYPE
 
:RUNL
cls
echo You go EAST and die horribly.
pause
goto TYPE
 
:SEKL
cls
echo DENNIS hands you a TACO...
ping localhost -n 2 >nul
echo And you die horribly.
ping localhost -n 3 >nul
pause
goto TYPE
 
:TYPE
cls
echo P
ping localhost -n 1.5 >nul
cls
echo Pu
ping localhost -n 1.5 >nul
cls
echo Pur
ping localhost -n 1.5 >nul
cls
echo Purg
ping localhost -n 1.5 >nul
cls
echo Purga
ping localhost -n 1.5 >nul
cls
echo Purgat
ping localhost -n 1.5 >nul
cls
echo Purgato
ping localhost -n 1.5 >nul
cls
echo Purgator
ping localhost -n 1.5 >nul
cls
echo Purgatory
ping localhost -n 1.5 >nul
cls
echo Purgatory!
ping localhost -n 1.5 >nul
cls
echo Purgatory!!
ping localhost -n 1.5 >nul
cls
echo Purgatory!!!
ping localhost -n 1.5 >nul
pause
goto MENU
 
:INST
cls
echo INSTRUCTIONS!
pause
Link to comment
Share on other sites

Why not create a .NET visual basic console application? Much cleaner, much more documentation for you to use, and it'd be a hell of a lot easier to manage and code to do what you want.

Edited by lolk
Link to comment
Share on other sites

Why not create a .NET visual basic console application? Much cleaner, much more documentation for you to use, and it'd be a hell of a lot easier to manage and code to do what you want.

 

Because I know nothing...

 

... I can use HTML extensively, CSS, near to none JS and Flash, and that is about it.

 

But thank RNGsus something I am looking for has actual organization, like Dreamweaver I have been using, and I don't have to shell out some money for to try out. 

 

I'll definitely check it out, thank you. 

Still, even if I'm already moving onward from my above, I'd still like to know about the above. If not used to using, I'd like to become familiar with many programming languages.

Link to comment
Share on other sites

Because I know nothing...

 

... I can use HTML extensively, CSS, near to none JS and Flash, and that is about it.

 

But thank RNGsus something I am looking for has actual organization, like Dreamweaver I have been using, and I don't have to shell out some money for to try out. 

 

I'll definitely check it out, thank you. 

Still, even if I'm already moving onward from my above, I'd still like to know about the above. If not used to using, I'd like to become familiar with many programming languages.

 

 

I threw this together in about thirty minutes In Visual Studio 2013 Community, it's free.

I'm really rusty at VB, it's not totally complete comparing it to your script. but I think you should be able to get a good handle on how this works in both languages. Good luck! Hope this helps.

 

 

Imports System.Threading 'Lets us import the Threading methods so we may pause the application during output display Module Module1     Sub Main()         Menu()      End Sub     Private Function Menu()        Dim input As String ' This declares the variable "input" as a String class type         Console.BackgroundColor = ConsoleColor.DarkRed ' Sets our background of the text to red        Console.Clear()        Console.WriteLine(vbCrLf + vbCrLf + vbCrLf + vbCrLf + "-=Dungeon=-" + vbCrLf + "---" + vbCrLf + "The Dungeoning" + vbCrLf + vbCrLf + vbCrLf)        Thread.Sleep(3000)        Console.WriteLine("Press '1' to Start.")        Thread.Sleep(1000)        Console.WriteLine("Press '2' for Instructions.")        Thread.Sleep(1000)        Console.WriteLine("Press '3' to Quit" + vbCrLf)         input = Console.ReadKey.KeyChar         Select Case input            Case input = "1"                Console.Clear()                Game()            Case input = "2"                Console.Clear()                Instruction()            Case input = "3"                End        End Select          Return String.Empty    End Function      Private Function Game()        Dim input As String         Console.BackgroundColor = ConsoleColor.Blue        Console.Clear()        Thread.Sleep(3000)        Console.WriteLine("Laughter." + vbCrLf + "All it was, was laughter." + vbCrLf + vbCrLf + vbCrLf)        Console.WriteLine("1) Don't move." + vbCrLf + "2) Laugh." + vbCrLf + "3) Run from the laughter." + vbCrLf + "4) Seek out the laughter.")         input = Console.ReadKey.ToString         Select Case input            Case input = "1"                Nomove()            Case input = "2"                Laugh()            Case input = "3"                Run()            Case input = "4"                Seek()            Case Else                Console.Clear()        End Select        Return String.Empty    End Function     Private Function Type()     End Function     Private Function Instruction()        Console.WriteLine("INSTRUCTIONS!")        Thread.Sleep(5000)        Return String.Empty    End Function      'This is the same as your :DTMO function, and so on and so forth.     'This is obviously not best practice for functions (normally for this you would use Private Sub,    'but to get you used to how the variables work and data interacts, I will use them here.    Private Function Nomove()        Dim N As String        N = "You go NORTH and die horribly"        Return (N)    End Function     Private Function Laugh()        Dim L As String        L = "You go SOUTH and die horribly."        Return (L)    End Function     Private Function Run()        Dim R As String        R = "You go EAST and die horribly"        Return ®    End Function     Private Function Seek()        Console.WriteLine("DENNIS hands you a TACO...")        Thread.Sleep(2000)        Console.WriteLine("And you die horribly.")        Thread.Sleep(3000)        Return String.Empty 'We have to return something from the function, so being the pedantic guy I am, I use the String.empty method    End Function  End Module 
Edited by lolk
Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...