Batch

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

Re: Batch

Post by nosidius on Sat Aug 16, 2008 9:53 pm
([msg=9882]see Re: Batch[/msg])

no, there's the command "delete", so set it on your win32 files and it's a dead computer............ and the admin one is actually a bit complicated, and i'm waiting until school to try it out on their nub security, i might get extra credit....... i dunno, we'll see

and i'm tempted to just make a thread on CMD commands and seeing if anyone else knows more........
give me knowledge or give me death
User avatar
nosidius
Poster
Poster
 
Posts: 177
Joined: Fri Aug 08, 2008 1:40 pm
Blog: View Blog (0)


Re: Batch

Post by hacksys1337 on Wed Sep 17, 2008 11:18 am
([msg=11912]see Re: Batch[/msg])

12 line script for killing all running processes, you have access to.


Code: Select all
@echo off
:start
set x=0
:loop
if ("%x%")==("10000") goto :end
set /a _result="%x% + 1"
set x=%_result%
tskill %x%
goto :loop
:end
echo "Pwned N00b"
pause


you could also go above and make it start minimized as well.
hacksys1337
New User
New User
 
Posts: 3
Joined: Thu Jul 24, 2008 11:26 am
Blog: View Blog (0)


Re: Batch

Post by nosidius on Wed Sep 17, 2008 3:50 pm
([msg=11928]see Re: Batch[/msg])

i was talking the command line script....... such as i know to start something should be "start *.exe" burt what is kill? (be really nice to plant it on a C: drive in a network)
give me knowledge or give me death
User avatar
nosidius
Poster
Poster
 
Posts: 177
Joined: Fri Aug 08, 2008 1:40 pm
Blog: View Blog (0)


Re: Batch

Post by anonHacker on Sat Sep 20, 2008 8:26 pm
([msg=12128]see Re: Batch[/msg])

hacksys1337 wrote:12 line script for killing all running processes, you have access to.


Code: Select all
@echo off
:start
set x=0
:loop
if ("%x%")==("10000") goto :end
set /a _result="%x% + 1"
set x=%_result%
tskill %x%
goto :loop
:end
echo "Pwned N00b"
pause


you could also go above and make it start minimized as well.


You never tried executing that, did you?
If you did, can you tell what you did wrong?
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by beagle on Mon Sep 22, 2008 8:34 pm
([msg=12301]see Re: Batch[/msg])

Hello all...
To brush up on my batch, I made something almost as cool as my game: a port scanner!
Here's the code:

Code: Select all
@echo off
:start
title Batch Port Scanner
color 0a
echo Enter the host you want to scan:
set /p h=
cls
:trace
echo Do you want to trace the route to this host? (Y/N)
set /p trace=
if %trace%==y  goto tracert
if %trace%==n  goto portscan
:portscan
echo Do you want to ping the host before scanning? (Y/N)
set /p z=
if %z%==y  goto ping
if %z%==n  goto scan
set /p
:ping
ping %h%
:scan
cls
pause
echo Trying port 1...
telnet %h% 1
cls
echo Trying port 2
telnet %h% 2
cls
echo Trying port 3...
telnet %h% 3
cls
echo Trying port 4...
telnet %h% 4
cls
echo Trying port 5...
telnet %h% 5
cls
echo Trying port 6...
telnet %h% 6
cls
echo Trying port 7...
telnet %h% 7
cls
echo Trying port 8...
telnet %h% 8
cls
echo Trying port 9...
telnet %h% 9
echo Trying port 10...
telnet %h% 10
cls
echo Trying port 11...
telnet %h% 11
cls
echo Trying port 12...
telnet %h% 12
cls
echo Trying port 13...
telnet %h% 13
cls
echo Trying port 14
telnet %h% 14
cls
echo Trying port 15...
telnet %h% 15
cls
echo Trying port 16...
telnet %h% 16
cls
echo Trying port 17...
telnet %h% 17
cls
echo Trying port 18
telnet %h% 18
cls
echo Trying port 19...
telnet %h% 19
cls
echo Trying port 20...
telnet %h% 20
cls
echo Do you want to exit now? (Y/N)
set /p tt=
if %tt%==y  goto bye
if %tt%==n  goto goodjobyouareactuallyreadingthecode!
:goodjobyouareactuallyreadingthecode!
goto start
:bye
echo Bye!
pause
exit
:tracert
tracert %h%
goto portscan
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 mutants_r_us_guild on Tue Sep 23, 2008 4:59 pm
([msg=12381]see Re: Batch[/msg])

beagle wrote:Hello all...
To brush up on my batch, I made something almost as cool as my game: a port scanner!
Here's the code:

Code: Select all
@echo off
:start
title Batch Port Scanner
color 0a
echo Enter the host you want to scan:
set /p h=
cls
:trace
echo Do you want to trace the route to this host? (Y/N)
set /p trace=
if %trace%==y  goto tracert
if %trace%==n  goto portscan
:portscan
echo Do you want to ping the host before scanning? (Y/N)
set /p z=
if %z%==y  goto ping
if %z%==n  goto scan
set /p
:ping
ping %h%
:scan
cls
pause
echo Trying port 1...
telnet %h% 1
cls
echo Trying port 2
telnet %h% 2
cls
echo Trying port 3...
telnet %h% 3
cls
echo Trying port 4...
telnet %h% 4
cls
echo Trying port 5...
telnet %h% 5
cls
echo Trying port 6...
telnet %h% 6
cls
echo Trying port 7...
telnet %h% 7
cls
echo Trying port 8...
telnet %h% 8
cls
echo Trying port 9...
telnet %h% 9
echo Trying port 10...
telnet %h% 10
cls
echo Trying port 11...
telnet %h% 11
cls
echo Trying port 12...
telnet %h% 12
cls
echo Trying port 13...
telnet %h% 13
cls
echo Trying port 14
telnet %h% 14
cls
echo Trying port 15...
telnet %h% 15
cls
echo Trying port 16...
telnet %h% 16
cls
echo Trying port 17...
telnet %h% 17
cls
echo Trying port 18
telnet %h% 18
cls
echo Trying port 19...
telnet %h% 19
cls
echo Trying port 20...
telnet %h% 20
cls
echo Do you want to exit now? (Y/N)
set /p tt=
if %tt%==y  goto bye
if %tt%==n  goto goodjobyouareactuallyreadingthecode!
:goodjobyouareactuallyreadingthecode!
goto start
:bye
echo Bye!
pause
exit
:tracert
tracert %h%
goto portscan



But it only scans 20 ports.. why stop there... I edited your code a little to scan every port possible. Although it may be a tad slow :P

Code: Select all
@echo off
:start
title Batch Port Scanner
color 0a
echo Enter the host you want to scan:
set /p h=
cls
:trace
echo Do you want to trace the route to this host? (Y/N)
set /p trace=
if %trace%==y  goto tracert
if %trace%==n  goto portscan
:portscan
echo Do you want to ping the host before scanning? (Y/N)
set /p z=
if %z%==y  goto ping
if %z%==n  goto scan
set /p
:ping
ping %h%
:scan
cls
pause
set port=0
:loop
cls
set /a port=%port% + 1
echo Trying port %port%...
telnet %h% %port%
if "%port%"=="65535" goto end
goto loop
:end
cls
echo Do you want to exit now? (Y/N)
set /p tt=
if %tt%==y  goto bye
if %tt%==n  goto goodjobyouareactuallyreadingthecode!
:goodjobyouareactuallyreadingthecode!
goto start
:bye
echo Bye!
pause
exit
:tracert
tracert %h%
goto portscan
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 beagle on Tue Sep 23, 2008 8:13 pm
([msg=12392]see Re: Batch[/msg])

mutants_r_us_guild wrote:
beagle wrote:Hello all...
To brush up on my batch, I made something almost as cool as my game: a port scanner!
Here's the code:

Code: Select all
@echo off
:start
title Batch Port Scanner
color 0a
echo Enter the host you want to scan:
set /p h=
cls
:trace
echo Do you want to trace the route to this host? (Y/N)
set /p trace=
if %trace%==y  goto tracert
if %trace%==n  goto portscan
:portscan
echo Do you want to ping the host before scanning? (Y/N)
set /p z=
if %z%==y  goto ping
if %z%==n  goto scan
set /p
:ping
ping %h%
:scan
cls
pause
echo Trying port 1...
telnet %h% 1
cls
echo Trying port 2
telnet %h% 2
cls
echo Trying port 3...
telnet %h% 3
cls
echo Trying port 4...
telnet %h% 4
cls
echo Trying port 5...
telnet %h% 5
cls
echo Trying port 6...
telnet %h% 6
cls
echo Trying port 7...
telnet %h% 7
cls
echo Trying port 8...
telnet %h% 8
cls
echo Trying port 9...
telnet %h% 9
echo Trying port 10...
telnet %h% 10
cls
echo Trying port 11...
telnet %h% 11
cls
echo Trying port 12...
telnet %h% 12
cls
echo Trying port 13...
telnet %h% 13
cls
echo Trying port 14
telnet %h% 14
cls
echo Trying port 15...
telnet %h% 15
cls
echo Trying port 16...
telnet %h% 16
cls
echo Trying port 17...
telnet %h% 17
cls
echo Trying port 18
telnet %h% 18
cls
echo Trying port 19...
telnet %h% 19
cls
echo Trying port 20...
telnet %h% 20
cls
echo Do you want to exit now? (Y/N)
set /p tt=
if %tt%==y  goto bye
if %tt%==n  goto goodjobyouareactuallyreadingthecode!
:goodjobyouareactuallyreadingthecode!
goto start
:bye
echo Bye!
pause
exit
:tracert
tracert %h%
goto portscan



But it only scans 20 ports.. why stop there... I edited your code a little to scan every port possible. Although it may be a tad slow :P

Code: Select all
@echo off
:start
title Batch Port Scanner
color 0a
echo Enter the host you want to scan:
set /p h=
cls
:trace
echo Do you want to trace the route to this host? (Y/N)
set /p trace=
if %trace%==y  goto tracert
if %trace%==n  goto portscan
:portscan
echo Do you want to ping the host before scanning? (Y/N)
set /p z=
if %z%==y  goto ping
if %z%==n  goto scan
set /p
:ping
ping %h%
:scan
cls
pause
set port=0
:loop
cls
set /a port=%port% + 1
echo Trying port %port%...
telnet %h% %port%
if "%port%"=="65535" goto end
goto loop
:end
cls
echo Do you want to exit now? (Y/N)
set /p tt=
if %tt%==y  goto bye
if %tt%==n  goto goodjobyouareactuallyreadingthecode!
:goodjobyouareactuallyreadingthecode!
goto start
:bye
echo Bye!
pause
exit
:tracert
tracert %h%
goto portscan

Hey, well done! Thank you so much!
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 f22 on Tue Sep 30, 2008 11:47 am
([msg=12858]see Re: Batch[/msg])

This is an escape the room game complete with ascii art that I made during my HS drafting class to amuse myself since I had so much free time. It consists of several files. This is the main one:
Code: Select all
SET path=

ECHO OFF
CLS

ECHO  [--------------------------------------------------------------]
ECHO _
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .          Set the window to the size
ECHO .                  indicated at the top and left
ECHO .         and press enter to continue...
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO .
ECHO _
SET /p x=
CLS

ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.
ECHO.                Common Commands:
ECHO.
ECHO.             [cardinal direction]
ECHO.             use [object]
ECHO.             use [object] on [object]
ECHO.             hit [object]
ECHO.             take [object]
ECHO.             look [preposition] [object]
ECHO.             move [object]
ECHO.
ECHO.
ECHO.              press enter to continue...
SET /p x=
CLS

SET path=%path%data\
SET loc=RoomNorth
SET oldLoc=RoomNorth
SET pic=1
SET input=INITIAL
SET count=0

:start

CALL %path%%loc%.bat

IF "%loc%"=="%oldLoc%" GOTO skipInitial
SET input=INITIAL
SET oldLoc=%loc%
GOTO start
:skipInitial

CLS
IF EXIST %path%%loc%%pic% FOR /F "tokens=1 delims=?" %%i IN (%path%%loc%%pic%) DO ECHO %%i
ECHO.

IF EXIST %path%text FOR /F "tokens=1 delims=?" %%i IN (%path%text) DO ECHO %%i
IF EXIST %path%text DEL %path%text

IF %count% GTR 10 ECHO Try entering something, jackass.
ECHO.
SET input=
SET /p input=
IF "%input%"=="" (SET /a count=%count%+1) ELSE (SET count=0)

GOTO start

And here is the code for a couple of the rooms (which it is sort of cheating to look at)
Code: Select all
IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" ECHO You wake up and find yourself in a locked cell. >> %path%text
IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" ECHO They probably have the Princess too, most likely strapped >> %path%text
IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" ECHO to some sort of diabolical laser-table or something. >> %path%text
IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" ECHO The room continues to the SOUTH. >> %path%text
IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" COLOR 70

IF /I "%input%"=="INITIAL" IF "%start%"=="false" ECHO There's a locked door with a metal handle in front of you  >> %path%text
IF /I "%input%"=="INITIAL" IF "%start%"=="false" ECHO and two lights on the ceiling. Only one of the lights is >> %path%text
IF /I "%input%"=="INITIAL" IF "%start%"=="false" ECHO on. There are also some loose cinder blocks in the corner. >> %path%text

IF /I "%input%"=="SOUTH" SET LOC=RoomSouth
IF /I "%input%"=="NORTH" IF "%doorOpen%"=="true" SET loc=hall

IF /I "%INPUT%"=="Hit wall" ECHO Nothing happens. The wall is too strong. >> %path%text

IF /I "%INPUT%"=="Take cinder blocks" ECHO The blocks are too heavy to carry around. >> %path%text
IF /I "%INPUT%"=="Look in cinder blocks" ECHO There is nothing among the cinder blocks. >> %path%text

IF /I "%input%"=="move cinder blocks" ECHO Where to? >> %path%text
IF /I "%input%"=="move cinder blocks under light" ECHO You push the blocks under the lights. >> %path%text
IF /I "%input%"=="move cinder blocks under lights" ECHO You push the blocks under the lights. >> %path%text
IF /I "%input%"=="move cinder blocks under light" SET blocksMoved=true
IF /I "%input%"=="move cinder blocks under lights" SET blocksMoved=true

IF /I "%INPUT%"=="Take light" ECHO Take the working light or broken light? >> %path%text
IF /I "%INPUT%"=="Take working light" IF NOT "%blocksMoved%"=="true" ECHO You can't reach it. >> %path%text
IF /I "%INPUT%"=="Take broken light" IF NOT "%blocksMoved%"=="true" ECHO You can't reach it. >> %path%text
IF /I "%INPUT%"=="Pull socket" IF NOT "%blocksMoved%"=="true" ECHO You can't reach it. >> %path%text
IF /I "%INPUT%"=="Hit Socket" IF NOT "%blocksMoved%"=="true" ECHO You can't reach it. >> %path%text
IF /I "%input%"=="jump" ECHO You're white. >> %path%text

IF /I "%INPUT%"=="Take working light" IF "%blocksMoved%"=="true" ECHO You take the working light. >> %path%text
IF /I "%INPUT%"=="Take working light" IF "%blocksMoved%"=="true" ECHO As you unscrew it, the socket feels loose. >> %path%text
IF /I "%INPUT%"=="Take working light" IF "%blocksMoved%"=="true" SET haveWorkingLight=true
IF /I "%INPUT%"=="Take working light" IF "%blocksMoved%"=="true" SET lightInLeft=false
IF /I "%INPUT%"=="Take working light" IF "%blocksMoved%"=="true" SET pic=dark
IF /I "%INPUT%"=="Take broken light" IF "%blocksMoved%"=="true" IF NOT "%sharpGlass%"=="true" ECHO You take the broken light. >> %path%text
IF /I "%INPUT%"=="Take broken light" IF "%blocksMoved%"=="true" IF NOT "%sharpGlass%"=="true" ECHO The bulb is burnt out, but intact. >> %path%text
IF /I "%INPUT%"=="Take broken light" IF "%blocksMoved%"=="true" SET haveBrokenLight=true

IF /I "%INPUT%"=="Hit light" ECHO Which light? >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF NOT "%haveBrokenLight%"=="true" ECHO You dont have it. >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" ECHO You smash the bulb, scattering pieces of sharp broken glass. >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" SET sharpGlass=true
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" SET haveBrokenLight=false

IF /I "%INPUT%"=="Take broken glass" IF "%sharpGlass%"=="true" ECHO You take a piece of sharp glass. >> %path%text
IF /I "%INPUT%"=="Take broken glass" IF "%sharpGlass%"=="true" SET haveGlass=true

IF /I "%INPUT%"=="Hit working light" IF NOT "%haveWorkingLight%"=="true" ECHO You dont have it. >> %path%text
IF /I "%INPUT%"=="Hit working light" IF "%haveWorkingLight%"=="true" IF NOT "%doorOpen%"=="true" GOTO breakLight
IF /I "%INPUT%"=="Hit Socket" IF "%blocksMoved%"=="true" IF NOT "%haveWorkingLight%"=="true" IF NOT "%lightInLeft%"=="true" GOTO breakLight
IF /I "%INPUT%"=="Pull Socket" IF "%blocksMoved%"=="true" IF NOT "%haveWorkingLight%"=="true" IF NOT "%lightInLeft%"=="true" GOTO breakLight
GOTO skipBreakLight
:breakLight
COLOR 40
ECHO You smash the bulb into a million pieces, shattering along
ECHO with it any chance of you escaping and sealing the coffin for
ECHO the hope of the free world. Also, a shard hits you in the eye and
ECHO kills you.
PAUSE
EXIT
:skipBreakLight

IF /I "%INPUT%"=="Hit Socket" IF "%blocksMoved%"=="true" GOTO socket
IF /I "%INPUT%"=="Pull Socket" IF "%blocksMoved%"=="true" GOTO socket
GOTO skipSocket
:socket
ECHO The socket comes out of the ceiling, >> %path%text
ECHO leaving an exposed wire danging. >> %path%text
SET socketOut=true
:skipSocket

IF NOT "%haveWorkingLight%"=="true" GOTO skipWorkingLight
IF /I "%INPUT%"=="use working light" ECHO What do you want to do with it? >> %path%text
IF /I "%INPUT%"=="use working light on socket" ECHO Use it on the left or right socket? >> %path%text
IF /I "%INPUT%"=="use working light on right socket" IF "%socketOut%"=="true" ECHO You just broke that socket >> %path%text
IF /I "%INPUT%"=="use working light on right socket" IF NOT "%socketOut%"=="true" SET haveWorkingLight=false
IF /I "%INPUT%"=="use working light on right socket" IF NOT "%socketOut%"=="true" SET pic=2
IF /I "%INPUT%"=="use working light on left socket" IF NOT "%brokenGlass%"=="true" IF NOT "%haveBrokenLight%"=="true" IF NOT "%haveGlass%"=="true" ECHO There is already a bulb there >> %path%text
IF /I "%INPUT%"=="use working light on left socket" IF NOT "%brokenGlass%"=="true" IF NOT "%haveBrokenLight%"=="true" IF NOT "%haveGlass%"=="true" GOTO skipWorkingLight
IF /I "%INPUT%"=="use working light on left socket" SET lightInLeft=true
IF /I "%INPUT%"=="use working light on left socket" SET haveWorkingLight=false
:skipWorkingLight

IF NOT "%socketOut%"=="true" GOTO skipWires

IF /I "%INPUT%"=="use pillowcase on wire" IF "%havePillowCase%"=="true" IF "%pic%"=="dark" ECHO You reach blindly for the wire in the dark. >> %path%text
IF /I "%INPUT%"=="use pillowcase on wire" IF "%havePillowCase%"=="true" IF "%pic%"=="dark" GOTO electrocution
IF /I "%INPUT%"=="use pillowcase on wire" IF "%havePillowCase%"=="true" ECHO You wrap the cloth around the wire. >> %path%text
IF /I "%INPUT%"=="use pillowcase on wire" IF "%havePillowCase%"=="true" SET caseOnWire=true
IF /I "%INPUT%"=="take wire" IF NOT "%caseOnWire%"=="true" GOTO electrocution
IF /I "%INPUT%"=="pull wire" IF NOT "%caseOnWire%"=="true" GOTO electrocution
GOTO skipElectrocution
:electrocution
COLOR 40
ECHO The 240 volts causes you to urinate yourself before
ECHO you die. You must be in Europe.
ECHO.
PAUSE
EXIT
:skipElectrocution
IF /I "%INPUT%"=="take wire" IF "%caseOnWire%"=="true" ECHO It's stuck, but there's some slack >> %path%text
IF /I "%INPUT%"=="pull wire" IF "%caseOnWire%"=="true" ECHO It's stuck, but there's some slack >> %path%text
IF /I "%INPUT%"=="use wire on door" SET wireOnDoor=true
IF /I "%INPUT%"=="use wire on door" ECHO You attach the wire to the handle >> %path%text
IF /I "%INPUT%"=="use wire on handle" SET wireOnDoor=true
IF /I "%INPUT%"=="use wire on handle" ECHO You attach the wire to the handle >> %path%text
:skipWires

IF /I "%INPUT%"=="use key on door" IF NOT "%doorUnlocked%"=="true" GOTO openDoor
IF /I "%INPUT%"=="use key on lock" IF NOT "%doorUnlocked%"=="true" GOTO openDoor
GOTO skipOpenDoor
:openDoor
IF NOT "%haveKey%"=="true" GOTO skipOpenDoor
IF "%wireOnDoor%"=="true" GOTO skipGuard
COLOR 40
ECHO As soon as you finish turning the key, a
ECHO guard turns the handle and kills you with
ECHO a nunchuck-gun.
PAUSE
EXIT
:skipGuard
ECHO As you turn the key, a guard tries to >> %path%text
ECHO open the door, but is killed by the >> %path%text
ECHO electrified handle. >> %path%text
SET doorUnlocked=true
:skipOpenDoor

IF /I "%input%"=="use pillowcase on doorway" IF "%havePillowCase%"=="true" IF "%doorOpen%"=="true" ECHO You put the pillowcase in the doorway >> %path%text
IF /I "%input%"=="use pillowcase on door" IF "%havePillowCase%"=="true" IF "%doorOpen%"=="true" ECHO You put the pillowcase in the doorway >> %path%text
IF /I "%input%"=="use pillowcase on doorway" IF "%havePillowCase%"=="true" IF "%doorOpen%"=="true" SET caseInDoor=true
IF /I "%input%"=="use pillowcase on door" IF "%havePillowCase%"=="true" IF "%doorOpen%"=="true" SET caseInDoor=true

IF /I "%input%"=="use lighter on pillowcase" IF "%caseInDoor%"=="true" GOTO explode
GOTO skipExplode
:explode
IF NOT "%doorOpen%"=="true" GOTO goodExplosion
COLOR 40
ECHO That was so stupid Im not even going to
ECHO make a description of your death.
PAUSE
EXIT
:goodExplosion
ECHO There is a massive explosion in the other room >> %path%text
SET explosion=true
:skipExplode

IF /I "%input%"=="use lighter on door" IF NOT "%doorOpen%"=="true" ECHO You cant get the flame through the door >> %path%text
IF /I "%input%"=="use lighter" IF NOT "%doorOpen%"=="true" ECHO You cant get the flame through the door >> %path%text

IF /I "%INPUT%"=="open door" IF NOT "%doorUnlocked%"=="true" ECHO it's locked >> %path%text
IF /I "%INPUT%"=="open door" IF "%doorUnlocked%"=="true" SET doorOpen=true
IF /I "%INPUT%"=="close door" SET doorOpen=false

IF /I "%input%"=="INITIAL" IF NOT "%start%"=="false" SET start=false

IF NOT "%pic%"=="dark" IF /I "%blocksMoved%"=="true" (SET pic=2) ELSE (SET pic=1)
IF NOT "%socketOut%"=="true" IF "%lightInLeft%"=="true" SET pic=3
IF "%socketOut%"=="true" IF "%lightInLeft%"=="true" SET pic=4
IF NOT "%pic%"=="dark" IF "%doorOpen%"=="true" SET pic=5

Code: Select all
IF NOT "%pic%"=="dark" (IF /I "%INPUT%"=="INITIAL" IF "%bedMoved%"=="true" (SET pic=2) ELSE (SET pic=1))
IF "%hole%"=="true" SET pic=3

IF /I "%INPUT%"=="NORTH" SET loc=RoomNorth

IF /I "%INPUT%"=="Hit wall" ECHO Nothing happens. The wall is too strong. >> %path%text

IF /I "%INPUT%"=="Look Under Pillow" ECHO There is nothing under the pillow. >> %path%text
IF /I "%INPUT%"=="Take pillow" ECHO You can't. It's held on with magic or something. >> %path%text
IF /I "%INPUT%"=="Take pillow" ECHO The pillowcase just keeps slipping off. >> %path%text

IF /I "%INPUT%"=="Look Under Bed" ECHO You see a bucket under the bed. >> %path%text
IF /I "%INPUT%"=="Take bucket" ECHO You now have the bucket. >> %path%text
IF /I "%INPUT%"=="Take bucket" SET haveBucket=true
IF /I "%input%"=="Use bucket on sink" ECHO It is now full of water >> %path%text
IF /I "%input%"=="Use sink on bucket" ECHO It is now full of water >> %path%text
IF /I "%input%"=="Use bucket on sink" SET haveWater=true
IF /I "%input%"=="Use sink on bucket" SET haveWater=true
IF /I "%input%"=="Fill bucket with water" ECHO It is now full of water >> %path%text
IF /I "%input%"=="Fill bucket with water" SET haveWater=true

IF /I "%INPUT%"=="Look Behind Bed" ECHO There is nothing behind the bed, but you do see >> %path%text
IF /I "%INPUT%"=="Look Behind Bed" ECHO a crack in the far wall. >> %path%text

IF /I "%INPUT%"=="Move bed" GOTO BedMoved
IF /I "%INPUT%"=="Push bed" GOTO BedMoved
GOTO SkipBedMoved
:BedMoved
ECHO You move the bed and find a that there is a crack in the wall. >> %path%text
SET pic=2
SET bedMoved=true
:SkipBedMoved

IF /I "%INPUT%"=="hit sink" ECHO The sink is made of solid concrete. >> %path%text
IF /I "%INPUT%"=="hit sink" ECHO Your hand hurts. >> %path%text

IF /I "%INPUT%"=="Lay on bed" ECHO The bed is very uncomfortable. The mattress is full of >> %path%text
IF /I "%INPUT%"=="Lay on bed" ECHO pointy springs and there are many itchy threads. >> %path%text
IF /I "%INPUT%"=="Use bed" ECHO The bed is very uncomfortable. The mattress is full of >> %path%text
IF /I "%INPUT%"=="Use bed" ECHO pointy springs and there are many itchy threads. >> %path%text

IF /I "%INPUT%"=="Take thread" ECHO You take a long thread from the bed. >> %path%text
IF /I "%INPUT%"=="Take thread" SET haveThread=true

IF /I "%INPUT%"=="Take spring" IF NOT "%mattressCut%"=="true" ECHO You can't tear open the mattress, it's too strong. >> %path%text
IF /I "%INPUT%"=="Take spring" IF NOT "%mattressCut%"=="true" ECHO But you may be able to cut it with something. >> %path%text

IF /I "%INPUT%"=="Use glass on mattress" IF "%haveGlass%"=="true" ECHO You cut a hole in the mattress. You also accidentally cut >> %path%text
IF /I "%INPUT%"=="Use glass on mattress" IF "%haveGlass%"=="true" ECHO yourself. This doesn't matter, but you should be more careful. >> %path%text
IF /I "%INPUT%"=="Use glass on mattress" IF "%haveGlass%"=="true" SET mattressCut=true
IF /I "%INPUT%"=="Use broken glass on mattress" IF "%haveGlass%"=="true" ECHO You cut a hole in the mattress. You also accidentally cut >> %path%text
IF /I "%INPUT%"=="Use broken glass on mattress" IF "%haveGlass%"=="true" ECHO yourself. This doesn't matter, but you should be more careful. >> %path%text
IF /I "%INPUT%"=="Use broken glass on mattress" IF "%haveGlass%"=="true" SET mattressCut=true

IF /I "%INPUT%"=="Take spring" IF "%mattressCut%"=="true" ECHO You pull one out, but it is so old that it lost its springiness >> %path%text
IF /I "%INPUT%"=="Take spring" IF "%mattressCut%"=="true" ECHO and is just a piece of stiff steel wire. >> %path%text
IF /I "%INPUT%"=="Take spring" IF "%mattressCut%"=="true" ECHO You now have the wire.  >> %path%text
IF /I "%INPUT%"=="Take spring" IF "%mattressCut%"=="true" SET haveWire=true

IF /I "%INPUT%"=="Bend wire" IF "%haveWire%"=="true" ECHO You bend one end of the wire. >> %path%text
IF /I "%INPUT%"=="Bend wire" IF "%haveWire%"=="true" ECHO You now have a hook. >> %path%text
IF /I "%INPUT%"=="Bend wire" IF "%haveWire%"=="true" SET haveHook=true
IF /I "%INPUT%"=="Make wire into hook" IF "%haveWire%"=="true" ECHO You bend one end of the wire. >> %path%text
IF /I "%INPUT%"=="Make wire into hook" IF "%haveWire%"=="true" ECHO You now have a hook. >> %path%text
IF /I "%INPUT%"=="Make wire into hook" IF "%haveWire%"=="true" SET haveHook=true
IF /I "%INPUT%"=="use wire" IF "%haveWire%"=="true" ECHO what do you want to do with it?  >> %path%text

IF /I "%input%"=="use hook on drain" IF "%haveHook%"=="true" IF "%haveHookThread%"=="true" ECHO It isnt long enough to reach the bottom >> %path%text
IF /I "%input%"=="use wire on drain" IF "%haveWire%"=="true" IF NOT "%haveHook%"=="true" ECHO You insert the wire into the drain, but that >>%path%text
IF /I "%input%"=="use wire on drain" IF "%haveWire%"=="true" IF NOT "%haveHook%"=="true" ECHO accomplishes nothng so you take it back out. >>%path%text

IF /I "%INPUT%"=="Take pillowcase" ECHO You now have the pillowcase. >> %path%text
IF /I "%INPUT%"=="Take pillowcase" SET havePillowCase=true

IF /I "%INPUT%"=="use thread" IF "%haveThread%"=="true" ECHO Use thread on what? >> %path%text
IF /I "%INPUT%"=="use thread on wire" IF "%haveThread%"=="true" IF NOT "%haveHook%"=="true" ECHO Why in God's name would you do that? >> %path%text

IF /I "%INPUT%"=="Hit light" ECHO Which light? >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF NOT "%haveBrokenLight%"=="true" ECHO You dont have it. >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" ECHO You smash the bulb, scattering pieces of sharp broken glass. >> %path%text
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" SET sharpGlass=true
IF /I "%INPUT%"=="Hit broken light" IF "%haveBrokenLight%"=="true" SET haveBrokenLight=false

IF /I "%INPUT%"=="Take sharp glass" IF "%sharpGlass%"=="true" ECHO You take a piece of sharp glass. >> %path%text
IF /I "%INPUT%"=="Take sharp glass" IF "%sharpGlass%"=="true" SET haveGlass=true
IF /I "%INPUT%"=="Take broken glass" IF "%sharpGlass%"=="true" ECHO You take a piece of sharp glass. >> %path%text
IF /I "%INPUT%"=="Take broken glass" IF "%sharpGlass%"=="true" SET haveGlass=true

IF /I "%INPUT%"=="Use thread on hook" IF "%haveThread%"=="true" IF "%haveHook%"=="true" ECHO You tie the thread to the hook. >> %path%text
IF /I "%INPUT%"=="Use thread on hook" IF "%haveThread%"=="true" IF "%haveHook%"=="true" SET haveHookThread=true
IF /I "%INPUT%"=="Use hook on thread" IF "%haveThread%"=="true" IF "%haveHook%"=="true" ECHO You tie the thread to the hook. >> %path%text
IF /I "%INPUT%"=="Use hook on thread" IF "%haveThread%"=="true" IF "%haveHook%"=="true" SET haveHookThread=true

IF /I "%input%"=="use hook on drain" IF "%haveHook%"=="true" IF NOT "%haveHookThread%"=="true" ECHO It wont reach the bottom. >> %path%text

IF /I "%INPUT%"=="Use hook on drain" IF "%haveHookThread%"=="true" GOTO Sink
IF /I "%INPUT%"=="Use thread on drain" IF "%haveHookThread%"=="true" GOTO Sink
GOTO SkipSink
:Sink
IF /I "%sinkOn%"=="false" ECHO You lower the thread and hook into the drain, but there is >> %path%text
IF /I "%sinkOn%"=="false" ECHO no way to hook it to the object. >> %path%text
IF /I "%sinkOn%"=="true" ECHO You lower the thread and hook into the drain. As the object is >> %path%text
IF /I "%sinkOn%"=="true" ECHO tossed around by the water, it eventually is caught on the hook. >> %path%text
IF /I "%sinkOn%"=="true" ECHO It turns out to be a key. >> %path%text
IF /I "%sinkOn%"=="true" SET haveKey=true
:SkipSink

SET sinkOn=false
IF /I "%INPUT%"=="Use sink" ECHO When you turn on the sink, you can hear something clinking >> %path%text
IF /I "%INPUT%"=="Use sink" ECHO around in the drain. >> %path%text
IF /I "%INPUT%"=="Use sink" SET sinkOn=true
IF /I "%INPUT%"=="Turn on sink" ECHO When you turn on the sink, you can hear something clinking >> %path%text
IF /I "%INPUT%"=="Turn on sink" ECHO around in the drain. >> %path%text
IF /I "%INPUT%"=="Turn on sink" SET sinkOn=true
IF /I "%INPUT%"=="Turn faucet" ECHO When you turn on the sink, you can hear something clinking >> %path%text
IF /I "%INPUT%"=="Turn faucet" ECHO around in the drain. >> %path%text
IF /I "%INPUT%"=="Turn faucet" SET sinkOn=true
IF /I "%INPUT%"=="Look in drain" ECHO You can see a faint glimmer of metal in the pipe >> %path%text

IF /I "%INPUT%"=="Hit crack" IF "%bedMoved%"=="true" ECHO This is no time for that. But seriously, >> %path%text
IF /I "%INPUT%"=="Hit crack" IF "%bedMoved%"=="true" ECHO the wall is too strong, even at the crack. >> %path%text
IF /I "%INPUT%"=="shoot crack" IF "%haveGun%"=="true" GOTO shootCrack
GOTO skipShootCrack
:shootCrack
COLOR 40
ECHO The bullet bounces off harmlessley. >> %path%text
ECHO Since you can't win the game at this point anyway, >> %path%text
ECHO you just die of a heart attack. >> %path%text
:skipShootCrack

IF /I "%INPUT%"=="use pipe on crack" GOTO hole
IF /I "%INPUT%"=="hit crack with pipe" GOTO hole
GOTO skipHole
:hole
IF NOT "%havePipe%"=="true" GOTO skipHole
IF NOT "%bedMoved%"=="true" GOTO skipHole
ECHO You dont have any crack. >> %path%text
ECHO But seriously, you bust a hole in the wall, leading WEST. >> %path%text
SET hole=true
SET pic=3
:skipHole

IF /I "%input%"=="west" IF "%hole%"=="true" SET loc=final

And here are a couple of the image files (slightly distorted):
Code: Select all
    \          |                                   /
     \         |                                  /
   (===========U==-+                             / 
       \           \\                           /   
        \           \\                         /   
         \           \\                       /     
          \           \\                     /       
           \___________\\___________________/     ./|
           |            ()                  |    /##|
           |                                |    |##|
           |                                |    |##|
           |                __________      |    |##|
           |                l        l      |    |##|
           |                |        |      |    |##|
           |                |        =      |    |##|
           |                | O      |      |    |##|
           |                |        |      |    |##|
           |                | J      |      |    |##|
           |                |        =      |    |##|
           |                |        |      |    |##|
           |________________1________1______|    |##|
           /                                \    |##|
          /                                  \   |##|
         /                             o      \  |##|
        /                          o   /       \ |##|
       /                           \__|         \|##|
      /                               \  __o     \##|
     /                                 \/ __      \#|
    /                                  |\/ x\      \|
                                    o_/  \_x/       \

Code: Select all
\                                                            ,/
  \                                                         ,/
   \                                                      ,/
    \                                                   ,/
     \                                                ,/
      \                                             ,/
       \___________________________________________/
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
       |                                           |
    ,======,                                       |
   /)=r  //|                       ________________|
  //____// |                      |\     ______    \
+======/ /                       | '\   {     }    '\
|______|/________________________\   '\  {_____}     '\
  _  ||/                          H'\   '\              '\
} \///                           H  '\   '\              '\
  '--/                                 '\   '\              '\
    /                                    '\   '\______________J
   /                                       '\  |               |
  /                                          '\|_______________|             
/                                             H               H\
/                                              H               H


If you actually want to play it (and trust some guy on a hacking site enough to run his batch files), here is a link: http://www.filefactory.com/file/0bedb2/ ... e_Room_rar
f22
New User
New User
 
Posts: 13
Joined: Sun Sep 28, 2008 10:06 pm
Blog: View Blog (0)


Re: Batch

Post by anonHacker on Sat Oct 04, 2008 10:44 pm
([msg=13147]see Re: Batch[/msg])

f22, too much free time? Reminds me of the time I had the bright idea to code an RPG engine (with color!) in pure batch. I gave up when I realized it was an utterly pointless idea.

In other news, I got bored and reviewed my code. Two simple optimizations later, my batch script to solve programming 1 is now 20 lines.
anonHacker
Experienced User
Experienced User
 
Posts: 76
Joined: Sun Jul 27, 2008 10:51 am
Blog: View Blog (0)


Re: Batch

Post by f22 on Sun Oct 05, 2008 12:11 am
([msg=13154]see Re: Batch[/msg])

f22 wrote:to amuse myself since I had so much free time.

anonHacker wrote:f22, too much free time?

How'd you guess?

Yeah, the class was so easy that I would end up just sitting there half the class with nothing to do after finishing the work, and since everything was blocked and I was too lazy to bring in a flash drive every class, that is how I started amusing myself.

Also, mine has color too :P
f22
New User
New User
 
Posts: 13
Joined: Sun Sep 28, 2008 10:06 pm
Blog: View Blog (0)


PreviousNext

Return to Microsoft Windows

Who is online

Users browsing this forum: No registered users and 0 guests

cron