Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Batch Programs Thread.  (Read 625854 times)

0 Members and 2 Guests are viewing this topic.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: Batch Programs Thread.
« Reply #600 on: September 11, 2015, 05:16:46 PM »
Make a new thread.  This one is for sharing completed code.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

zask



    Intermediate

    • Experience: Experienced
    • OS: Other
    Re: Batch Programs Thread.
    « Reply #601 on: October 24, 2015, 03:54:20 PM »
    am i allowed to post a virus generator on here? it sends code safely to a text file

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Batch Programs Thread.
    « Reply #602 on: October 24, 2015, 07:03:19 PM »
    No.
    " Anyone who goes to a psychiatrist should have his head examined. "

    Salmon Trout

    • Guest
    Re: Batch Programs Thread.
    « Reply #603 on: March 01, 2016, 10:18:15 AM »
    You should not make posts helping bypass school policy. Read the rules.

    patio

    • Moderator


    • Genius
    • Maud' Dib
    • Thanked: 1769
      • Yes
    • Experience: Beginner
    • OS: Windows 7
    Re: Batch Programs Thread.
    « Reply #604 on: March 01, 2016, 04:59:27 PM »
    You should not make posts helping bypass school policy. Read the rules.

    Post removed...thanx for the heads up Salmon...
    " Anyone who goes to a psychiatrist should have his head examined. "

    DeScripter



      Starter

      • Experience: Familiar
      • OS: Windows 7
      Re: Batch Programs Thread.
      « Reply #605 on: March 22, 2017, 02:23:50 PM »
      I know a few people posted Rock Paper Scissors game codes already but I created one with a bit more. This version has ANIMATIONS!


      @echo off
      cls



      :idle
      cls
      echo.
      echo.
      echo.
      echo.
      echo.
      echo                     ______                           _______
      echo                    /      \__                 __/       \
      echo         __________/    ____^| ^|               ^| ^|____     \_____________
      echo                       /______^|               ^|______\
      echo                      /^|______^|              ^|______^|\
      echo                       ^|______^|              ^|______^|   
      echo         ________      ^|______^|              ^|______^|     _____________
      echo                 \_____\_____/                 \_____/____/
      echo.
      echo.
      echo               1) Rock              2) Paper       3) Scissors
                               


      set /p input=CHOICE:
      if %input%==1 goto Rock
      if %input%==2 goto Paper
      if %input%==3 goto Scissors


      :Rock

      set /a n=%random% %%3

      if %n%==0 goto RockRock
      if %n%==1 goto RockPaper
      if %n%==2 goto RockScissors



      :RockRock
      cls

      echo.
      echo                 TIE!
      echo.
      echo.
      echo.
      echo                     ______            _______
      echo                    /      \__      __/       \
      echo         __________/    ____^| ^|    ^| ^|____     \_____________
      echo                       /______^|    ^|______\
      echo                      /^|______^|    ^|______^|\
      echo                       ^|______^|    ^|______^|   
      echo         ________      ^|______^|    ^|______^|     ___________
      echo                 \_____\_____/      \_____/____/
       

      timeout /T 2 >nul
      goto idle



      :RockPaper
      cls

      echo.
      echo                  LOSS!
      echo.
      echo.
      echo.         
      echo                     ______                   _______
      echo                    /      \__        _______/       \
      echo         __________/    ____^| ^|      ^|_____ ^|____     \_____________
      echo                       /______^|     ^|______      \
      echo                      /^|______^|      ^|_____       
      echo                       ^|______^|       ^|_____        ________________
      echo         ________      ^|______^|         \__________/             
      echo                 \_____\_____/                   




      timeout /T 2 >nul
      goto idle


      :RockScissors
      cls

      echo.
      echo                  WIN!
      echo.
      echo.
      echo.
      echo                     ______                   _______
      echo                    /      \__       ________/       \
      echo         __________/    ____^| ^|     ^|_______^|____     \_____________
      echo                       /______^|      _______\    \
      echo                      /^|______^|     ^|____________ \
      echo                       ^|______^|           ^|______^|   
      echo         ________      ^|______^|           ^|______^|     ___________
      echo                 \_____\_____/             \_____/____/



      timeout /T 2 >nul
      goto idle




      :Paper

      cls
      set /a n=%random% %%3

      if %n%==0 goto PaperRock
      if %n%==1 goto PaperPaper
      if %n%==2 goto PaperScissors




      :PaperRock
      cls

      echo.
      echo                        WIN!
      echo.
      echo.
      echo.
      echo                     ______                         _______
      echo                    /      \________             __/       \
      echo         __________/    ____^| ______^|           ^| ^|____     \_____________
      echo                       /      _______^|          ^|______\
      echo                      /       ______^|           ^|______^|\
      echo         _________           ______^|            ^|______^|   
      echo                  \______________/              ^|______^|     ___________
      echo                                                 \_____/____/



      timeout /T 2 >nul
      goto idle


      :PaperPaper
      cls

      echo.
      echo                        TIE!
      echo.
      echo.
      echo.
      echo                     ______                         _______
      echo                    /      \________        _______/       \
      echo         __________/    ____^| ______^|      ^|______ ^|___     \_____________
      echo                       /      _______^|    ^|_______     \
      echo                      /       ______^|      ^|______      \
      echo         _________           ______^|        ^|______          _____________
      echo                  \______________/            \_____________/           



      timeout /T 2 >nul
      goto idle



      :PaperScissors
      cls

      echo.
      echo                    LOSS!
      echo.
      echo.
      echo.         
      echo                     ______                        _______
      echo                    /      \________      ________/       \
      echo         __________/    ____^| ______^|    ^|______ ^|____     \_____________
      echo                       /      _______^|    ______\     \
      echo                      /      _______^|    ^|____________ \
      echo         _________           ______^|           ^|______^|   
      echo                  \_____________/              ^|______^|     ___________
      echo                                                \_____/____/


      timeout /T 2 >nul
      goto idle


      :Scissors

      cls
      set /a n=%random% %%3

      if %n%==0 goto ScissorsRock
      if %n%==1 goto ScissorsPaper
      if %n%==2 goto ScissorsScissors


      :ScissorsRock
      cls

      echo.
      echo                    LOSS!
      echo.
      echo.
      echo.
      echo                     ______                    _______
      echo                    /      \_________       __/       \
      echo         __________/    ____^| _______^|     ^| ^|____     \_____________
      echo                       /     /_______      ^|______\
      echo                      / _____________^|     ^|______^|\
      echo                       ^|______^|            ^|______^|   
      echo         ________      ^|______^|            ^|______^|     ___________
      echo                 \_____\_____/              \_____/____/


      timeout /T 2 >nul
      goto idle


      :ScissorsPaper
      cls

      echo.
      echo                       WIN!
      echo.
      echo.
      echo.
      echo                     ______                        _______
      echo                    /      \________       _______/       \
      echo         __________/    ____^| ______^|     ^|_____ ^|____     \_____________
      echo                       /     /______     ^|______      \
      echo                      /^|____________^|     ^|_____       
      echo                       ^|______^|            ^|_____        ________________
      echo         ________      ^|______^|              \__________/             
      echo                 \_____\_____/   

      timeout /T 2 >nul
      goto idle


      :ScissorsScissors
      cls

      echo.
      echo                       TIE!
      echo.
      echo.
      echo.
      echo                     ______                         _______
      echo                    /      \_________      ________/       \
      echo         __________/    ____^| _______^|    ^|______^|____     \_____________
      echo                       /     /_______      ______\     \
      echo                      / _____________^|    ^|____________ \
      echo                       ^|______^|                 ^|______^|   
      echo         ________      ^|______^|                 ^|______^|     ___________
      echo                 \_____\_____/                   \_____/____/       


      timeout /T 2 >nul
      goto idle       






      BEAT THAT!

      kennysteele



        Newbie

        • Experience: Beginner
        • OS: Windows 7
        Re: Batch Programs Thread.
        « Reply #606 on: May 08, 2017, 02:21:07 AM »
        !!!!Urgent
        Can somone Help me with this please Urgent!!!

        For this you need to write two programs one in MS-DOS batch language and one in bash shellscript. Both will do the same task, to create files containing user records for another application (you do not need to worry what this is or write any aspect of it). Each of your programs will need to work in two modes, interactive mode and command line mode. Each will gather from the user their name and a username (which they can choose) which it will write to a file together with the current date and time) which must be stored in a folder called “user_records” (which your program will need to create if it does not exist). In the MS-DOS version user_records will be in “c:\”, in the bash version it will be in the current user’s login directory.
        The interactive mode will ask the user two questions, “What is your name?” (and get their reply) and “What is your chosen username?” (and again get their reply) you will need to add more to this such as an introduction at the start of the program, and report if the file was created etc.
         
        Say for example the user entered “Fred Bloggs” in answer to the first question and “fb1” to the second, and the date and time were 15/01/2017:20:21:02 then a file would be created in user_records named as per the username as fb1.txt (assuming this did not already exist – if it does exist your program should generate an error message) which would contain:
        Fred Bloggs
        fb1
        15/01/2017:20:21:02

        For the non-interactive mode the program would take the persons name and username on the command line, so, say the program was called “makeuser.bat” I might type in:
        makeuser.bat “Fred Bloggs” fb1
        and without asking the user any questions is should create the file as above. This version should also check that that exactly two parameters were given on the command line. If only one is given or more than two it should generate an error message.

        Salmon Trout

        • Guest
        Re: Batch Programs Thread.
        « Reply #607 on: May 08, 2017, 02:30:01 AM »
        This is obviously a school assignment. Have you tried to write any code?

        kennysteele



          Newbie

          • Experience: Beginner
          • OS: Windows 7
          Re: Batch Programs Thread.
          « Reply #608 on: May 08, 2017, 02:43:52 AM »
          Nope I really Have not and yeah it is I really need Help its due in like 3 hours please would you be able to Help me out.

          Allan

          • Moderator

          • Mastermind
          • Thanked: 1260
          • Experience: Guru
          • OS: Windows 10
          Re: Batch Programs Thread.
          « Reply #609 on: May 08, 2017, 06:02:38 AM »
          Sorry, we won't do your homework for you.

          blanktheman



            Rookie
          • Technician
            • Yes
          • Certifications: List
          • Computer: Specs
          • Experience: Experienced
          • OS: Windows 10
          Re: Batch Programs Thread.
          « Reply #610 on: January 17, 2018, 12:49:35 AM »
          Very simple bat file. If my computer turns on and I'm not at work, it will switch off again. I've set it so after 1 hour of not being at work the computer will switch off but you can change the time.

          Code: [Select]
          @ECHO OFF

          :choice
          choice /C YN /D N /T 3600 /M "Are you at work today?"
          IF errorlevel 2 goto :imnothere
          IF errorlevel 1 goto :imhere
          pause
          goto :choice


          :imhere

          echo "I am here"
          exit

          :imnothere

          echo "I am not here"
          shutdown /s /f
          exit

          Salmon Trout

          • Guest
          Re: Batch Programs Thread.
          « Reply #611 on: January 17, 2018, 01:22:04 AM »
          Did a ghost press the power button?

          JoshCM



            Greenhorn

            • Experience: Familiar
            • OS: Windows 10
            Horse Racing
            « Reply #612 on: June 26, 2018, 12:33:47 PM »
            I made a horse racing game about 10 years ago when still in school.
            The tech guy thought blocking game websites would stop us. So I started making them  :P
            There is definitely a few bugs and it isn't as simple as it could be but for my first full game. Not too bad :P
            (This will create a "save.bat" file in the same location as the game) Just as a warning

            Code: [Select]
            @echo off
            title Horse Racing! (DesignsByJCM Games)
            color e
            set beterror=no
            set stoerror=no
            set save=no
            if not exist save.bat goto menu
            if exist save.bat goto horseselect

            :menu
            echo set balance=500 > save.bat
            echo color f >> save.bat
            echo set horse1= Horse 1 >> save.bat
            echo set horse2= Horse 2 >> save.bat
            echo set horse3= Horse 3 >> save.bat
            echo set horse4= Horse 4 >> save.bat
            echo set horse5= Horse 5 >> save.bat
            call save.bat
            cls
            echo You have been granted %balance% dollars!
            echo.
            echo Time to start gambling on horses! Good Luck!
            echo.
            pause
            goto horseselect

            :horseselect
            cls
            call save.bat
            if %balance% == 0 goto loose
            if %beterror%==yes echo You don't have enough money!
            if %beterror%==yes echo.
            if %save% == yes echo Save Success!
            echo Choose A horse!
            call save.bat
            echo.
            echo 1) %horse1%
            echo 2) %horse2%
            echo 3) %horse3%
            echo 4) %horse4%
            echo 5) %horse5%
            echo ==================
            echo 6) Store
            echo 7) Save
            echo.
            call save.bat
            echo Balance: %balance%
            echo.
            set /p playerchoice=
            set save=no
            if %playerchoice% == 1 set choice=Horse 1
            if %playerchoice% == 2 set choice=Horse 2
            if %playerchoice% == 3 set choice=Horse 3
            if %playerchoice% == 4 set choice=Horse 4
            if %playerchoice% == 5 set choice=Horse 5
            if %playerchoice% == 6 goto store
            if %playerchoice% == 7 goto save
            if %playerchoice% == $ goto cheat
            cls
            echo How much do you want to wager?
            call save.bat
            echo Balance: %balance%
            echo.
            set /p bet=
            if %bet% EQU 0 set beterror=yes&& goto horseselect
            call save.bat
            if %bet% GTR %balance% set beterror=yes&& goto horseselect
            set /a balance=%balance%-%bet%
            echo set balance=%balance% > save.bat
            color c
            echo.
            echo $%bet% Deducted!
            set beterror=no
            pause>nul
            color f
            set start=no
            goto setter
            :game
            cls
            call save.bat
            echo Balance: %balance%  /+\  Your bet: %bet%  /+\  Your choice: %choice%
            echo.
            echo.
            echo %a1%%a2%%a3%%a4%%a5%%a6%%a7%%a8%%a9%%a10%%a11%%a12%%a13% /\ %a14%
            echo.
            echo %b1%%b2%%b3%%b4%%b5%%b6%%b7%%b8%%b9%%b10%%b11%%b12%%b13% /\ %b14%
            echo.
            echo %c1%%c2%%c3%%c4%%c5%%c6%%c7%%c8%%c9%%c10%%c11%%c12%%c13% /\ %c14%
            echo.
            echo %d1%%d2%%d3%%d4%%d5%%d6%%d7%%d8%%d9%%d10%%d11%%d12%%d13% /\ %d14%
            echo.
            echo %e1%%e2%%e3%%e4%%e5%%e6%%e7%%e8%%e9%%e10%%e11%%e12%%e13% /\ %e14%
            echo.
            set winners=0
            if %a14% == @ set /a winners=%winners%+1
            if %b14% == @ set /a winners=%winners%+1
            if %c14% == @ set /a winners=%winners%+1
            if %d14% == @ set /a winners=%winners%+1
            if %e14% == @ set /a winners=%winners%+1
            if %winners% GTR 1 goto tie
            if %a14% == @ set winner=Horse 1&& set winner2=1&& goto end
            if %b14% == @ set winner=Horse 2&& set winner2=2&& goto end
            if %c14% == @ set winner=Horse 3&& set winner2=3&& goto end
            if %d14% == @ set winner=Horse 4&& set winner2=4&& goto end
            if %e14% == @ set winner=Horse 5&& set winner2=5&& goto end
            if %start% == no echo Press any key to start the race!
            if %start% == no pause>nul
            set start=yes
            set pause=0
            :pauselimit
            set /a pause=%pause%+1
            if %pause% LSS 150 goto pauselimit
            goto horse1

            :horse1
            set /a move=%random%*7/32767+1
            if %move% == 1 set motion=1
            if %move% == 5 set motion=1
            if %move% == 6 set motion=1
            if %move% == 2 set motion=2
            if %move% == 7 set motion=2
            if %move% == 3 set motion=3
            if %move% == 4 set motion=0
            set mlimit=0
            if %motion% == 0 goto horse2
            if %a1% == @ set a2=@&& set a1=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a2% == @ set a3=@&& set a2=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a3% == @ set a4=@&& set a3=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a4% == @ set a5=@&& set a4=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a5% == @ set a6=@&& set a5=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a6% == @ set a7=@&& set a6=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a7% == @ set a8=@&& set a7=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a8% == @ set a9=@&& set a8=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a9% == @ set a10=@&& set a9=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a10% == @ set a11=@&& set a10=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a11% == @ set a12=@&& set a11=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a12% == @ set a13=@&& set a12=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse2
            if %a13% == @ set a14=@&& set a13=_&& goto horse2
            goto horse2

            :horse2
            set /a move=%random%*7/32767+1
            if %move% == 1 set motion=1
            if %move% == 5 set motion=1
            if %move% == 6 set motion=1
            if %move% == 2 set motion=2
            if %move% == 7 set motion=2
            if %move% == 3 set motion=3
            if %move% == 4 set motion=0
            set mlimit=0
            if %motion% == 0 goto horse3
            if %b1% == @ set b2=@&& set b1=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b2% == @ set b3=@&& set b2=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b3% == @ set b4=@&& set b3=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b4% == @ set b5=@&& set b4=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b5% == @ set b6=@&& set b5=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b6% == @ set b7=@&& set b6=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b7% == @ set b8=@&& set b7=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b8% == @ set b9=@&& set b8=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b9% == @ set b10=@&& set b9=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b10% == @ set b11=@&& set b10=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b11% == @ set b12=@&& set b11=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b12% == @ set b13=@&& set b12=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse3
            if %b13% == @ set b14=@&& set b13=_&& goto horse3
            goto horse3

            :horse3
            set /a move=%random%*7/32767+1
            if %move% == 1 set motion=1
            if %move% == 5 set motion=1
            if %move% == 6 set motion=1
            if %move% == 2 set motion=2
            if %move% == 7 set motion=2
            if %move% == 3 set motion=3
            if %move% == 4 set motion=0
            set mlimit=0
            if %motion% == 0 goto horse4
            if %c1% == @ set c2=@&& set c1=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c2% == @ set c3=@&& set c2=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c3% == @ set c4=@&& set c3=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c4% == @ set c5=@&& set c4=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c5% == @ set c6=@&& set c5=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c6% == @ set c7=@&& set c6=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c7% == @ set c8=@&& set c7=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c8% == @ set c9=@&& set c8=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c9% == @ set c10=@&& set c9=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c10% == @ set c11=@&& set c10=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c11% == @ set c12=@&& set c11=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c12% == @ set c13=@&& set c12=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse4
            if %c13% == @ set c14=@&& set c13=_&& goto horse4
            goto horse4

            :horse4
            set /a move=%random%*7/32767+1
            if %move% == 1 set motion=1
            if %move% == 5 set motion=1
            if %move% == 6 set motion=1
            if %move% == 2 set motion=2
            if %move% == 7 set motion=2
            if %move% == 3 set motion=3
            if %move% == 4 set motion=0
            set mlimit=0
            if %motion% == 0 goto horse5
            if %d1% == @ set d2=@&& set d1=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d2% == @ set d3=@&& set d2=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d3% == @ set d4=@&& set d3=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d4% == @ set d5=@&& set d4=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d5% == @ set d6=@&& set d5=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d6% == @ set d7=@&& set d6=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d7% == @ set d8=@&& set d7=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d8% == @ set d9=@&& set d8=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d9% == @ set d10=@&& set d9=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d10% == @ set d11=@&& set d10=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d11% == @ set d12=@&& set d11=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d12% == @ set d13=@&& set d12=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto horse5
            if %d13% == @ set d14=@&& set d13=_&& goto horse5
            goto horse5

            :horse5
            set /a move=%random%*7/32767+1
            if %move% == 1 set motion=1
            if %move% == 5 set motion=1
            if %move% == 6 set motion=1
            if %move% == 2 set motion=2
            if %move% == 7 set motion=2
            if %move% == 3 set motion=3
            if %move% == 4 set motion=0
            set mlimit=0
            if %motion% == 0 goto game
            if %e1% == @ set e2=@&& set e1=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e2% == @ set e3=@&& set e2=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e3% == @ set e4=@&& set e3=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e4% == @ set e5=@&& set e4=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e5% == @ set e6=@&& set e5=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e6% == @ set e7=@&& set e6=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e7% == @ set e8=@&& set e7=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e8% == @ set e9=@&& set e8=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e9% == @ set e10=@&& set e9=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e10% == @ set e11=@&& set e10=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e11% == @ set e12=@&& set e11=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e12% == @ set e13=@&& set e12=_&& set /a mlimit= %mlimit%+1
            if %mlimit%== %motion% goto game
            if %e13% == @ set e14=@&& set e13=_&& goto game
            goto game

            :end
            echo %winner% Wins!
            echo.
            set /a wager=%bet%*2
            call save.bat
            if %playerchoice% == %winner2% set /a balance=%balance%+%wager%+%bet%
            echo set balance=%balance% > save.bat
            echo Your total balance is %balance%
            echo.
            pause
            goto horseselect
            :tie
            echo Winners!
            echo =======
            echo.
            if %a14% == @ set winner1=1&& echo Horse 1
            if %b14% == @ set winner2=2&& echo Horse 2
            if %c14% == @ set winner3=3&& echo Horse 3
            if %d14% == @ set winner4=4&& echo Horse 4
            if %e14% == @ set winner5=5&& echo Horse 5
            echo.
            set /a wager=%bet%/2
            call save.bat
            if %playerchoice% == %winner1% set /a balance=%balance%+%bet%+%wager%
            if %playerchoice% == %winner2% set /a balance=%balance%+%bet%+%wager%
            if %playerchoice% == %winner3% set /a balance=%balance%+%bet%+%wager%
            if %playerchoice% == %winner4% set /a balance=%balance%+%bet%+%wager%
            if %playerchoice% == %winner5% set /a balance=%balance%+%bet%+%wager%
            echo Your total balance is %balance%
            echo.
            pause
            goto horseselect

            :loose
            cls
            color c
            echo Thanks for playing! Please visit DesignsByJCM.com
            echo.
            echo YOU RAN OUT OF MONEY! :(
            echo.
            echo Time for a reset :P
            pause>nul
            echo set balance=500 > save.bat
            cls
            color f
            echo You have been granted 500 dollars
            echo.
            pause
            goto horseselect

            :cheat
            call save.bat
            set /p cheat=
            set /a balance=%balance%+%cheat%
            echo set balance=%balance% >save.bat
            goto horseselect

            :save
            echo set balance=%balance% > save.bat
            echo color e >> save.bat
            echo set horse1=%horse1% >> save.bat
            echo set horse2=%horse2% >> save.bat
            echo set horse3=%horse3% >> save.bat
            echo set horse4=%horse4% >> save.bat
            echo set horse5=%horse5% >> save.bat
            set save=yes
            goto horseselect

            :store
            if %stoerror% == yes echo Not enough cash!
            cls
            echo Trade in some of your cash for there awesome features!
            call save.bat
            echo Balance: %balance%
            echo.
            echo 1) Bet on 2 horses (Works only 1 time)     - $250
            echo 2) Name a horse                            - $500
            echo 3) Gold Text                               - $1000
            echo ==================================================
            echo 4) Exit
            set /p op=
            set error=no
            if %op% == 1 goto bet2horse
            if %op% == 2 goto namehorse
            if %op% == 3 goto goldtext
            if %op% == 4 goto horseselect

            :namehorse
            cls
            echo What horse do you want to name?
            echo 1) %horse1%
            echo 2) %horse2%
            echo 3) %horse3%
            echo 4) %horse4%
            echo 5) %horse5%
            echo.
            set /p op=
            cls
            echo What do you want to name it?
            set /p name=
            if %op% == 1 set horse1=%name%
            if %op% == 2 set horse2=%name%
            if %op% == 3 set horse3=%name%
            if %op% == 4 set horse4=%name%
            if %op% == 5 set horse5=%name%
            goto save

            :goldtext
            call save.bat
            if %balance% LSS 1000 set stoerror=yes&& goto store
            set /a balance=%balance%-1000
            echo set balance=%balance% > save.bat
            echo color e >> save.bat
            echo set horse1=%horse1% >> save.bat
            echo set horse2=%horse2% >> save.bat
            echo set horse3=%horse3% >> save.bat
            echo set horse4=%horse4% >> save.bat
            echo set horse5=%horse5% >> save.bat
            goto store

            :setter
            set a1=@
            set a2=_
            set a3=_
            set a4=_
            set a5=_
            set a6=_
            set a7=_
            set a8=_
            set a9=_
            set a10=_
            set a11=_
            set a12=_
            set a13=_
            set a14=_
            set b1=@
            set b2=_
            set b3=_
            set b4=_
            set b5=_
            set b6=_
            set b7=_
            set b8=_
            set b9=_
            set b10=_
            set b11=_
            set b12=_
            set b13=_
            set b14=_
            set c1=@
            set c2=_
            set c3=_
            set c4=_
            set c5=_
            set c6=_
            set c7=_
            set c8=_
            set c9=_
            set c10=_
            set c11=_
            set c12=_
            set c13=_
            set c14=_
            set d1=@
            set d2=_
            set d3=_
            set d4=_
            set d5=_
            set d6=_
            set d7=_
            set d8=_
            set d9=_
            set d10=_
            set d11=_
            set d12=_
            set d13=_
            set d14=_
            set e1=@
            set e2=_
            set e3=_
            set e4=_
            set e5=_
            set e6=_
            set e7=_
            set e8=_
            set e9=_
            set e10=_
            set e11=_
            set e12=_
            set e13=_
            set e14=_
            goto game

            patio

            • Moderator


            • Genius
            • Maud' Dib
            • Thanked: 1769
              • Yes
            • Experience: Beginner
            • OS: Windows 7
            Re: Batch Programs Thread.
            « Reply #613 on: June 26, 2018, 06:21:18 PM »
            Quote
            (This will create a "save.bat" file in the same location as the game) Just as a warning

            Then why would i run it ? ?
            " Anyone who goes to a psychiatrist should have his head examined. "

            JoshCM



              Greenhorn

              • Experience: Familiar
              • OS: Windows 10
              Re: Batch Programs Thread.
              « Reply #614 on: June 29, 2018, 07:59:38 AM »
              Then why would i run it ? ?
              Because it's very easy to see that it's harmless? I was just making anyone who chooses to play aware that the file will be created. In case they have a file already named save.bat that they want to keep. It's called common curtsy