-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
229 lines (166 loc) · 6.58 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
GRS is a program for creating a game report for the Internet Baseball
League. GRS was written by Sean Sweda <[email protected]>, with assistance
from Greg Speegle, Richard Dunlap, and Christian Beliveau. The source
code is available at github <https://github.com/seansweda/grs>
** please submit bug reports on github **
<https://github.com/seansweda/grs/issues>
RUNNING THE PROGRAM
Usage: grs [ (-a 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
-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)
-o Used to overwrite existing output files.
(v3.1 and later)
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 copy of .cmd created prior to executing undo
The supplied shell script "grscat" (instructions at the end) can
be used concatenate these files into one large file for GRS submission.
WHAT IT DOESN'T DO
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 find one please submit a bug report.
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: Trammell DET ss
When GRS is started, you will be prompted for a three letter team
abbreviation for each team. This code will be converted to upper case.
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: e.g. location of a hit (gcf), or fielding
on the play (6-3); can also 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 first
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 make sure to list the player who made
the error as the first character in the location field.
(ex: "er 3/rg6 b1" for a dropped throw by the firstbaseman)
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.
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.
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: Harvey FLA R 9 (this would put Harvey in the 9 hole)
dr - defensive replacement
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.
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 undo as many events
as you wish, until you reach the first batter of the game.
It is not possible to "undo" the starting lineups.
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
in - enters in an "infield in" comment, can supply positions
ic - enters in an "infield in @ 1b/3b" 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
cs - caught stealing
pk - picked off
th - advance on a throw
oa - out advancing on a throw
ri - baserunner out due to interference
di - defensive indifference
1b - single
2b - double
3b - triple
hr - home run
tp - triple play
dp, gd - ground into double play
fd - fly into double play
ld - line into double play
lo - line out
fc - fielder's choice, batter reaches first
hg - hard ground out
rg - routine ground out
sg - slow ground out
hf - high fly
po - pop out
fp, pf - foul pop out
sf - sacrifice fly
sh - sacrifice hit
lf - long fly
wt, df - warning track fly (from deep fly chart)
er - batter reaches on error
ea - runner advances on error
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 should to be 100% safe.
The moral of the story is... use undo at your own risk. What is listed
above is the "observed" pattern of behavior for undo. It *may* crash,
possibly destroying your game report. If you don't want to try undo
simply end the game and use copy-paste to re-input your commands, or
copy/edit the .cmd file and re-run grs using the -f flag.
GRSCAT
grscat is a shell script I wrote to concatenate the files that GRS
creates. I name my files according to week number and game number
e.g. grs 8-1 - for week 8, game 1
grscat takes a single argument, the week number
e.g grscat 8 - will cat all week 8 games into a file named "8"
also, if you put mail header info into a file called .grscat in the
same directory as the files you are grscat-ing, it will put it at
the top of the file
e.g. my .grscat is
To:
cc:
Subject:
-------
WEEK
AWAY
HOME