Batch

The ubiquitous operating system, discussion of its (many) flaws, and how to mitigate the risks of those flaws

Batch

Post by beagle on Tue Jul 08, 2008 8:15 pm
([msg=6916]see Batch[/msg])

If you have any good batch code, please paste it in this section. I realize that there's not a lot you can do with batch, but if you do have any neat batch programs, please post them here. Here's the code for my batch game (if you want to play it, just copy and paste it into notepad and save it as game.bat
Code: Select all
@echo off
color 2
:start
echo Welcome to my adventure game. This is a text-based game, meaning there are no graphics. Type "play" to start the game. Type "help" to view the commands you can use. ("n" means North, "s" is south, "e" is east, and "w" is west.) If you get stuck, you can use the "give up" command to start over. If you are a programmer, feel free to play around with the source code.
echo Have fun!
set /p a=Enter your command:
if %a%==play  goto game
if %a%==help  goto help
:help
echo Commands you can  use:
echo ----------------------
echo n
echo e
echo s
echo w
echo give up
goto start
:game
echo You are in a cave. There are tunnels going north and east.
set /p n=
if %n%==n  goto north
if %n%==w  goto error
if %n%==e  goto east
if %n%==s  goto error
if %n%==give up  exit
:error
echo You cannot go that way.
pause
cls
goto game
:east
echo You were attacked by bats and killed. Start over
pause
goto start
:north
echo You chose the correct path. You are out of the cave. You are standing in an open field. Where do you go?
set /p b=
if %b%==n  goto nth
if %b%==s  goto nth
if %b%==e  goto e
if %b%==w  goto nth
if %b%==give up  exit
:nth
echo You had a heart attack and died. Game over
goto start
:e
echo You are now in a forest. The only paths are north and south.
set /p z=
if %z%==n  goto die
if %z%==e  goto error
if %z%==s  goto path
if %z%==w  goto error
if %z%==give up  exit
:die
echo You tripped on a rock and died. Game over.
goto start
:path
echo You are still in the forest. The Only paths now are south and east
set /p x=
if %x%==n  goto error
if %x%==e  goto death
if %x%==s  goto happy
if %x%==w  goto error
if %x%==give up  exit
:death
echo A snake bit you and you died. Game over.
pause
goto start
:happy
echo You are out of the forest now, but a tribe of Indians surrounded you. The only ways out are south and east.
set /p d=
if %d%==n  goto error
if %d%==e  goto indians
if %d%==s  goto escape
if %d%==w  goto error
if %d%==give up  exit
:indians
echo They saw what you were up to and stabbed you with sharp rocks. Game over.
pause
goto start
:escape
echo You are standing at the edge of a cliff.
set /p 3=
if %3%==n  goto fall
if %3%==e  goto found
if %3%==s  goto won
if %3%==w  goto tripped
:fall
echo You walked off the cliff. Game over.
pause
goto start
:found
echo The Indians found you again and shot you with arrows. Game over
pause
goto start
:tripped
echo You tripped on a rock and fell off the cliff. Game over.
pause
goto start
:won
echo YOU WON THE GAME!! Congrats!
echo Please type your name:
set /p m=
echo WINNERS
echo ---------
echo 1 %m%
echo 2
echo 3
echo 4
echo 5
pause
cls
goto start



011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


Re: Batch

Post by computerdude523 on Wed Jul 09, 2008 10:58 am
([msg=6971]see Re: Batch[/msg])

DUDE!

Very good batch scipt. I like the ways how you die. Random. ;)

-Sam
Me: "Just Because You SAY You're A Hacker, Doesn't Really Mean You Are One."
A Noob: "Really?"
Me: "NO, Smart One. Now If You Are One, Prove It."
A Noob: ...
Me: "That's What I Thought."

< computerdude523 >
User avatar
computerdude523
New User
New User
 
Posts: 45
Joined: Wed Jul 09, 2008 10:43 am
Blog: View Blog (0)


Re: Batch

Post by beagle on Wed Jul 09, 2008 10:59 am
([msg=6972]see Re: Batch[/msg])

Thanks. I tried to make it as random as possible.
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


Re: Batch

Post by Static-Oblivion on Sun Jul 20, 2008 2:23 pm
([msg=7893]see Re: Batch[/msg])

Cool beagle GJ
Also please if your going to post/use batch here LOOK AT THE CODE.
Static-Oblivion
New User
New User
 
Posts: 33
Joined: Thu May 15, 2008 6:21 am
Blog: View Blog (0)


Re: Batch

Post by beagle on Mon Jul 21, 2008 10:41 am
([msg=7938]see Re: Batch[/msg])

Static-Oblivion wrote:Also please if your going to post/use batch here LOOK AT THE CODE.

Yeah, no kidding. A friend of mine downloaded a batch program off the internet. It wiped out his Hard Drive. :cry:
011000100110010101100001011001110110110001100101
beagle
Poster
Poster
 
Posts: 244
Joined: Wed Jul 02, 2008 2:37 pm
Location: Chico, CA
Blog: View Blog (0)


Re: Batch

Post by dlottn on Wed Jul 23, 2008 3:15 pm
([msg=8088]see Re: Batch[/msg])

It's the useless directory creator

Code: Select all
@echo off
:start
echo Yay
mkdir lol
cd lol
cls
goto start


And the crowd goes wild ! :mrgreen: :P
dlottn
New User
New User
 
Posts: 2
Joined: Mon Jul 21, 2008 9:30 pm
Blog: View Blog (0)


Re: Batch

Post by superkid68 on Thu Jul 24, 2008 5:28 pm
([msg=8207]see Re: Batch[/msg])

lol, the most useless batch ever made :D
superkid68
New User
New User
 
Posts: 37
Joined: Fri Jun 13, 2008 8:42 am
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Fri Jul 25, 2008 11:14 pm
([msg=8300]see Re: Batch[/msg])

oooooh... i love DOS.. let me get in on this...
Well... I've been working on this project of mine for about a week now. Windows allows you to use an HTML file as your desktop, which also means dynamic stuff like javascript. So I made an html file that used a drop down box to get to my things rather than icons that clutter the desktop. Then I added animated images, which would freeze up normally if used as a desktop. Then I got crafty with the JS and made all of the images dynamically refresh. Meaning that if the image changed during that time it would display the new image onscreen in a matter of seconds. Then... I whipped out notepad once more and crafted some batch files to handle the swapping of images. Now I have a full-fledged program that allows you to change every aspect of the desktop, add new components, and save your themes as batch files to use later. I even use an original idea of mine on how to store variables in files for later use. Basically... i echo it out into a file, then have parts of the batch files saved into pieces... then i copy them all together so that the files i echoed the variables out to fall into place so that they are trasnferred permanently into the new batch file. Its hard to explain... so Ill rar or zip all the files up later and upload em
then ill post em here. :)
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Re: Batch

Post by fashizzlepop on Fri Jul 25, 2008 11:28 pm
([msg=8302]see Re: Batch[/msg])

Oooh, PM me when your done. That sounds pretty awesome... Coincidently I have a huge problem with desktop Icons right now :(
The glass is neither half-full nor half-empty; it's merely twice as big as it needs to be.
User avatar
fashizzlepop
Developer
Developer
 
Posts: 2304
Joined: Sat May 24, 2008 1:20 pm
Blog: View Blog (0)


Re: Batch

Post by mutants_r_us_guild on Fri Jul 25, 2008 11:53 pm
([msg=8305]see Re: Batch[/msg])

w00t I just put the files in a rar file and added a readme.txt!
Next stop: Fileden.com

here it is:
http://www.fileden.com/files/2008/1/10/ ... esktop.rar

to add new skulls, just download gif anims and save as .sk... same for fire... just replace .sk with .fr
Last edited by mutants_r_us_guild on Sat Jul 26, 2008 12:02 am, edited 1 time in total.
Image
Image
Image
User avatar
mutants_r_us_guild
Poster
Poster
 
Posts: 246
Joined: Fri May 30, 2008 7:56 pm
Blog: View Blog (0)


Next

Return to Microsoft Windows

Who is online

Users browsing this forum: No registered users and 0 guests