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

Author Topic: I need help loading  (Read 7373 times)

0 Members and 1 Guest are viewing this topic.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: I need help loading
« Reply #15 on: July 08, 2014, 06:19:39 AM »
There are a few extra exe's in win7 than in xp.  The one that pops in my head first is 'choice', but I know there are other differences.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #16 on: July 09, 2014, 01:51:23 PM »
Is else one two? Oh and the code well I was really happy but I just found out that the usb port was filled with chex mix. I cleaned it out but it is all jacked up I took it in to fix it.
My luck sucks :(
Pff computers are easy, math is hard.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #17 on: July 10, 2014, 11:52:06 AM »
this is part of the code!
@echo off
color 0a
:menu
echo Can you survive in the House...
echo Will you enter the house?
echo y/n
set /p c=
if "%c%" == "y" goto enter
if "%c%" == "n" exit
goto menu
:enter
cls
echo You walk in and hear creepy stuff.
echo There are three doors, choose wisely.
echo 1,2,3
set /p c=
if "%c%" == "1" goto living
if "%c%" == "2" goto bath
if "%c%" == "3" goto stairs
goto enter

:living
cls
set p=living
echo As you walk in, the very air is sick.
echo But you notice something as you walk
echo in. You just nuged it off.
echo 1) go through the next door
echo 2) go back
echo 3) look around

if "%c%" == "1" goto kicthen
if "%c%" == "2" goto enter
if "%c%" == "3" goto rloot

:rloot
set /a loot=%random% %% 5-1
if "%loot%" == "1" do (
echo You have found five bullets!
set ammo=5
)

set /a loot=%random% %% 5-1
if "%loot%" == "2" do (
echo You have found a pistol
set pistol=true
)
set /a loot=%random% %% 5-1
if "%loot%" == "3" do (
echo You have found nothing!
)
set /a loot=%random% %% 5-1
if "%loot%" == "4" do (
echo You have found an axe!
set axe=true
)
set /a loot=%random% %% 5-1
if "%loot%" == "5" do (
echo You have found nothing! yay
)
pause
goto living room

:kicthen
set p=kicthen
echo As you walk you notice blood all over
echo the floor. You start to hear noise.
echo Two options up stair ,or back.
echo 1,2
set /p c=
if "%c%" == "1" goto stairs
if "%c%" == "2" goto living
goto kicthen
:stairs
set p=stairs
echo As you walk up the stairs, it makes
echo strange noises. But as soon you make
echo it up the stairs. You hear something
echo scream from the next room.
echo Back or go to the screaming room.
echo 1,2
set /p c=
if "%c%" == "1" goto kicthen
if "%c%" == "2" goto bed

:bed
set p=bed
echo As soon as you reach the door, something
echo srceams again. As you open the door, You
echo see something in the bed. When you
echo aproch it screams and flings out of the
echo bed and grabs you, throws you at the wall
echo and runs out of the room.
echo Follow it or run away.. or save
echo 1,2,3
set /p c=
if "%c%" == "1" goto k
if "%c%" == "2" goto enter
if "%c%" == "3" goto save
goto bed

:save
(echo set p=%p%) > test.txt
(echo set axe=%axe%) >> test.txt
(echo set pistol=%pistol%) >> test.txt
(echo set ammo=%ammo%) >> test.txt
echo Saved...
pause
goto menu

:load
if %p% == "stairs" goto stairs
if %p% == "bed" goto bed
if %p% == "kicthen" goto kicthen
echo loaded!
pause

i hope this helps
Pff computers are easy, math is hard.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: I need help loading
« Reply #18 on: July 10, 2014, 02:26:51 PM »
I don't see where you attempt to load at all.  Plus there are numerous mistakes throughout the code.

@echo off
color 0a
:menu
set c= && rem helps with recursion
echo Can you survive in the House...
echo Will you enter the house? or Load a game?
echo Y/N/L
set /p c=
if /i "%c%" == "y" goto enter
if /i "%c%" == "n" exit
if /i "%c%" == "l" goto :load
goto menu

:enter
cls
set "c=0" && rem Remove last selection
echo You walk in and hear creepy stuff.
echo There are three doors, choose wisely.
echo 1,2,3
set /p c=
if "%c%" == "1" goto living
if "%c%" == "2" goto bath
if "%c%" == "3" goto stairs
goto enter

:living
cls
set p=living
set "c=0" && rem Remove last selection
echo As you walk in, the very air is sick.
echo But you notice something as you walk
echo in. You just nuged it off.
echo 1) go through the next door
echo 2) go back
echo 3) look around
set /p c=
if "%c%" == "1" goto kicthen
if "%c%" == "2" goto enter
if "%c%" == "3" goto rloot

:rloot
set /a loot=%random% %% 5-1
REM there is no "do" in an if statement
if "%loot%" == "1" (
echo You have found five bullets!
set /a ammo+=5 && rem What if you already have ammo?
)
REM %loot% will carry over
if "%loot%" == "2" (
echo You have found a pistol
set pistol=true
)
if "%loot%" == "3" echo You have found nothing!
if "%loot%" == "4" (
echo You have found an axe!
set axe=true
)
if "%loot%" == "5" echo You have found nothing! yay
pause
goto living && REM there is no tag "living room"

:kicthen
set "c=0" && rem Remove last selection
set p=kicthen
echo As you walk you notice blood all over
echo the floor. You start to hear noise.
echo Two options up stair ,or back.
echo 1,2
set /p c=
if "%c%" == "1" goto stairs
if "%c%" == "2" goto living
goto kicthen

:stairs
set "c=0" && rem Remove last selection
set p=stairs
echo As you walk up the stairs, it makes
echo strange noises. But as soon you make
echo it up the stairs. You hear something
echo scream from the next room.
echo Back or go to the screaming room.
echo 1,2
set /p c=
if "%c%" == "1" goto kicthen
if "%c%" == "2" goto bed

:bed
set "c=0" && rem Remove last selection
set p=bed
echo As soon as you reach the door, something
echo screams again. As you open the door, You
echo see something in the bed. When you
echo aproch it screams and flings out of the
echo bed and grabs you, throws you at the wall
echo and runs out of the room.
echo Follow it or run away.. or save
echo 1,2,3
set /p c=
if "%c%" == "1" goto k
REM tag :k is missing
if "%c%" == "2" goto enter
if "%c%" == "3" goto save
goto bed

:save
(echo set p=%p%) > test.txt
(echo set axe=%axe%) >> test.txt
(echo set pistol=%pistol%) >> test.txt
(echo set ammo=%ammo%) >> test.txt
echo Saved...
pause
goto menu

:load

for /f "delims=" %%A in (test.txt) do set %%A

if %p% == "stairs" goto stairs
if %p% == "bed" goto bed
if %p% == "kicthen" goto kicthen
echo loaded! This will never trigger
pause
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: I need help loading
« Reply #19 on: July 10, 2014, 03:55:32 PM »
A better way just occured to me for :load

Code: [Select]
:load
for /f "delims=" %%A in (test.txt) do set %%A
goto :%p%
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #20 on: July 11, 2014, 02:26:10 PM »
First of all I wrote that on this. In a meeting sorry for try to help u so u could help me and that doesn't help I have tried that when I first asked about this.
Pff computers are easy, math is hard.

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: I need help loading
« Reply #21 on: July 11, 2014, 04:01:15 PM »
ok, I want you to turn echo on.  Then open cmd and run the batch file from that.  Then attempt to load.  Tell us what it says.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #22 on: July 25, 2014, 11:27:03 AM »
Sorry for long wait. On vaction but what do u mean by turning echo on? How do I run from cmd
I am a noob at cmd
Pff computers are easy, math is hard.

Salmon Trout

  • Guest
Re: I need help loading
« Reply #23 on: July 25, 2014, 11:36:44 AM »
what do u mean by turning echo on?

Type ECHO /? at the prompt. You can find help for most if not all commands this way. Also there is the web. You may be a "noob" but you have the tools to learn.


shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #24 on: July 25, 2014, 11:48:24 AM »
Ok so I got to the dir where it was and in ran fine but I have to set it up for saving and what type of . Should I use
« Last Edit: July 25, 2014, 12:08:29 PM by shiverbob »
Pff computers are easy, math is hard.

Salmon Trout

  • Guest
Re: I need help loading
« Reply #25 on: July 25, 2014, 12:28:44 PM »
What?

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #26 on: July 25, 2014, 12:54:43 PM »
So when I run in it my other game and i try to save or load it skips the code block and goes to the next block and it doesn't even my the save.txt
Pff computers are easy, math is hard.

Salmon Trout

  • Guest
Re: I need help loading
« Reply #27 on: July 25, 2014, 01:02:19 PM »
You need to work on expressing yourself more clearly.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #28 on: July 25, 2014, 01:24:20 PM »
So when I run the game through cmd and I play it so the varbles change then I go to save it goes to the wrong place and I went in looked at the code and it should work. But when I go in the game it does the same thing for loading and saving. I went back in the code and the place it goes to, it goes to a code block under both save and load code block.
Pff computers are easy, math is hard.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #29 on: July 25, 2014, 01:29:33 PM »
For some random reason I just took out the part where I was working on and it works sorry for the world of trouble and Thanks a million
Pff computers are easy, math is hard.