PROBLEM

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
silent
Posts: 44
Joined: 28 Oct 2011 14:40

PROBLEM

#1 Post by silent » 02 Jan 2012 13:25

i have made a apply builder to some samp server (file is made in batch) it creates done bbcode and everything in a apply.txt file but it puts to apply.txt only one line,the last one and i want them all
Code :

Code: Select all

@echo off
title Batch
color 0b
:MENU
cls
 echo Welcome to Network-Unlimited Apply Builder.
 echo Here you can easily make apply for admin on network-unlimited.com
 echo After building an apply in folder where you have the .exe file you will find an file
 echo called "apply.txt" here is everything,bbcodes etc,just copy it and post new thread on network unlimited.
 echo Options
 echo __________________________________________________________________
 echo 1.Build an apply
 echo 2.Exit
 echo 3.Credits
 
 set /p OPTIONCHOOSE=
 
if %OPTIONCHOOSE% ==Credits goto CREDITS
if %OPTIONCHOOSE% ==credits goto CREDITS
if %OPTIONCHOOSE% ==1 goto BUILD
if %OPTIONCHOOSE% ==Build an apply goto BUILD
if %OPTIONCHOOSE% ==2 goto exit
if %OPTIONCHOOSE% ==Exit goto exit
if %OPTIONCHOOSE% ==exit goto exit
if %OPTIONCHOOSE% ==3 goto CREDITS

:WRONGOPTION
cls
echo It seems like option you have choosen doesnt exists
echo Redirecting
goto :MENU
ping localhost -n 2>nul

:CREDITS
cls
echo This program is made using winxp dos batch,notepad ++ and brain.
echo Program is made by SilenT (AKA SilentDrifT) for Network Unlimited
echo Spotted bugs :
echo It may crash when using space but it shouldnt,i have used "%step*%" + automatic redirect
echo to next step,so its fixed.
echo Thanks to whole Network Unlimited,and my corn snake "Skipper"
pause
goto :MENU
 
:BUILD
cls
echo What can you offer Stunts Unlimited (be unique):

set /p step1=

if "%step1%" ==goto stepp2
goto :stepp2

:stepp2
echo Why do you want to become an admin (besides kicking/banning cheaters):

set /p step2=

if "%step2%" ==goto stepp3
goto :stepp3

:stepp3
echo How long have you been with us:

set /p step3=

if "%step3%" ==goto stepp4
goto :stepp4

:stepp4
echo For how long have you been playing SA-MP:

set /p step4=

if "%step4%" ==goto stepp5
goto :stepp5

:stepp5
echo Do you have any experience with administration? If so, list here:

set /p step5=

if "%step5%" ==goto stepp6
goto :stepp6

:stepp6
echo Do you have skills that might be usefull for us? If so, list here:

set /p step6=

if "%step6%" ==goto stepp7
goto :stepp7

:stepp7
echo Give the link to the newest build changelog thread (well,i dont know but i think this may change,so always check on-forum apply code to be sure) :

set /p step7=

if "%step7%" ==goto stepp8
goto :stepp8

:stepp8
echo Describe yourself[/b] [i](Minimum of 150 words):

set /p step8=

if "%step8%" ==goto stepp9
goto :stepp9

:stepp9
echo List 2 of your down sides (First one):

set /p step91=

if "%step91%" ==goto stepp10
goto :stepp10

:stepp10
echo List 2 of your down sides (Second one):

set /p step90=

if "%step90%" ==goto stepp11
goto :stepp11

:stepp11
echo List 2 of your positive sides (FIRST ONE):

set /p step111=

if "%step111%" ==goto stepp12
goto :stepp12

:stepp12
echo List 2 of your positive sides (SECOND ONE):

set /p step112=

if "%step112%" ==goto stepp13
goto :stepp13

:stepp13
echo Timezone (GMT) :

set /p step13=

if "%step13%" ==goto SAVEFILE

:SAVEFILE
cls
echo [b]What can you offer Stunts Unlimited (be unique)[/b]: %step1% > apply.txt
echo [b]Why do you want to become an admin [i](besides kicking/banning cheaters)[/i][/b]: %step2% > apply.txt
echo [b]How long have you been with us[/b]: %step3% > apply.txt
echo [b]For how long have you been playing SA-MP[/b]: %step4% > apply.txt
echo [b]Do you have any experience with administration? If so, list here[/b]: %step5% > apply.txt
echo [b]Do you have skills that might be usefull for us? If so, list here[/b]: %step6% > apply.txt
echo [b]Give the link to the newest build changelog thread.[/b]: %step7% > apply.txt
echo [b]Describe yourself[/b] [i](Minimum of 150 words)[/i]: %step8% > apply.txt
echo [b]List 2 of your down sides[/b]: %step91% > apply.txt
echo [b]List 2 of your down sides[/b]: %step90% > apply.txt
echo [b]List 2 of your positive sides[/b]: %step111% > apply.txt
echo [b]List 2 of your positive sides[/b] : %step112% > apply.txt
echo [b]Timezone (GMT)[/b]: %step13% > apply.txt

silent
Posts: 44
Joined: 28 Oct 2011 14:40

Re: PROBLEM

#2 Post by silent » 02 Jan 2012 13:31

Fixed myself,close.

phillid
Posts: 109
Joined: 03 Apr 2010 20:27
Location: Wellington, New Zealand
Contact:

Re: PROBLEM

#3 Post by phillid » 03 Jan 2012 04:59

A helpful hint: when the user is asked to enter text, they may use mixed case (a mix of capital and lower case letters). With every IF statement you have where the user will have entered text into a variable being compared, use the /I switch, so no matter whether the user has capital or lower case letters in their input, it won't matter :)

Squashman
Expert
Posts: 4479
Joined: 23 Dec 2011 13:59

Re: PROBLEM

#4 Post by Squashman » 03 Jan 2012 07:22

And as I learned just not too long ago from Dave, the SET /P option limits the user input to 1024 characters. With a minimum of 150 words you could easily hit that limit.

You might be better off with a VBscript option.

silent
Posts: 44
Joined: 28 Oct 2011 14:40

Re: PROBLEM

#5 Post by silent » 03 Jan 2012 09:47

Well im not some PC geek,and i cant undestand most of things you say,but i fixed it this way

Code: Select all

echo [b]Timezone (GMT)[/b]: %step13% > apply.txt

i made >>apply.txt in all of those things and it worked,so it was

Code: Select all

echo [b]Timezone (GMT)[/b]: %step13% >>apply.txt

Post Reply