This repository was archived by the owner on Oct 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModule2.bas
More file actions
301 lines (224 loc) · 6.23 KB
/
Module2.bas
File metadata and controls
301 lines (224 loc) · 6.23 KB
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
Attribute VB_Name = "Module2"
' JP Server - Score Match Macros
Sub SM_JP_Step1_Expert()
'
' Set Expert in Step 1 for JP SM Macro
'
'
Dim EXPGain As Integer
Dim BaseScore As Integer
Dim LP As Integer
EXPGain = Range("H10").Value
LP = Range("H11").Value
BaseScore = Range("H12").Value
Range("H21").Value = "Expert"
Range("I21").Value = EXPGain
Range("H22").Value = "Expert"
Range("I22").Value = BaseScore
Range("K21").Value = LP
End Sub
Sub SM_JP_Step1_Hard()
'
' Set Hard in Step 1 for JP SM Macro
'
'
Dim EXPGain As Integer
Dim BaseScore As Integer
Dim LP As Integer
EXPGain = Range("I10").Value
LP = Range("I11").Value
BaseScore = Range("I12").Value
Range("H21").Value = "Hard"
Range("I21").Value = EXPGain
Range("H22").Value = "Hard"
Range("I22").Value = BaseScore
Range("K21").Value = LP
End Sub
Sub SM_JP_Step1_Normal()
'
' Set Normal in Step 1 for JP Score Match Macro
'
'
Dim EXPGain As Integer
Dim BaseScore As Integer
Dim LP As Integer
EXPGain = Range("J10").Value
LP = Range("J11").Value
BaseScore = Range("J12").Value
Range("H21").Value = "Normal"
Range("I21").Value = EXPGain
Range("H22").Value = "Normal"
Range("I22").Value = BaseScore
Range("K21").Value = LP
End Sub
Sub SM_JP_Step1_Easy()
'
' Set Easy in Step 1 for JP Score Match Macro
'
'
Dim EXPGain As Integer
Dim BaseScore As Integer
Dim LP As Integer
EXPGain = Range("K10").Value
LP = Range("K11").Value
BaseScore = Range("K12").Value
Range("H21").Value = "Easy"
Range("I21").Value = EXPGain
Range("H22").Value = "Easy"
Range("I22").Value = BaseScore
Range("K21").Value = LP
End Sub
Sub SM_JP_Step2_S()
'
' Set S score in Step 2 for JP Score Match Macro
'
Dim ScoreRank As Double
ScoreRank = Range("H16").Value
Range("H23").Value = "S Rank"
Range("I23").Value = ScoreRank
End Sub
Sub SM_JP_Step2_A()
'
' Set A score in Step 2 for JP Score Match Macro
'
Dim ScoreRank As Double
ScoreRank = Range("I16").Value
Range("H23").Value = "A Rank"
Range("I23").Value = ScoreRank
End Sub
Sub SM_JP_Step2_B()
'
' Set B score in Step 2 for JP Score Match Macro
'
Dim ScoreRank As Double
ScoreRank = Range("J16").Value
Range("H23").Value = "B Rank"
Range("I23").Value = ScoreRank
End Sub
Sub SM_JP_Step2_C()
'
' Set C score in Step 2 for JP Score Match Macro
'
Dim ScoreRank As Double
ScoreRank = Range("K16").Value
Range("H23").Value = "C Rank"
Range("I23").Value = ScoreRank
End Sub
Sub SM_JP_Step3_1st()
'
' Set 1st place in Step 3 for JP Score Match Macro
'
Dim PlaceRank As Double
PlaceRank = Range("H19").Value
Range("H24").Value = "1st"
Range("I24").Value = PlaceRank
End Sub
Sub SM_JP_Step3_2nd()
'
' Set 2nd place in Step 3 for JP Score Match Macro
'
Dim PlaceRank As Double
PlaceRank = Range("I19").Value
Range("H24").Value = "2nd"
Range("I24").Value = PlaceRank
End Sub
Sub SM_JP_Step3_3rd()
'
' Set 3rd place in Step 3 for JP Score Match Macro
'
Dim PlaceRank As Double
PlaceRank = Range("J19").Value
Range("H24").Value = "3rd"
Range("I24").Value = PlaceRank
End Sub
Sub SM_JP_Step3_4th()
'
' Set 4th place in Step 3 for JP Score Match Macro
'
Dim PlaceRank As Double
PlaceRank = Range("K19").Value
Range("H24").Value = "4th"
Range("I24").Value = PlaceRank
End Sub
Sub SM_JP_Add()
'
' Adds Score Match round points and EXP to JP Macro
'
Dim BasePoints As Integer
Dim ScoreRank As Double
Dim PlaceRank As Double
Dim RoundPoints As Integer
Dim EXPGain As Integer
BasePoints = Range("I22").Value
ScoreRank = Range("I23").Value
PlaceRank = Range("I24").Value
'the 0.00001 is to force VB to round up at .5
RoundPoints = Round(BasePoints * ScoreRank * PlaceRank + 0.000001, 0)
EXPGain = Range("I21").Value
' Add Round Points to the running total.
Range("H28").Value = Range("H28").Value + RoundPoints
Range("H5").Value = Range("H5").Value + EXPGain
' Add results to history
SM_JP_HistoryAdd (RoundPoints)
End Sub
Sub SM_JP_Remove()
'
' Removes Score Match round points & EXP from JP Macro
'
Dim BasePoints As Integer
Dim ScoreRank As Double
Dim PlaceRank As Double
Dim RoundPoints As Integer
Dim EXPGain As Integer
BasePoints = Range("I22").Value
ScoreRank = Range("I23").Value
PlaceRank = Range("I24").Value
'the 0.00001 is to force VB to round up at .5
RoundPoints = Round(BasePoints * ScoreRank * PlaceRank + 0.000001, 0)
EXPGain = Range("I21").Value
' Remove Round Points from the running total.
Range("H28").Value = Range("H28").Value - RoundPoints
Range("H5").Value = Range("H5").Value - EXPGain
' Delete the last result from history.
SM_JP_HistoryDel
End Sub
Sub SM_JP_HistoryAdd(RoundPoints)
'
' SM_JP_HistoryAdd Macro
' Adds the current score match information to history.
'
Dim RowNumber As Integer
RowNumber = Range("K28").Value
' Current Date/Time
Range("G" + CStr(RowNumber)).Value = Now()
' Copy/Paste Difficulty
Range("H" + CStr(RowNumber)).Value = Range("H22").Value
' Copy/Paste Score Rank
Range("I" + CStr(RowNumber)).Value = Range("H23").Value
' Copy/Paste Placement
Range("J" + CStr(RowNumber)).Value = Range("H24").Value
' Copy/Paste Round Points
Range("K" + CStr(RowNumber)).Value = RoundPoints
' Add 1 to Rows
Range("K28").Value = RowNumber + 1
End Sub
Sub SM_JP_HistoryDel()
'
' SM_JP_HistoryDel Macro
' Deletes the last added SM history on JP
'
Dim RowNumber As Integer
RowNumber = Range("K28").Value - 1
' Current Date/Time
Range("G" + CStr(RowNumber)).Value = ""
' Copy/Paste Difficulty
Range("H" + CStr(RowNumber)).Value = ""
' Copy/Paste Score Rank
Range("I" + CStr(RowNumber)).Value = ""
' Copy/Paste Placement
Range("J" + CStr(RowNumber)).Value = ""
' Copy/Paste Round Points
Range("K" + CStr(RowNumber)).Value = ""
' Put the reduced row number back in the cell.
Range("K28").Value = RowNumber
End Sub