User Tools

Site Tools


grs_instructions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
grs_instructions [2007/04/24 01:17] – external edit 127.0.0.1grs_instructions [2016/02/02 23:02] (current) sweda
Line 1: Line 1:
 <code> <code>
-GRS Codes+GRS is a program for creating a game report for the Internet Baseball 
 +League.  GRS was written by Sean Sweda (sweda@ibl.org), with assistance 
 +from Greg Speegle, Richard Dunlap, and Christian Beliveau.  The source 
 +code is available at github <https://github.com/seansweda/grs> or via 
 +anonymous ftp <ftp://ftp.ibl.org/ibl/grs/> 
 + 
 +** please submit bug reports to sweda@ibl.org ** 
 + 
 + 
 +COMPILING THE PROGRAM 
 + 
 +1) unpack the source ( tar -xzf grs.tgz ) 
 + 
 +2) edit Makefile to your taste 
 + 
 +3) "make"
  
-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 RUNNING THE PROGRAM
  
-Usage: grs [-ahfv] [afile] [hfile] [infile] outfile+Usage: grs [ (-afile) (-h hfile) | (-f cmdfile) ] outfile 
 + 
 +-a Used to read in the away team's lineup from an external file. 
 + ex: grs -a yesterdays_game.cmd todays_game
  
--Used to read in the away team's lineup from an external file. +-h Used to read in the home team's lineup from an external file. 
-ex: grs -a yesterdays_game.cmd todays_game+ ex: grs -h my_lineup_vsRH game6
  
--Used to read in the home team's lineup from an external file. +-f Used to read in commands from an external file.  NOTE: This 
-ex: grs -h my_lineup_vsRH game6+ includes the lineups, thus -f is incompatible with -a and/or -h
 + ex: grs -f unfinished_game 1-1
  
--f Used to read in commands from an external file.  NOTE:  This +-v Using this flag will cause grs to output the version number
-includes the lineups, thus -f is incompatible with -a and/or -h+ (v2.3.0 and later)
-ex: grs -f unfinished_game 1-1+
  
--v Using this flag will cause grs to output the version number+-o Used to overwrite existing output files
-(v2.3.0 and later)+ (v3.and later)
  
 If you use the -f flag to read in a file, make sure that the last If you use the -f flag to read in a file, make sure that the last
-event is NOT 'eg' or 'en'.+event is NOT 'eg'.
  
 The last operand is always the output file prefix.  GRS will create The last operand is always the output file prefix.  GRS will create
 the following files: the following files:
  
-<outfile>.sts - the stats +<outfile>.sts - the stats 
-<outfile>.pbp - the play-by-play +<outfile>.pbp - the play-by-play 
-<outfile>.cmd - the commands you typed in +<outfile>.cmd - the commands you typed in 
-<outfile>.un#  - a file grs uses temporarily to process the undo command +<outfile>.un# - a file GRS uses temporarily to process the undo command 
-there may be several of these files after you are done+   there may be several of these files after you are done
  
 The accompanying shell script, grscat (instructions at the end) will The accompanying shell script, grscat (instructions at the end) will
Line 39: Line 55:
 WHAT IT DOESN'T DO WHAT IT DOESN'T DO
  
-(hopefully this will remain blank)+GRS is not smart enough to figure out earned runs, you'll have to do that 
 +yourself when prompted.  There are some esoteric events which GRS does not 
 +handle gracefully, if you come across one please inform the author.
  
 ENTERING THE LINEUPS ENTERING THE LINEUPS
  
-GRS uses space dilimited text.  Thus, when prompted for player name,+GRS uses space dilimited text. Thus, when prompted for player name,
 real team, and position, you should separate these by spaces. real team, and position, you should separate these by spaces.
-Example:  Whitaker DET 2b+Example:  Trammell DET ss
  
 When GRS is started, you will be prompted for a three letter team When GRS is started, you will be prompted for a three letter team
-abbreviation for each team.  Please capitalize this abbreviation.+abbreviation for each team.  This code will be converted to upper case.
  
 This program was created with the designated hitter in mind.  If the This program was created with the designated hitter in mind.  If the
Line 65: Line 83:
 event location baserunning event location baserunning
  
-event   - a 2 letter event code, all of which are listed below +event - a 2 letter event code, all of which are listed below 
-location - many uses, eg. location of a hit (gcf), or fielding +location - many uses, eg. location of a hit (gcf), or fielding 
-    on the play (6-3);  also can be used to indicate a +   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) +   special kind of play like a H&R or IFR, eg. 6-3(IFR) 
-    or IFR(6) or lcf(H&R), etc. +   or IFR(6) or lcf(H&R), etc. 
-baserunning - in groups of 2, indicating where the player started, +baserunning - in groups of 2, indicating where the player started, 
-    and where he ended up, eg. 12 means runner on 1st +   and where he ended up, eg. 12 means runner on 1st 
-    went to second.  Use the letter 'b' for the batter, +   went to second.  Use the letter 'b' for the batter, 
-    'o' for out, and 'h' for home.  There are default +   'o' for out, and 'h' for home.  There are default 
-    advances programmed in, so you can skip the +   advances programmed in, so you can skip the 
-    baserunning field if nobody advanced an extra base.+   baserunning field if nobody advanced an extra base.
  
 The location is optional for all events.  Some events require baserunning The location is optional for all events.  Some events require baserunning
 information.  When entering errors, only list the player who made the 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+error in the location field. (e.g. er 3/rg6 b1 instead of er 6-3 b1 for a
 dropped throw by the firstbaseman) dropped throw by the firstbaseman)
  
-ALL GRS commands are entered in LOWER CASE. +This is a list of the events that the GRS program accepts:
- +
-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 ph - pinch hit
  
-Use the same form as lineup entry.  List the position the + Use the same form as lineup entry.  List the position the 
-pinch-hitter will play next inning, or just "ph" if he + pinch-hitter will play next inning, or just "ph" if he 
-is only pinch-hitting. + 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 pr - pinch run
  
-        Use the same form as lineup entry.  List the position the + Use the same form as lineup entry.  List the position the 
-        pinch-runner will play next inning, or just "pr" if he + pinch-runner will play next inning, or just "pr" if he 
-        is only pinch-running. + 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 np - new pitcher
  
-Use the same form as lineup entry.  Also, if you are playing + Use the same form as lineup entry.  Also, if you are playing 
-with the pitcher batting, you can specify the position in the + with the pitcher batting, you can specify the position in the 
-batting order where the pitcher will hit, and grs will + batting order where the pitcher will hit, and GRS will 
-automatically insert him into the batting order. + automatically insert him into the batting order. 
-ex: Rivera NYA R 9  (this would put Rivera in the 9 hole+ ex: Harvey FLA R 9 (this would put Harvey 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 dr - defensive replacement
- 
-     Use this entry to make a defensive SUBSTITUTION. 
-     Example: 
-       dr  <return> 
-         <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 dc - defensive position change
  
-Use the same form as lineup entry.  The only difference + Use the same form as lineup entry.  The only difference 
-between these two commands is that "dc" moves a player from + between these two commands is that "dc" moves a player from 
-one position to another and "dr" replaces a player. + one position to another and "dr" replaces a player.
- +
-     Use this entry to make a defensive SUBSTITUTION. +
-     Example: +
-       dc  <return> +
-         <return>            - batting order +
-       Chavez NYN CF  <return> +
- +
-      (This would move NYN Chavez to CF.)+
  
 la - list the away team's lineup la - list the away team's lineup
Line 185: Line 134:
 un - undo un - undo
  
-Undo will allow you to undo any event, including a lineup + Undo will allow you to undo any event, including a lineup 
-change or the end of an inning.  You can even undo several + change or the end of an inning.  You can even undo several 
-events at once.  Make sure that there is never an undo + events at once.  Make sure that there is never an undo 
-command in a command file that you are reading in via the + command in a command file that you are reading in via the 
--f flag, as the undo command is never recorded in the .cmd + -f flag, as the undo command is never recorded in the .cmd 
-file normally, and this will only serve to confuse grs. + file normally, and this will only serve to confuse GRS.
- +
-      MINIMIZE USING THIS COMMAND.+
  
 en - end of inning en - end of inning
Line 200: Line 147:
 nj - enters in a "<runner> unable to get jump" comment, specify base of runner nj - enters in a "<runner> unable to get jump" comment, specify base of runner
 fa - enters in a "<pitcher> fatigues" comment fa - enters in a "<pitcher> fatigues" comment
 +in - enters in an "infield in" comment, can supply positions
 +ic - enters in an "infield in @ 1b/3b" comment
  
 so - strikeout so - strikeout
Line 213: Line 162:
 bk - balk bk - balk
 sb - stolen base 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 cs - caught stealing
-     ex. 
-      cs 1o (runner on 1st caught stealing) 
- 
 pk - picked off pk - picked off
-     ex. 
-      pk 1-3 1o (runner on 1st picked off - pitcher to 1st) 
- 
 th - advance on a throw 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 oa - out advancing on a throw
-     ex. +ri baserunner out due to interference 
-      oa 8-2 3o  (runner on third thrown out at home by CF)+di - defensive indifference
  
 1b - single 1b - single
-     ex. 
-      1b gcf  (single - groundball to CF) 
- 
 2b - double 2b - double
 3b - triple 3b - triple
 hr - home run hr - home run
-dp,gd - ground into double play +tp - triple play 
-     ex. +dp, gd - ground into double play 
-      dp hg6 1obo (double play Hard grounder to SS, runner on 1st out at 2nd +fd - fly into double play
-                   and Batter out at 1st) +
- +
-fd - fly into double play (rarely used)+
 ld - line into double play 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 lo - line out
-     ex. 
-      lo 6 (Line drive to SS, batter out) 
- 
 fc - fielder's choice, batter reaches first 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 hg - hard ground out
-     ex. 
-      hg 5 (hard grounder to 3B, batter out at 1st) 
- 
 rg - routine ground out rg - routine ground out
-     ex. 
-      rg 4 (routine grounder to 2B, batter out at 1st) 
- 
 sg - slow ground out 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 hf - high fly
-     ex. 
-      hf 8 (high fly to CF) 
- 
 po - pop out po - pop out
-     ex. 
-      po 6 (pop out to SS) 
- 
 fp, pf - foul pop out fp, pf - foul pop out
-     ex. 
-      fp 2 (foul pop to C) 
- 
 sf - sacrifice fly sf - sacrifice fly
-     ex. 
-      sf 8 3h (sac fly to CF, runner on 3rd scores) 
- 
 sh - sacrifice hit sh - sacrifice hit
-     ex. 
-      sh 1-3 2312 (sac bunt, runners on 2nd and 1st advance) 
- 
 lf - long fly lf - long fly
 wt, df - warning track fly (from deep fly chart) 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 er - batter reaches on error
-     ex. 
-      er 5 (error on 3B, runners advance 1 base, batter safe at 1st) 
- 
 ea - runner advances on error 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: generic codes:
Line 329: Line 203:
  
 Undo is the most precarious part of our program, i.e. the most likely Undo is the most precarious part of our program, i.e. the most likely
-way to crash grs.  The current status is:+way to crash GRS.  The current status is:
  
 Undo seems to be 100% functional. Undo seems to be 100% functional.
Line 343: Line 217:
 just end the game, then use copy-paste to re-input your commands 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. (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, Right-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    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 
 </code> </code>
grs_instructions.txt · Last modified: 2016/02/02 23:02 by sweda