Forum

> > Off Topic > help wanted batch file expert
ForenübersichtOff Topic-ÜbersichtEinloggen, um zu antworten

Englisch help wanted batch file expert

7 Antworten
Zum Anfang Vorherige 1 Nächste Zum Anfang

alt help wanted batch file expert

ab6100
User Off Offline

Zitieren
hi.......

im ab6100
im trying to make a text baced rpg useing batch and im looking for anyone who can help with a problem

what im trying to do is read a varable from another batch file so like

file 1 has the varable %gold%=100
and file 2 needs to know how much %gold% is worth.

ps. i'll post a link on thes thread when its finished

alt Re: help wanted batch file expert

Flacko
User Off Offline

Zitieren
You can call your second file with that value as a parameter.

start yourfile.bat yourvalue

Then from your second file you can access that value by using %1%

alt Re: help wanted batch file expert

ab6100
User Off Offline

Zitieren
@ dark byte thank you

@ Flacko a little bit more info on that would be helpful
i tryed what you sed but i couldnt get it to work : (

alt Re: help wanted batch file expert

Flacko
User Off Offline

Zitieren
File 1:
1
2
@echo off
start file2.bat 5

File 2:
1
echo %1%

Output hat geschrieben
5


So instead of start file2.bat 5 you can write start file2.bat %gold%

alt Re: help wanted batch file expert

ab6100
User Off Offline

Zitieren
ooohhh...
thank you

ok... now one more question?

how do i permintaly change a varable

like in my script
lvl=1
and i lvl up
how do i save that as lvl=2 with out going into the batchfile?

alt Re: help wanted batch file expert

Flacko
User Off Offline

Zitieren
set lvl=1
set /A lvl=lvl+1>nul

That's how you level up.
The >nul thing just prevents the command from echoing the new value of lvl.
For more info start cmd and type set/?
1× editiert, zuletzt 20.07.10 16:15:51

alt Re: help wanted batch file expert

ab6100
User Off Offline

Zitieren
ya but that dosent purmently change the varable in the batch file

Well-- i ofical gave up on this for a wile... but now im up and makeing it agan i put it up when it had 5-10 maps made then ill post map packs.
1× editiert, zuletzt 22.01.11 18:46:54
Zum Anfang Vorherige 1 Nächste Zum Anfang
Einloggen, um zu antwortenOff Topic-ÜbersichtForenübersicht