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 7377 times)

0 Members and 1 Guest are viewing this topic.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
I need help loading
« on: June 30, 2014, 01:22:53 PM »
I can save perfectly but I can't load and have the variables change with it any help I will try.
My code looks like this:
@echo off
Setlocal enabledelayedexpasion
Set var1=3
Set var2=7
Set var3=4
Set var4=4
Set var1_wieght=6
Set var1_value=4
Stuff like that
I am writing this on a tablet because my computer has an internet issue
But my computer is an windowns xp and is an hp computer.
Thanks
Pff computers are easy, math is hard.

Salmon Trout

  • Guest
Re: I need help loading
« Reply #1 on: June 30, 2014, 02:20:26 PM »
Batch code:

@echo off
set val1=32
set val2=54
set val3=69

echo these are values we will save:
echo val1=%val1%
echo val2=%val2%
echo val3=%val3%

if exist values.dat del values.dat
echo val1=%val1% >> values.dat
echo val2=%val2% >> values.dat
echo val3=%val3% >> values.dat

echo reset values:
set val1=0
set val2=0
set val3=0
echo val1=%val1%
echo val2=%val2%
echo val3=%val3%

echo load values:
for /f "delims=" %%A in (values.dat) do set %%A
echo val1=%val1%
echo val2=%val2%
echo val3=%val3%


Batch output:

these are values we will save:
val1=32
val2=54
val3=69
reset values:
val1=0
val2=0
val3=0
load values:
val1=32
val2=54
val3=69

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #2 on: June 30, 2014, 02:48:22 PM »
Thanks
 But sadly that for some unknown reason won't work i t just shuts down
Pff computers are easy, math is hard.

Salmon Trout

  • Guest
Re: I need help loading
« Reply #3 on: June 30, 2014, 02:51:20 PM »
i t just shuts down

What, the PC shuts down?

Lemonilla



    Apprentice

  • "Too sweet"
  • Thanked: 70
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 7
Re: I need help loading
« Reply #4 on: June 30, 2014, 03:06:54 PM »
Connect your tablet to the computer, and post the whole code.  It is most likely be a directory discrepancy.
Quote from: patio
God Bless the DOS Helpers...
Quote
If it compiles, send the files.

foxidrive



    Specialist
  • Thanked: 268
  • Experience: Experienced
  • OS: Windows 8
Re: I need help loading
« Reply #5 on: June 30, 2014, 04:31:00 PM »
Thanks
 But sadly that for some unknown reason won't work i t just shuts down

Put a pause command as the last line.

shiverbob

    Topic Starter


    Beginner

    Thanked: 1
    • Yes
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows XP
Re: I need help loading
« Reply #6 on: July 01, 2014, 12:33:47 PM »
When I conect to thhe computer it wants me to install mpt and my tablet is a nook
 ::)
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 #7 on: July 01, 2014, 05:14:18 PM »
How are you running a batch file on a nook?  It uses android.  I'll work on a adb solution.  Where is your file saved on the nook?

something like this:
Code: [Select]
adb pull "%loc%" "%cd%\BatchFile.bat"
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 #8 on: July 02, 2014, 05:58:56 PM »
I am not running the file through a nook I can but I use a windows xp.
It is a hp tower
I don't know if that 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 #9 on: July 02, 2014, 06:23:44 PM »
So if you are not running the batch file on the nook, but when you run it it doesn't work, and you cannot transfer it off the nook, what is it doing on the nook to begin with?

If the file is actually on the hp tower and not the nook, then can't you move it over via flash drive to the computer you are posting from and then post the code?
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 #10 on: July 02, 2014, 06:32:19 PM »
No the tower doesn't have internet this does and the file was never on the nook
If it helps it is and hp tower with operating system of window xp home edition
And I have no other computer that works right now I am in the middle of building one
I am posting from the nook
« Last Edit: July 02, 2014, 07:31:55 PM by shiverbob »
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 #11 on: July 02, 2014, 07:43:50 PM »
I tried the code and it says envirment varible not set?
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 #12 on: July 02, 2014, 09:05:10 PM »
You aren't overriding %path% are you?  If not, check to make sure that C:\windows\system32 is somewhere in that.  It should be easy to do with
Code: [Select]
echo %path% | find "system32"
if something shows up, you have it in there.
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 #13 on: July 04, 2014, 10:04:33 PM »
I just took away echo off and it says what it is supposed to say
This weekend I will try updating it to vista and see if that helps
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 #14 on: July 07, 2014, 01:49:46 PM »
It is all saved to my desktop and I have know idea why its not working.
It work on my friends computer and his was a  windows 7
I will upload the code tomorrow I am going to be out of town
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 #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.