Help - Search - Members - Calendar
Full Version: Batch File For Setting Up Sphere
SphereServer Forums > Sphere .56/.57 > MISC Script Submissions
sub-zero
This batch code create needed files to run sphere.
Place the file sphere.bat in the sphere folder with this code:
Bit change i forgot the acc for Administrator smile.gif.

@ECHO OFF

REM BY SUB-ZERO

ECHO [-=:Inicio do programa em lotes.:=-] >> BatchLog.txt
ECHO. >> BatchLog.txt
ECHO. >> BatchLog.txt

ECHO [-=:Checando a pasta accounts e seus araquivos.:=-] >> BatchLog.txt
ECHO. >> BatchLog.txt

IF NOT EXIST accounts (
MD accounts
ECHO Criando pasta accounts [ OK ] >> BatchLog.txt
) ELSE (
ECHO A pasta accounts ja existe. >> BatchLog.txt
)

IF NOT EXIST accounts\sphereacct.scp (
ECHO [EOF] > accounts\sphereacct.scp
ECHO Criando arquivo accounts\sphereacct.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo accounts\sphereacct.scp ja existe. >> BatchLog.txt
)

IF NOT EXIST accounts\sphereaccu.scp (
ECHO [Administrator] > accounts\sphereaccu.scp
ECHO PLEVEL=Admin >> accounts\sphereaccu.scp
ECHO PRIV=04a >> accounts\sphereaccu.scp
ECHO PASSWORD=Admin >> accounts\sphereaccu.scp
ECHO Criando conta administrator, password admin. [ OK ] >> BatchLog.txt
ECHO. >> accounts\sphereaccu.scp
ECHO [EOF] > accounts\sphereaccu.scp
ECHO Criando arquivo accounts\sphereaccu.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo accounts\sphereaccu.scp ja existe. >> BatchLog.txt
)

ECHO. >> BatchLog.txt
ECHO [Fim da checagem da pasta accounts e seus araquivos.] >> BatchLog.txt
ECHO. >> BatchLog.txt

ECHO [-=:Checando a pasta logs.:=-] >> BatchLog.txt
ECHO. >> BatchLog.txt

IF NOT EXIST logs (
MD logs
ECHO Criando pasta logs [ OK ] >> BatchLog.txt
) ELSE (
ECHO O pasta logs ja existe. >> BatchLog.txt
)

ECHO. >> BatchLog.txt
ECHO [Fim da checagem da pasta logs.] >> BatchLog.txt
ECHO. >> BatchLog.txt

ECHO [-=:Checando a pasta save e seus araquivos.:=-] >> BatchLog.txt
ECHO. >> BatchLog.txt

IF NOT EXIST save (
MD save
ECHO Criando pasta save [ OK ] >> BatchLog.txt
) ELSE (
ECHO O pasta save ja existe. >> BatchLog.txt
)

IF NOT EXIST save\spherechars.scp (
ECHO [EOF] > save\spherechars.scp
ECHO Criando arquivo accounts\spherechars.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo save\spherechars.scp ja existe. >> BatchLog.txt
)

IF NOT EXIST save\spheredata.scp (
ECHO [EOF] > save\spheredata.scp
ECHO Criando arquivo accounts\spheredata.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo save\spheredata.scp ja existe. >> BatchLog.txt
)

IF NOT EXIST save\spherestatics.scp (
ECHO [EOF] > save\spherestatics.scp
ECHO Criando arquivo accounts\spherestatics.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo save\spherestatics.scp ja existe. >> BatchLog.txt
)

IF NOT EXIST save\sphereworld.scp (
ECHO [EOF] > save\sphereworld.scp
ECHO Criando arquivo accounts\sphereworld.scp [ OK ] >> BatchLog.txt
) ELSE (
ECHO O arquivo save\sphereworld.scp ja existe. >> BatchLog.txt
)

ECHO. >> BatchLog.txt
ECHO [Fim da checagem da pasta save e seus araquivos.] >> BatchLog.txt
ECHO. >> BatchLog.txt
ECHO. >> BatchLog.txt
ECHO [-=:Fim do programa em lotes.:=-] >> BatchLog.txt
ECHO. >> BatchLog.txt
ECHO. >> BatchLog.txt
sub-zero
for add accounts use this:
do not change names of batch files and place this files in the sphere.folder.

accounts.bat

@ECHO OFF

GOTO :DESCRIPTION()

:DESCRIPTION()
ECHO Use command:exit (Close this Windows)
ECHO.
ECHO Please insert the account name.
ECHO.

SET /p CMD="Login Name:"

IF /i "%CMD%" == "EXIT" GOTO :EXIT()

GOTO :PASSWORD()

REM -- RETURN() FUNCTION
:RETURN()
CLS
GOTO :DESCRIPTION()

:PASSWORD()
ECHO [%CMD%] >> accounts\sphereacct.scp
CLS
CALL plevel.bat

REM -- EXIT FUNCTION
:EXIT()

plevel.bat

@ECHO OFF

GOTO :DESCRIPTION()

:DESCRIPTION()
ECHO Please insert your plevel.
ECHO.
ECHO 01=Player 02=Counselor 04=Gm 06=Admin 07=Owner
ECHO.

SET /p CMD=Plevel:

IF /i "%CMD%" == "01" GOTO :START()
IF /i "%CMD%" == "02" GOTO :START()
IF /i "%CMD%" == "03" GOTO :START()
IF /i "%CMD%" == "04" GOTO :START()
IF /i "%CMD%" == "05" GOTO :START()
IF /i "%CMD%" == "06" GOTO :START()
IF /i "%CMD%" == "07" GOTO :START()

CLS
ECHO.
ECHO Invalid Plevel. Try Again.
ECHO.
GOTO :RETURN()

REM -- RETURN() FUNCTION
:RETURN()
GOTO :DESCRIPTION()

:START()
ECHO PLEVEL=%CMD% >> accounts\sphereacct.scp
CLS
CALL password.bat

password.bat

@ECHO OFF

GOTO :DESCRIPTION()

:DESCRIPTION()
ECHO Please insert your password.
ECHO.

SET /p CMD=Password:

GOTO :PLEVEL()

REM -- RETURN() FUNCTION
:RETURN()
GOTO :DESCRIPTION()

:PLEVEL()
ECHO PASSWORD=%CMD% >> accounts\sphereacct.scp
ECHO. >> accounts\sphereacct.scp
CALL end.bat

end.bat

@ECHO OFF

GOTO :DESCRIPTION()

:DESCRIPTION()
CLS
ECHO Account add with success.
ECHO.
ECHO All new accounts is actived in the next worldsave.
ECHO.

SET /p CMD="Do you want add another account.(Yes/No):":

IF /i "%CMD%" == "Yes" GOTO :BACK()
IF /i "%CMD%" == "Y" GOTO :BACK()
IF /i "%CMD%" == "No" GOTO :EXIT()
IF /i "%CMD%" == "N" GOTO :EXIT()

GOTO :RETURN()

REM -- RETURN() FUNCTION
:RETURN()
GOTO :DESCRIPTION()

:BACK()
CLS
CALL accounts.bat

REM -- EXIT FUNCTION
:EXIT()
mbm1
what does this do ?
do i need it ?
Skul
Helps you setup a fresh install of sphereserver.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.