How to log

Place for people to discuss public servers, and also for admins to lay out the details of their servers
Post Reply
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

How to log

Post by ajh60 »

ok so i was messing around trying to get a batch file to log my bzflag servers (private school tornument)because we are going to change the whole system around and i wanted to be able to click 1 icon and have it start a server and begin logging it anyways lets start:


First start up notepad (no not word not wordpad, notepad) now copy and paste the following

Code: Select all

@echo Now loading bzflag...
start "bzflag.bat" "bzflag.bat"
start "bzflag logging.bat" "bzflag logging.bat"
now you have to save it as a bat file call it start.bat and click the drop down list that says Text Documents (*.txt) and change it to All Files

now press the save button and make a new text document and copy and paste this

Code: Select all

@echo off

set BZADMINPROGRAM="C:\Program Files\BZFlag2.0.5b4\bzadmin.exe" 
set USERNAME="Logger"
set SERVER="localhost"
set LOGFILE="C:\path\to\the\logs\(filename).txt"

REM ***** Don't change anything below this line! ***** 

@echo on 

@%BZADMINPROGRAM% "%USERNAME%@%SERVER%" > %LOGFILE%
and save it as bzflag logging.bat using the same methode as above
we now have our script to log the out put of bzadmin player kills chat etc

now make a new document and copy /paste the following

Code: Select all

@echo off
set BZFSPROGRAM="C:\Program Files\BZFlag2.0.5b4\bzfs.exe"
set LOGFILE="C:\path\to\your\logs\(filename).txt"
set CONFIGFILE="C:\path\to\your.conf"

REM ***** Don't change anything below this line! *****

@echo on

%BZFSPROGRAM% -conf %CONFIGFILE% > %LOGFILE%
and save it as bzflag.bat that will log the output of bzfs (i reccomend using -dddd and -printscore in your config file for this to take affect)

now make shure all the files are in the same location and double click on start.bat and woulla a server just started and so did bzadmin

PS:
in the bzadmin window it will only display
Connecting to Logger@localhost:5154
this is perfectly normal and the reason is that it is printing all the info to the log file.
1veedo
Private First Class
Private First Class
Posts: 184
Joined: Sat Feb 05, 2005 1:26 am
Location: usa

Post by 1veedo »

Wouldn't it be easier to run

bzfs ... &> logfile?
1veedo (libcurl.so.2) I have version 3!
User avatar
A Meteorite
Private First Class
Private First Class
Posts: 1786
Joined: Thu Apr 28, 2005 12:56 am
Location: California, U.S.
Contact:

Post by A Meteorite »

1veedo wrote:Wouldn't it be easier to run

bzfs ... &> logfile?
Many Windows people say that isn't working for them...
Image
Owner @ BZFX
Core Admin @ CAN

Email me: bzmet…@gmail.com
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

no its just that doesent output player kills chat etc
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

ok now i have made a bzflag command center what it does basicly is call bz admin and tell it to enter a command it is in the verry early stages version 0.1 still pretty buggy im posting this as i work on it and half the poll things dont work also if you know of a way to find out what bzadmin outputs eg when you enter the admin password using my program it doesent check the password and eaven if its not right it lets you continue also i whould like a way for the password to be stars eg instead of pass **** if you know how i whould appreciate you telling me any ways heres the contents just save it as bzflag controle center.bat

Code: Select all

@SET BZADMIN="C:\Program Files\BZFlag2.0.5b4\bzadmin.exe"
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter Server Address [localhost]: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET ADDR=%Choice%
@IF /I '%Choice%'=='' SET ADDR=localhost
@ECHO.
@echo Pinging Server
@PING %ADDR%
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Admin Password: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET ADMINPASS=%Choice%
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo  Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET OUTPUT="C:\Output.txt"
@SET Choice=
@SET /P Choice=Please Enter Your Name: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET Name=%Choice%
pause
@ECHO OFF
CLS
:LOOP
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
ECHO Welcome, %NAME% What Whould You Like To Do
ECHO A. Ban a player
ECHO B. Kick a player
ECHO C. Unban an ip address
ECHO D. Shut down server
ECHO E. Set a variable
ECHO F. Give a flag
ECHO G. End game
ECHO H. Start poll
ECHO I. Run a command
ECHO Q. Quit
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the letter and press Enter: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='A' GOTO ItemA
IF /I '%Choice%'=='B' GOTO ItemB
IF /I '%Choice%'=='C' GOTO ItemC
IF /I '%Choice%'=='D' GOTO ItemD
IF /I '%Choice%'=='E' GOTO ItemE
IF /I '%Choice%'=='F' GOTO ItemF
IF /I '%Choice%'=='G' GOTO ItemG
IF /I '%Choice%'=='H' GOTO ItemH
IF /I '%Choice%'=='I' GOTO ItemI
IF /I '%Choice%'=='Q' GOTO End
ECHO "%Choice%" is not valid. Please try again.
ECHO.
GOTO Loop
:ItemA
@SET Choice=
@SET /P Choice=Please Enter Player To Ban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BAN=%Choice%
@SET Choice=
@SET /P Choice=Please Enter Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANREASON=%Choice%
@%BZADMIN% "Banner@%ADDR%" "/password %ADMINPASS%" "/ban %BAN% %BANREASON%" "/say Player %BAN% Has Been Banned By %NAME% Reason: %REASON%" "/quit" > "C:\Output.txt"
@GOTO Again
:ItemB
@SET Choice=
@SET /P Choice=Please Select A User To Kick: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KILL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET REASON=%Choice%
@%BZADMIN% "Kicker@%ADDR%" "/password %ADMINPASS%" "/kick %KILL% %REASON%" "/say Player %KILL% Has Been Kicked By %NAME% Reason: %REASON%" "/quit" > "C:\Output.txt"
@GOTO Again
:ItemC
@echo Banned IP's:
TYPE "C:\BZFlag_Logs\banlist.txt"
ECHO.
@SET Choice=
@SET /P Choice=IP to unban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET UNBAN=%Choice%
@%BZADMIN% "Unbanner@%ADDR%" "/password %ADMINPASS%" "/unban %UNBAN%" "/say Player %UNBAN% Has Been Removed From The Banlist By %NAME%" > "C:\Output.txt"
@GOTO Again
:ItemD
@SET Choice=
@SET /P Choice=Do you really want to shut down the Server? This will disconnect all active players (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO Y
IF /I '%y/n%'=='n' GOTO N
:Y
@%BZADMIN% "Shutdown@%ADDR%" "/password %ADMINPASS%" "/say The Server Has Been Shut Down By %NAME%" "/shutdownserver" "/quit" > "C:\Output.txt" "exit"
@GOTO Again
:N
@echo Shut Down Aborted
GOTO Again
:ItemE
@SET Choice=
@SET /P Choice=Please Enter The Variable To Change eg. rainType: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VARIABLE=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Value To Change It To eg. snow: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VALUE=%Choice%
@%BZADMIN% "Variable@%ADDR%" "/password %ADMINPASS%" "/say The %VARIABLE% Has Been Changed To %VALUE% By %NAME%" "/set _%VARIABLE% %VALUE%" "/quit" > "C:\Output.txt"
GOTO Again
:ItemF
@SET Choice=
@SET /P Choice=Please Enter The Player To Give The Flag To: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET PLAYER=%Choice%
@SET Choice=
@SET /P Choice=Display A List Of Flags And There ID's? (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO ID
IF /I '%y/n%'=='n' GOTO ENTER
:ID
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo  Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@TYPE "C:\flags.txt"
:ENTER
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Flag To Give: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET Flag=%Choice%
@%BZADMIN% "Flag@%ADDR%" "/password %ADMINPASS%" "/flag give %PLAYER% %FLAG%" "/say Player %PLAYER% Has Been Given %FLAG% By %NAME%" "/quit" > "C:\Output.txt"
:ItemG
@SET Choice=
@SET /P Choice=Do You Really Want To End The Game This Will End The Game And Announce The Person In The Lead The Winner (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO ENDGAME
IF /I '%y/n%'=='n' GOTO CANCLEENDGAME
:ENDGAME
@%BZADMIN% "End@%ADDR%" "/password %ADMINPASS%" "/endgame" "/say Game Ended By %NAME%" "/quit" > "C:\Output.txt"
GOTO Again
:CANCLEENDGAME
Game End Cancelled
GOTO Again
:ItemH
ECHO A. Start A Poll To Set A Variable 
ECHO B. Start A Poll To Kick A Player
ECHO C. Start A Poll To Ban A Player
ECHO D. Start A Poll To Give A Player A Flag
ECHO E. Go Back
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the letter and press Enter: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='A' GOTO PollA
IF /I '%Choice%'=='B' GOTO PollB
IF /I '%Choice%'=='C' GOTO PollC
IF /I '%Choice%'=='D' GOTO PollD
IF /I '%Choice%'=='E' GOTO PollE
IF /I '%Choice%'=='Q' GOTO Again
ECHO "%Choice%" is not valid. Please try again.
:PollA
@SET Choice=
@SET /P Choice=Please Enter The Variable: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VARPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Value: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VALPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll set _%VARPOLL% %VALPOLL%" "/say %NAME% Has Started A Poll To Set %VARPOLL% to %VALPOLL%" "/quit"  > "C:\Output.txt"
GOTO Again
:PollB
@SET Choice=
@SET /P Choice=Please Enter The Player To Kick: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KICKPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KICKREASONPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll kick %KICKPOLL% %KICKREASONPOLL%" "/say %NAME% Has Started A Poll To Kick %KICKPOLL% Reason %REASONKICKPOLL% To Vote Press N And Type /poll yes For Yes Or /poll no For No." "/quit" > "C:\Output.txt"
GOTO Again
:PollC
@SET Choice=
@SET /P Choice=Please Enter The Player To Ban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANREASONPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Duration: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANDURATIONPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll ban %BANPOLL% %BANREASONPOLL% %BANDURATIONPOLL%" "/say %NAME% Has Started A Poll To Ban %BANPOLL% For %BANDURATIONPOLL% Reason %REASONBANPOLL% To Vote Press N And Type /poll yes For Yes Or /poll no For No." "/quit" > "C:\Output.txt"
GOTO Again
:PollD
GOTO Again
:PollE
GOTO Again
:ItemI
@SET Choice=
@SET /P Choice=Please Enter The Command To Issue: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET COMMAND=%Choice%
@%BZADMIN% "Command@%ADDR%" "/password %ADMINPASS%" "/%COMMAND%" "/say %NAME% Has Issued The Following Command /%COMMAND%" "/quit" > "C:\Output.txt"
:Again
PAUSE
CLS
GOTO Loop
:End
oh and btw it requires that you have a text document called flags.txt in the c drive and another called output it also assumes that you are running bzflag 2.0.5b4
PS dont be a desprate code deprived little kid and steal my work you are allowed to use it as long as you leave the all coding by alex hutton in there im fine with it.
PSS
here is the contents of the flag.txt file

Code: Select all

FLAG LIST

GOOD FLAGS

High Speed (V) 
Boosts top speed by 50%. 

Quick Turn (A) 
Boosts turn rate by 50%.

Oscillation Overthruster (OO) 
Let's the tank go through buildings. You cannot back up in or into a building, nor can you shoot while inside. 

Rapid Fire (F) 
Increases shot speed and decreases range and reload delay. 

Machine Gun (MG) 
Increases shot speed and dramatically decreases range and reload delay. 

Guided Missile (GM) 
Shots guide themselves when locked on. The missile can be retargeted at any time during its flight (with the right mouse button). This allows the player some control over the missile's steering. 

Laser (L) 
Shoots a laser, with effectively infinite speed and range. Just point and shoot. The binoculars are handy for lining up distant targets. The downside (you knew it was coming) is that the reload time is doubled. 

Ricochet (R) 
Shots reflect off walls. It is exceptionally easy to kill yourself with this flag. 

Super Bullet (SB) 
Shots can go through buildings (possibly destroying a tank with the oscillation overthruster flag) and can also destroy (phantom) zoned tanks. 

Stealth (ST) 
Tank becomes invisible on radar but is still visible out-the-window. 

Cloaking (CL) 
Tank becomes invisible out-the-window but is still visible on radar. 

Invisible Bullet (IB) 
Shots are invisible on radar (except your own). They are visible out-the-window. Sort of stealth for shots. 

Tiny (T) 
Tank becomes much smaller and harder to hit. 

Narrow (N) 
Tank becomes paper thin. It's very hard (but not impossible) to hit a narrow tank from the front or back. However, the tank is as long as usual so hitting it from the side has normal difficulty. 

Shield (SH) 
Getting shot while in possession of this flag simply drops the flag (instead of destroying the tank). Since the flag may not disappear you may want to wait around for it to fall to the ground so you can grab it again, but, be warned, the shield flag flies for an extra long time (longer than the normal reload time). 

Steamroller (SR) 
Tank can destroy other tanks by driving over them (but you must get quite close). 

Shock Wave (SW) 
Tank doesn't fire shells. Instead it sends out a shock wave in all directions. Any tank caught in the wave is destroyed (including tanks on or in buildings). 

Phantom Zone (PZ) 
Driving through a teleporter phantom zones the tank. A zoned tank cannot shoot, but can drive through buildings and cannot be destroyed except by a Super Bullet or a Shock Wave (or if the team's flag is captured). 

Genocide (G) 
Destroying any tank on a team destroys every player on that team. 

Jumping (JP) 
Allows the tank to jump. You cannot steer while in the air. 

Identify (ID) 
Displays the identity of the closest flag in the vicinity. 

BAD FLAGS:

Colorblindness (CB) 
Prevents tank from seeing any team information about other tanks. You have to be careful to avoid shooting teammates. 

Obesity (O) 
The tank becomes very large and easy to hit. It's so big that it can't fit through teleporters. 

Left Turn Only (<-) 
Prevents the tank from turning right. 

Right Turn Only (->) 
Prevents the tank from turning left. 

Momentum (M) 
Gives the tank a lot of inertia. 

Blindness (B) 
Blanks the out-the-window view. The radar still works. It is effectively impossible to detect any tank with Stealth; shooting a Stealth with Blindness is the stuff legends are made of. 

Jamming (JM) 
Disables the radar but you can still see. 

Wide Angle (WA) 
Gives the tank a fish eye lens that's rather disorienting.
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

ok updated version 0.1.3

Code: Select all

@SET BZADMIN="C:\Program Files\BZFlag2.0.5b4\bzadmin.exe"
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter Server Address [localhost]: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET ADDR=%Choice%
@IF /I '%Choice%'=='' SET ADDR=localhost
@ECHO.
@echo Pinging Server
@PING %ADDR%
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Admin Password: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET ADMINPASS=%Choice%
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo  Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@SET OUTPUT="C:\BZFlag_Logs\Output.txt"
@SET Choice=
@SET /P Choice=Please Enter Your Name: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET Name=%Choice%
pause
@ECHO OFF
CLS
:LOOP
@echo  _=BZFLAG=_
@echo ---========---
@echo Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
ECHO Welcome, %NAME% What Whould You Like To Do
ECHO A. Ban a player
ECHO B. Kick a player
ECHO C. Unban an ip address
ECHO D. Shut down server
ECHO E. Set a variable
ECHO F. Give a flag
ECHO G. End game
ECHO H. Start poll
ECHO I. Run a command
ECHO J. Make a server announcement
ECHO K. Register a user
ECHO L. Unregister a user
ECHO M. Put a user in a group
ECHO N. Take a user out of a group
ECHO O. End of lunch
ECHO P. End of recess
ECHO R. End of P.T.
ECHO Anything Else EMERGANCY TEACHER SHUTDOWN
ECHO Q. Quit
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the letter and press Enter: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='A' GOTO ItemA
IF /I '%Choice%'=='B' GOTO ItemB 
IF /I '%Choice%'=='C' GOTO ItemC
IF /I '%Choice%'=='D' GOTO ItemD
IF /I '%Choice%'=='E' GOTO ItemE
IF /I '%Choice%'=='F' GOTO ItemF
IF /I '%Choice%'=='G' GOTO ItemG
IF /I '%Choice%'=='H' GOTO ItemH
IF /I '%Choice%'=='I' GOTO ItemI
IF /I '%Choice%'=='J' GOTO ItemJ
IF /I '%Choice%'=='K' GOTO ItemK
IF /I '%Choice%'=='L' GOTO ItemL
IF /I '%Choice%'=='M' GOTO ItemM
IF /I '%Choice%'=='N' GOTO ItemN
IF /I '%Choice%'=='O' GOTO ItemO
IF /I '%Choice%'=='P' GOTO ItemP
IF /I '%Choice%'=='R' GOTO ItemR
IF /I '%Choice%'=='Q' GOTO End
GOTO EMERGANCY
ECHO.
GOTO Loop
:ItemA
@SET Choice=
@SET /P Choice=Please Enter Player To Ban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BAN=%Choice%
@SET Choice=
@SET /P Choice=Please Enter Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANREASON=%Choice%
@%BZADMIN% "Banner@%ADDR%" "/password %ADMINPASS%" "/ban %BAN% %BANREASON%" "/say Player %BAN% Has Been Banned By %NAME% Reason: %REASON%" "/quit" > "C:\BZFlag_Logs\Output.txt"
@GOTO Again
:ItemB
@SET Choice=
@SET /P Choice=Please Select A User To Kick: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KILL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET REASON=%Choice%
@%BZADMIN% "Kicker@%ADDR%" "/password %ADMINPASS%" "/kick %KILL% %REASON%" "/say Player %KILL% Has Been Kicked By %NAME% Reason: %REASON%" "/quit" > "C:\BZFlag_Logs\Output.txt"
@GOTO Again
:ItemC
@echo Banned IP's:
TYPE "C:\BZFlag_Logs\banlist.txt"
ECHO.
@SET Choice=
@SET /P Choice=IP to unban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET UNBAN=%Choice%
@%BZADMIN% "Unbanner@%ADDR%" "/password %ADMINPASS%" "/unban %UNBAN%" "/say Player %UNBAN% Has Been Removed From The Banlist By %NAME%" > "C:\BZFlag_Logs\Output.txt"
@GOTO Again
:ItemD
@SET Choice=
@SET /P Choice=Do you really want to shut down the Server? This will disconnect all active players (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO Y
IF /I '%y/n%'=='n' GOTO N
:Y
@%BZADMIN% "Shutdown@%ADDR%" "/password %ADMINPASS%" "/say The Server Has Been Shut Down By %NAME%" "/shutdownserver" "/quit" > "C:\BZFlag_Logs\Output.txt" "exit"
@GOTO Again
:N
@echo Shut Down Aborted
GOTO Again
:ItemE
@SET Choice=
@SET /P Choice=Please Enter The Variable To Change eg. rainType: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VARIABLE=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Value To Change It To eg. snow: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VALUE=%Choice%
@%BZADMIN% "Variable@%ADDR%" "/password %ADMINPASS%" "/say The %VARIABLE% Has Been Changed To %VALUE% By %NAME%" "/set _%VARIABLE% %VALUE%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemF
@SET Choice=
@SET /P Choice=Please Enter The Player To Give The Flag To: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET PLAYER=%Choice%
@SET Choice=
@SET /P Choice=Display A List Of Flags And There ID's? (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO ID
IF /I '%y/n%'=='n' GOTO ENTER
:ID
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo  Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@TYPE "C:\BZFlag_Logs\flags.txt"
:ENTER
@ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Flag To Give: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET Flag=%Choice%
@%BZADMIN% "Flag@%ADDR%" "/password %ADMINPASS%" "/flag give %PLAYER% %FLAG%" "/say Player %PLAYER% Has Been Given %FLAG% By %NAME%" "/quit" > "C:\BZFlag_Logs\Output.txt"
:ItemG
@SET Choice=
@SET /P Choice=Do You Really Want To End The Game This Will End The Game And Announce The Person In The Lead The Winner (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO ENDGAME
IF /I '%y/n%'=='n' GOTO CANCLEENDGAME
:ENDGAME
@%BZADMIN% "End@%ADDR%" "/password %ADMINPASS%" "/endgame" "/say Game Ended By %NAME%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:CANCLEENDGAME
Game End Cancelled
GOTO Again
:ItemH
ECHO A. Start A Poll To Set A Variable 
ECHO B. Start A Poll To Kick A Player
ECHO C. Start A Poll To Ban A Player
ECHO D. Start A Poll To Give A Player A Flag
ECHO E. Go Back
:: SET /P prompts for input and sets the variable
:: to whatever the user types
SET Choice=
SET /P Choice=Type the letter and press Enter: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
:: /I makes the IF comparison case-insensitive
IF /I '%Choice%'=='A' GOTO PollA
IF /I '%Choice%'=='B' GOTO PollB
IF /I '%Choice%'=='C' GOTO PollC
IF /I '%Choice%'=='D' GOTO PollD
IF /I '%Choice%'=='E' GOTO PollE
IF /I '%Choice%'=='Q' GOTO Again
ECHO "%Choice%" is not valid. Please try again.
:PollA
@SET Choice=
@SET /P Choice=Please Enter The Variable: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VARPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Value: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET VALPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll set _%VARPOLL% %VALPOLL%" "/say %NAME% Has Started A Poll To Set %VARPOLL% to %VALPOLL%" "/say %NAME% Has Started A Poll To Kick %KICKPOLL% For %REASONKICKPOLL%" "/say To Vote Press N And Type /poll vote yes For Yes Or /poll vote no For No." "/quit"  > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:PollB
@SET Choice=
@SET /P Choice=Please Enter The Player To Kick: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KICKPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET KICKREASONPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll kick %KICKPOLL%" "/say %NAME% Has Started A Poll To Kick %KICKPOLL% For %REASONKICKPOLL%" "To Vote Press N And Type /poll vote yes For Yes Or /poll vote no For No." "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:PollC
@SET Choice=
@SET /P Choice=Please Enter The Player To Ban: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANPOLL=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Reason: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET BANREASONPOLL=%Choice%
@%BZADMIN% "Poll@%ADDR%" "/password %ADMINPASS%" "/poll ban %BANPOLL%" "/say %NAME% Has Started A Poll To Ban %BANPOLL% For %REASONBANPOLL%" "/say To Vote Press N And Type /poll vote yes For Yes Or /poll vote no For No." "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:PollD
@SET /P Choice=Please Enter The Player To Give The Flag To: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET PLAYER=%Choice%
@SET Choice=
@SET /P Choice=Display A List Of Flags And There ID's? (y/n) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET y/n=%Choice%
IF /I '%y/n%'=='y' GOTO POLL YES
IF /I '%y/n%'=='n' GOTO POLL NO
:POLL YES
@CLS
@echo  _=BZFLAG=_
@echo ---========---
@echo  Control Center
@ECHO.
@echo All coding by Alex Hutton
@ECHO.
@TYPE "C:\BZFlag_Logs\flags.txt"
@ECHO.
:POLL NO
@SET Choice=
@SET /P Choice=Please Enter The Flag To Give: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET Flag=%Choice%
@%BZADMIN% "Flag@%ADDR%" "/password %ADMINPASS%" "/poll flag give %PLAYER% %FLAG%" "/say %NAME% Has Started A Poll Give %PLAYER% %FLAG%" "/say To Vote Press N And Type /poll vote yes For Yes Or /poll vote no For No." "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:PollE
GOTO Again
:ItemI
@SET Choice=
@SET /P Choice=Please Enter The Command To Issue: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET COMMAND=%Choice%
@%BZADMIN% "Command@%ADDR%" "/password %ADMINPASS%" "/%COMMAND%" "/say %NAME% Has Issued The Following Command /%COMMAND%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemJ
@SET Choice=
@SET /P Choice=Please Enter The Announcment To Make: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET SAY=%Choice%
@SET Choice=
@SET /P Choice=Use The Username %NAME% Or Announcment(1=%NAME% 2=Announcment) 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET USERNAME=%Choice%
IF /I '%USERNAME%'=='1' GOTO 1
IF /I '%USERNAME%'=='2' GOTO 2
:1
@%BZADMIN% "%NAME%@%ADDR%" "/password %ADMINPASS%" "/%COMMAND%" "/say %SAY%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:2
@%BZADMIN% "Announcment@%ADDR%" "/password %ADMINPASS%" "/%COMMAND%" "/say %SAY%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemK
@SET Choice=
@SET /P Choice=Please Enter The Name To Register: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET REGISTERNAME=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Password To Register: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET REGISTERPASS=%Choice%
@%BZADMIN% "%REGISTERNAME%@%ADDR%" "/password %ADMINPASS%" "/register %REGISTERPASS%" "/say We have a new member so give a warm welcome to " "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemL
@SET Choice=
@SET /P Choice=Please Enter The Name To Unregister: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET UNREGISTERNAME=%Choice%
@%BZADMIN% "Unregister@%ADDR%" "/password %ADMINPASS%" "/deregister %UNREGISTERNAME%" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemM
ECHO. Avalibale groups:
ECHO.
@TYPE "C:\BZFlag_Logs\groups.txt"
ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Group To Add To: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET GROUP=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Username To Add: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET GROUPUSER=%Choice%
@%BZADMIN% "Group@%ADDR%" "/password %ADMINPASS%" "/setgroup "%GROUPUSER%" %GROUP%" "/say %GROUPUSER% has been added to the group "%GROUP%" by %NAME%"/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemN
ECHO. Avalibale groups:
ECHO.
@TYPE "C:\BZFlag_Logs\groups.txt"
ECHO.
@SET Choice=
@SET /P Choice=Please Enter The Group To Take Away To: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET GROUPREMOVE=%Choice%
@SET Choice=
@SET /P Choice=Please Enter The Username To Take Away: 
:: The syntax in the next line extracts the substring
:: starting at 0 (the beginning) and 1 character long
@SET GROUPUSERREMOVE=%Choice%
@%BZADMIN% "Group@%ADDR%" "/password %ADMINPASS%" "/removegroup "%GROUPUSERREMOVE%" %GROUPREMOVE%" "/say %GROUPUSERREMOVE% has been removed from the group "%GROUPREMOVE%" by %NAME%"/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO Again
:ItemO
@%BZADMIN% "Lunch@%ADDR%" "/password %ADMINPASS%" "/say end of lunch server shut down" "/shutdownserver" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO End
:ItemP
@%BZADMIN% "Recess@%ADDR%" "/password %ADMINPASS%" "/say end of recess server shut down" "/shutdownserver" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO End
:ItemR
@%BZADMIN% "PT@%ADDR%" "/password %ADMINPASS%" "/say end of P.T. server shut down" "/shutdownserver" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO End
:EMERGANCY
@%BZADMIN% "EMERGANCY@%ADDR%" "/password %ADMINPASS%" "/say WARNING WARNING TEACHER TEACHER SERVER ABORT" "/shutdownserver" "/quit" > "C:\BZFlag_Logs\Output.txt"
GOTO End
:Again
PAUSE
CLS 
GOTO Loop
:End
all the end of lunch and recess stuff is coz we have tournaments during lunch and recess at skool the pt means personal time the emergancy teacher shut off is coz sometimes we play wen were not allowed 2
also this version needs C:\BZFlag_Logs
JPT
Private First Class
Private First Class
Posts: 260
Joined: Tue Nov 29, 2005 1:21 pm
Location: Germany

Post by JPT »

Really good batch file !
It is really great.

Could you try to start a seperate Window with the current action, that is going on ? I mean a seperate Instance of BZADMIN.


P.S.: But if you're in school, i would take the log files to an usb stick or sth. like that...
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

in skool we have made our own computer we use it to run a bzflag server and it serves everyone 'coz they have no idea on how to make a server and most of them dont eaven know what LAN means i originally made it so it started a new window but it just flashes up for about .1 of a second and closes so no real point and also does any 1 know how to connect to a bzflag game directly from a bat file like completly bypass bzadmin?
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

theres a problem with you second version here is what i see:

Code: Select all

 _=BZFLAG=_
---========---
Control Center

All coding by Alex Hutton

Welcome, The Knights Servant What Whould You Like To Do
A. Ban a player
B. Kick a player
C. Unban an ip address
D. Shut down server
E. Set a variable
F. Give a flag
G. End game
H. Start poll
I. Run a command
J. Make a server announcement
K. Register a user
L. Unregister a user
M. Put a user in a group
N. Take a user out of a group
O. End of lunch
P. End of recess
R. End of P.T.
Anything Else EMERGANCY TEACHER SHUTDOWN
Q. Quit
Type the letter and press Enter:m

 Avalibale groups:

The system cannot find the file specified.

Please Enter The Group To Add To:KNIGHTS.ADMIN
Please Enter The Username To Add:The Knights Servant
Connecting to Group@localhost:5154
*** 'Group' joined the game as Observer.
    [SERVER->] BZFlag server 2.0.5.20051210-DEVEL-W32VC71, http://BZFlag.org/
    [SERVER->] ~~~~~~~~~~~~~~~~~~~~~~~Welcome To The UnNamed Map~~~~~~~~~~~~~~~~
~~~~~~~
    [SERVER->]
    [SERVER->]         ~~~~~~~~~~~~~LOOKING FOR A NAME FOR THIS MAP~~~~~~~~~~~~~

    [SERVER->] <----------------------------------------------------------------
------------>
    [SERVER->]               ***NO Cheating No Cursing NO Team Killing***
    [SERVER->]
    [SERVER->]                   All Chat is Logged Even Private Ones
    [SERVER->]
    [SERVER->]                 >>>>Please Use /report For Anything<<<<
    [SERVER->]
    [SERVER->]                   ---------Map Version 1.0.0---------
    [SERVER->]
    [SERVER->] <----------------------------------------------------------------
------------>
    [SERVER->]    No More Than 2 Bots Are To Be Joined Or You Will Be Banned For
 The Day.
    [SERVER->] <----------------------------------------------------------------
------------>
    [SERVER->] Help Is Not Yet Avaliable
    [SERVER->] You are in observer mode.
    [SERVER->] You are now an administrator!
    [SERVER->] Incorrect parameters, usage: /setgroup <player> <group>
    Group: Knights
    Group: Servant KNIGHTS.ADMIN
    SERVER: The Knights Servant has been added to the group KNIGHTS.ADMIN by The
 Knights Servant/quit > C:\BZFlag_Logs\Output.txt (Group)
am i in bzflg
    Group: Am i know in bzadmin
Image
Sig Made By AlliedArmour

TGPH
User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

also i was trying the give flag thing and it des it but it then asks me if i want to end the game which is the next item on the list so its try9ng to do both
So it looks like we need another version if you carrying it on... hope you are :)
aslo in the options things y/n if you put any thing else then it assumes you mean yes should it not assume you meen no?

ow and also also when if first starts up it pings the server well if it cant ping thre server should it not let you connect untill it can?
Image
Sig Made By AlliedArmour

TGPH
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

hmm good idea about the server ping heres the fixed version not shure how to go about that if any1 knows then i whould appreciate it. to save 56kers i will start to attach the batchfile for you
heres 0.1.4
updates:
fixed y/n bug
fixed group bug (i think)
Changed name to BZCC (BZ Control center)

The Knights Who Say Ni!:
fixed the group bug, the first error (The system cannot find the file specified.) is coz it looks for C:\BZFlag_Logs\groups.txt and displays it if you want to change it just edit the batch file and do a find and replace.
Attachments

[The extension bat has been deactivated and can no longer be displayed.]

User avatar
The Knights Who Say Ni
Private First Class
Private First Class
Posts: 556
Joined: Mon Sep 26, 2005 7:21 pm
Location: Uplyme, England
Contact:

Post by The Knights Who Say Ni »

thats cool thanks...
Image
Sig Made By AlliedArmour

TGPH
User avatar
ajh60
Private First Class
Private First Class
Posts: 46
Joined: Sun Dec 11, 2005 6:57 am

Post by ajh60 »

guys i got a website and forum up all further disscussion will be in the new forum and all the new versions will be at the downloads page

http://bzcc.cjb.net/

remember to register in the forum

ps:
if ne1 is good at graphic desighn i whould be verrrry thankfull and whould but credits on the site if you made me a better logo that is 352 wide and 102 height thx.
Post Reply