User Tools

Site Tools


grs_instructions

This is an old revision of the document!


GRS Codes

GRS is a program for creating a game report for a Pursue the Pennant
game.  It was written by Greg Speegle and Sean Sweda.

RUNNING THE PROGRAM

Usage: grs [-ahfv] [afile] [hfile] [infile] outfile

-a Used to read in the away team's lineup from an external file.
ex: grs -a yesterdays_game.cmd todays_game

-h Used to read in the home team's lineup from an external file.
ex: grs -h my_lineup_vsRH game6

-f Used to read in commands from an external file.  NOTE:  This
includes the lineups, thus -f is incompatible with -a and/or -h.
ex: grs -f unfinished_game 1-1

-v Using this flag will cause grs to output the version number.
(v2.3.0 and later)

If you use the -f flag to read in a file, make sure that the last
event is NOT 'eg' or 'en'.

The last operand is always the output file prefix.  GRS will create
the following files:

<outfile>.sts - the stats
<outfile>.pbp - the play-by-play
<outfile>.cmd - the commands you typed in
<outfile>.un#  - a file grs uses temporarily to process the undo command
there may be several of these files after you are done

The accompanying shell script, grscat (instructions at the end) will
concatenate these files into one large file, if you so desire.

WHAT IT DOESN'T DO

(hopefully this will remain blank)

ENTERING THE LINEUPS

GRS uses space dilimited text.  Thus, when prompted for player name,
real team, and position, you should separate these by spaces.
Example:  Whitaker DET 2b

When GRS is started, you will be prompted for a three letter team
abbreviation for each team.  Please capitalize this abbreviation.

This program was created with the designated hitter in mind.  If the
pitcher bats in your league, you must enter him in the original lineup
twice, once as a batter and once as a pitcher.

As noted above, lineups may be read in from an external file.  If you
want to do this, make sure the lienups are in the same format as they
appear in the .cmd file.


COMMAND SYNTAX

GRS accepts commands in the following syntax: (space delimited)

event location baserunning

event   - a 2 letter event code, all of which are listed below
location - many uses, eg. location of a hit (gcf), or fielding
    on the play (6-3);  also can be used to indicate a
    special kind of play like a H&R or IFR, eg. 6-3(IFR)
    or IFR(6) or lcf(H&R), etc.
baserunning - in groups of 2, indicating where the player started,
    and where he ended up, eg. 12 means runner on 1st
    went to second.  Use the letter 'b' for the batter,
    'o' for out, and 'h' for home.  There are default
    advances programmed in, so you can skip the
    baserunning field if nobody advanced an extra base.

The location is optional for all events.  Some events require baserunning
information.  When entering errors, only list the player who made the
error in the location field. (e.g. er 3 b1 instead of er 6-3 b1 for a
dropped throw by the firstbaseman)

ALL GRS commands are entered in LOWER CASE.

For ALL baserunning events, make sure you list the lead runner first:
  ex.  sb 2312 (runner on 2nd steals 3rd and 1st steal 2nd)

This is a list of the events that the grs program accepts:

ph - pinch hit

Use the same form as lineup entry.  List the position the
pinch-hitter will play next inning, or just "ph" if he
is only pinch-hitting.

Example:
ph
Ward ATL PH(enter a space here after team)

(This would Pinch Hit ATL Ward and list him as a PH in the GRS.
You would have to either insert a defensively replacement [dc]
or change his position [dc])

or

ph
Ward ATL 1b

(This would Pinch Hit ATL Ward and list him as 1b)

pr - pinch run

        Use the same form as lineup entry.  List the position the
        pinch-runner will play next inning, or just "pr" if he
        is only pinch-running.

Example:
pr  <return>
Figgins LAA PR
   <return>  (enter a space here after team)

(This would Pinch Run LAA Figgins and list him as a Pr in the GRS.
You would have to either insert a defensively replacement [dc]
or change his position [dc])

or

pr   <return>
Figgins LAA CF
  <return>

(This would Pinch Hit LAA Figgins and list him as CF)

np - new pitcher

Use the same form as lineup entry.  Also, if you are playing
with the pitcher batting, you can specify the position in the
batting order where the pitcher will hit, and grs will
automatically insert him into the batting order.
ex: Rivera NYA R 9  (this would put Rivera in the 9 hole)

     Example:
       np  <return>
       Rivera NYA R  <return>

      (This would insert NYA Rivera as the pitcher.)

       or

      np   <return>
      Rivera NYA R 7 <return>

(This would insert NYA Rivera as the pitcher, batting 7th.)

dr - defensive replacement

     Use this entry to make a defensive SUBSTITUTION.
     Example:
       dr  <return>
       7   <return>            - batting order
       Chavez NYN CF  <return>

      (This would substitute NYN Chavez for the current #7 hitter and
       play him in CF.)


dc - defensive position change

Use the same form as lineup entry.  The only difference
between these two commands is that "dc" moves a player from
one position to another and "dr" replaces a player.

     Use this entry to make a defensive SUBSTITUTION.
     Example:
       dc  <return>
       7   <return>            - batting order
       Chavez NYN CF  <return>

      (This would move NYN Chavez to CF.)

la - list the away team's lineup
lh - list the home team's lineup

un - undo

Undo will allow you to undo any event, including a lineup
change or the end of an inning.  You can even undo several
events at once.  Make sure that there is never an undo
command in a command file that you are reading in via the
-f flag, as the undo command is never recorded in the .cmd
file normally, and this will only serve to confuse grs.

      MINIMIZE USING THIS COMMAND.

en - end of inning
eg - end of game

cm - comment
nj - enters in a "<runner> unable to get jump" comment, specify base of runner
fa - enters in a "<pitcher> fatigues" comment

so - strikeout
kd - strikeout, dropped third strike
kc - strikeout, caught stealing
ks - strikeout, stolen base
bb - walk
iw - intentional walk
ci - catcher's interference
hb, hp - hit by pitch
wp - wild pitch
pb - passed ball
bk - balk
sb - stolen base
     make sure to indicate which runner(s) steal if there is more than
     one runner on base
     ex.
      sb 12 (runner on 1st steals 2nd)

cs - caught stealing
     ex.
      cs 1o (runner on 1st caught stealing)

pk - picked off
     ex.
      pk 1-3 1o (runner on 1st picked off - pitcher to 1st)

th - advance on a throw
     ex.
      th 23  (runner on 2nd advances to 3rd on throw)
        or
      th 3h23 (runner on 3rd scores and 2nd to 3rd on throw)

oa - out advancing on a throw
     ex.
      oa 8-2 3o  (runner on third thrown out at home by CF)

1b - single
     ex.
      1b gcf  (single - groundball to CF)

2b - double
3b - triple
hr - home run
dp,gd - ground into double play
     ex.
      dp hg6 1obo (double play Hard grounder to SS, runner on 1st out at 2nd
                   and Batter out at 1st)

fd - fly into double play (rarely used)
ld - line into double play
     ex.
      ld lo6 1obo (line drive to SS, runner on first doubled up - make sure
                   you show BOTH players who are out on the play)
lo - line out
     ex.
      lo 6 (Line drive to SS, batter out)

fc - fielder's choice, batter reaches first
     ex.
      fc rg6 1ob1 (fielder’s choice, routine Grounder to SS runner on 1st out
                   at 2nd, batter safe at 1st)

hg - hard ground out
     ex.
      hg 5 (hard grounder to 3B, batter out at 1st)

rg - routine ground out
     ex.
      rg 4 (routine grounder to 2B, batter out at 1st)

sg - slow ground out
     ex.
      sg 3 (slow grounder to 1B, batter out at 1st)

  Make sure to show any runners that advance on any out at any base.
     ex.
      sg 3 12 (runner on 1st advances to 2nd)

hf - high fly
     ex.
      hf 8 (high fly to CF)

po - pop out
     ex.
      po 6 (pop out to SS)

fp, pf - foul pop out
     ex.
      fp 2 (foul pop to C)

sf - sacrifice fly
     ex.
      sf 8 3h (sac fly to CF, runner on 3rd scores)

sh - sacrifice hit
     ex.
      sh 1-3 2312 (sac bunt, runners on 2nd and 1st advance)

lf - long fly
wt, df - warning track fly (from deep fly chart)
     Possible result of Deep Fly (DF)
     ex.
       lf 7 (long fly to LF)
       wt 7 3h23 (warning track fly, runner on 3rd scores,
                  runner on 2nd to 3rd)

er - batter reaches on error
     ex.
      er 5 (error on 3B, runners advance 1 base, batter safe at 1st)

ea - runner advances on error
     Used primarily in conjuction with a base-hit plus error result
     (1b+1) on error chart
     ex.
      1b lf
      ea 7 12   (batter singles to LF and ball is bobbled allowing
                 batter to advance to 2nd)

generic codes:

fo - fly out
go - ground out


************
UNDO WARNING
************

Undo is the most precarious part of our program, i.e. the most likely
way to crash grs.  The current status is:

Undo seems to be 100% functional.

NEVER, EVER, use the -f flag with an undo command imbedded in the
input file!  the undo event is never recorded in a .cmd file, and GRS
is not expecting it!  there will be grave (although quite comical)
consequences if you ignore this.

The moral of the story is, use undo at your own risk.  What is listed
above is the "observed" pattern of activity of undo.  It *may* crash,
possibly destroying your game report.  If you don't want to try undo,
just end the game, then use copy-paste to re-input your commands
(copy from the .cmd file).  Or even easier still, use the -f flag.


Below is an example input file for line ups, making setup for each game MUCH
easier:

command line entry for entry file a.txt for gm1 wk 8:

grs -f a.txt 8-1

The file will look like this (parthetical entries are comments only, don't enter

into the actual file):

(begin file)
LAW        (Visiting Team 3-letter abbreviation - make sure this is theFIRST line)
Soriano WAS LF      (Visiting Team Lineup)
Ross FLA CF
Gibbons BAL DH
Jenkins MIL RF
Blalock TEX 3b
Casey DET 1b
Navarro TB C
Frandsen SF 2b
Berroa KC SS
COU       (Home Team 3-letter abbreviation)
Kinsler TEX 2b       (Home Lineup) 
Byrnes ARI LF
Giles SD RF
Barrett CHN C
Fielder MIL 1b
Thorman ATL DH
Patterson BAL CF
Cedeno CHN SS
Inge DET 3b
Kim COL R      (Visiting Pitcher, Right-handed)
Francis COL L  (Home Pitcher, Left-handed)
Cool, Clear, No Wind, Wo Precip   (Weather - make sure to follow this line with
a <return>)

(end file)

Here is the Mini-GRS file and GRS file header:

(begin file)

SCORES

LAW   2  1  1
COU  10  4  4

INJURIES    [make sure to use this format for injuries)
1 x LAW KC Dejesus 2 (2 served, baby after game)
3 x COU CHN Cedeno 2 (twing after game)

STARTS
1 LF COU ATL Thorman
1 SS COU CHN Cedeno 

LIMITS       (you can leave this section blank)
1 1b COU ATL Thorman 1 PA vsLH

LAW PITCHING
gm1: PIT Duke 2.1 (L), COL Affeldt 2.2, DET Grilli 1.2, BAL Britton 1.1
gm2: CHA Garland 8.0 (L)
gm3: COL Kim 7.0 (L), COL Affeldt 1.0

COU PITCHING
gm1: CHN Zambrano 6.0 (W), PHI Hamels 2.0, TEX Benoit 1.0
gm2: COL Francis 6.2, ARI Cruz 0.1, PIT Gonzalez 1.0, MIL Cordero 1.0 (S)
gm3: OAK Haren 8.0, MIL Cordero 1.0 (S)

ROTATION  (make sure you include the HOME series rotation!!!!!)
HOU Oswalt, PHI Hamels, COL Francis

TRANSACTIONS
Activate: HOU Oswalt
Deactivate: CHA Sweeney
grs_instructions.1228402035.txt.gz · Last modified: 2008/12/04 09:47 by christian_spo