@@ -11,7 +11,6 @@ public partial class Form1 : Form {
11
11
#region Declarations
12
12
13
13
private static bool steam ;
14
- private static int rodType ;
15
14
private static Point locationStartButton ;
16
15
private static Point locationCloseShellDialogBox ;
17
16
private static Point locationTradeFishButton ;
@@ -33,7 +32,6 @@ public partial class Form1 : Form {
33
32
MethodHelper helper ;
34
33
#endregion
35
34
36
-
37
35
public Form1 ( ) {
38
36
39
37
InitializeComponent ( ) ;
@@ -43,35 +41,18 @@ public Form1() {
43
41
backgroundThreadGetTimes . WorkerReportsProgress = true ;
44
42
backgroundThreadGetTimes . WorkerSupportsCancellation = true ;
45
43
46
- this . Size = new Size ( 375 , 350 ) ;
47
-
48
- rodTimerDebugToolTip . SetToolTip ( rodTimerDebug , "Use this to adjust fishing timer to get a better catch result." +
49
- "\n Add/subtract milliseconds (you shouldn't have to change more than 10 milliseconds)" +
50
- "\n depending on if you are stopping before the max value or going past the max." ) ;
51
- getTimesDedubToolTip . SetToolTip ( getTimesBtn , "This function will automatically calculate the rod timer.\n " +
52
- "Press the button and wait for the program to time the cast bar going from max value to max value.\n " +
53
- "This will calculate five passes of the cast bar maximizing and return an average.\n " +
54
- "You can use this average as a solid rod timer to get a near 100% max cast." ) ;
55
-
56
44
kongButton . CheckedChanged += new EventHandler ( platform_CheckedChanged ) ;
57
45
kartridgeButton . CheckedChanged += new EventHandler ( platform_CheckedChanged ) ;
58
46
steamButton . CheckedChanged += new EventHandler ( platform_CheckedChanged ) ;
59
47
60
- woodFishingRod . CheckedChanged += new EventHandler ( rodType_CheckedChanged ) ;
61
- trollingRod . CheckedChanged += new EventHandler ( rodType_CheckedChanged ) ;
62
- spinningRod . CheckedChanged += new EventHandler ( rodType_CheckedChanged ) ;
63
- flyRod . CheckedChanged += new EventHandler ( rodType_CheckedChanged ) ;
64
- legRod . CheckedChanged += new EventHandler ( rodType_CheckedChanged ) ;
65
-
66
48
castCatchLocationLbl . Text = "Cast/Catch Location:\n Press start button when on fishing start screen" ;
67
49
68
- rodChoiceGroupBox . Enabled = false ;
50
+ helper = new MethodHelper ( steam ) ;
51
+
69
52
baitToUseText . Enabled = false ;
70
53
findLocationBtn . Enabled = false ;
71
54
autoBtn . Enabled = false ;
72
55
cancelAutoModeBtn . Enabled = false ;
73
- getTimesBtn . Enabled = false ;
74
-
75
56
76
57
}
77
58
/// <summary>
@@ -80,57 +61,15 @@ public Form1() {
80
61
/// </summary>
81
62
private void platform_CheckedChanged ( object sender , EventArgs e ) {
82
63
RadioButton radioButton = sender as RadioButton ;
83
-
84
64
if ( kongButton . Checked || kartridgeButton . Checked ) {
85
65
steam = false ;
86
66
} else if ( steamButton . Checked ) {
87
67
steam = true ;
88
68
}
89
- rodChoiceGroupBox . Enabled = true ;
90
- }
91
-
92
- /// <summary>
93
- /// This determines which radio button was clicked.
94
- /// Each rod has a different timing.
95
- /// The timing is the time it takes for the casting bar to go from its max value, down to its lowest point and back up to its max value.
96
- /// I use this method of fishing as it has netted better results over clicking cast as soon as the program detects the casting bar at its max value.
97
- /// </summary>
98
- private void rodType_CheckedChanged ( object sender , EventArgs e ) {
99
- RadioButton radioButton = sender as RadioButton ;
100
-
101
- if ( woodFishingRod . Checked ) {
102
- if ( steam )
103
- rodType = 1250 ;
104
- else
105
- rodType = 1260 ;
106
- } else if ( trollingRod . Checked ) {
107
- if ( steam )
108
- rodType = 1350 ;
109
- else
110
- rodType = 1360 ;
111
- } else if ( spinningRod . Checked ) {
112
- if ( steam )
113
- rodType = 1450 ;
114
- else
115
- rodType = 1460 ;
116
- } else if ( flyRod . Checked ) {
117
- if ( steam )
118
- rodType = 1520 ;
119
- else
120
- rodType = 1525 ;
121
- } else if ( legRod . Checked ) {
122
- if ( steam )
123
- rodType = 1580 ;
124
- else
125
- rodType = 1585 ;
126
- }
127
- rodTimerDebug . Value = rodType ;
128
- helper = new MethodHelper ( steam , rodType ) ;
129
69
baitToUseText . Enabled = true ;
130
70
findLocationBtn . Enabled = true ;
131
71
}
132
72
133
-
134
73
private void CastCatchLocation_Click ( object sender , EventArgs e ) {
135
74
locationStartButton = helper . FindColor ( startButtonGreen ) ;
136
75
if ( locationStartButton == new Point ( ) ) {
@@ -155,23 +94,13 @@ private void CastCatchLocation_Click(object sender, EventArgs e) {
155
94
locationTopLeftWeightScreenshot = new Point ( locationStartButton . X - 25 , locationStartButton . Y - 130 ) ;
156
95
locationBottomRightWeightScreenshot = new Point ( locationStartButton . X + 160 , locationStartButton . Y - 50 ) ;
157
96
location100Position = new Point ( locationStartButton . X + 373 , locationStartButton . Y - 81 ) ;
158
-
159
97
}
160
98
castCatchLocationLbl . Text = "Cast/Catch Location:\n " + locationStartButton . ToString ( ) ;
161
99
autoBtn . Enabled = true ;
162
100
cancelAutoModeBtn . Enabled = true ;
163
- getTimesBtn . Enabled = true ;
164
101
}
165
102
}
166
103
167
- private void getTimesBtn_Click ( object sender , EventArgs e ) {
168
- getTimesBtn . Enabled = false ;
169
- backgroundThreadGetTimes . RunWorkerAsync ( ) ;
170
- getTimesBtn . Enabled = true ;
171
- }
172
-
173
-
174
-
175
104
private void autoBtn_Click ( object sender , EventArgs e ) {
176
105
backgroundThread . RunWorkerAsync ( ) ;
177
106
}
@@ -189,7 +118,7 @@ private void backgroundThread_DoWork(object sender, DoWorkEventArgs e) {
189
118
//Performs cast
190
119
bool caughtFish = true ;
191
120
bool fishGetAway = true ;
192
- printMessage ( baitUsed , baitToUse , " bait used.\n Performing cast.\n Timer: " + rodType ) ;
121
+ printMessage ( baitUsed , baitToUse , " bait used.\n Performing cast." ) ;
193
122
++ baitUsed ;
194
123
Invoke ( new Action ( ( ) => Refresh ( ) ) ) ;
195
124
Invoke ( new Action ( ( ) => helper . startCast ( locationStartButton ) ) ) ;
@@ -214,7 +143,7 @@ private void backgroundThread_DoWork(object sender, DoWorkEventArgs e) {
214
143
Invoke ( new Action ( ( ) => helper . catchFish ( location100Position , oneHundredCatchColor ) ) ) ;
215
144
Thread . Sleep ( 5000 ) ;
216
145
while ( fishGetAway ) {
217
-
146
+
218
147
//fish caught
219
148
if ( worker . CancellationPending == true ) {
220
149
e . Cancel = true ;
@@ -253,8 +182,6 @@ private void backgroundThread_DoWork(object sender, DoWorkEventArgs e) {
253
182
backgroundThread . CancelAsync ( ) ;
254
183
}
255
184
256
-
257
-
258
185
private void cancelAutoModeBtn_Click ( object sender , EventArgs e ) {
259
186
backgroundThread . CancelAsync ( ) ;
260
187
}
@@ -264,30 +191,5 @@ private void printMessage(int baitUsed, int baitToUse, string msg) {
264
191
debugAutoStepLbl . Text = baitUsed + "/" + baitToUse + msg ;
265
192
} ) ;
266
193
}
267
-
268
- private void debugOptions_CheckedChanged ( object sender , EventArgs e ) {
269
- if ( debugOptions . Checked ) {
270
- this . Size = new Size ( 500 , 350 ) ;
271
-
272
- } else {
273
- this . Size = new Size ( 375 , 350 ) ;
274
- }
275
- }
276
-
277
- private void rodTimerDebug_ValueChanged ( object sender , EventArgs e ) {
278
- rodType = ( int ) rodTimerDebug . Value ;
279
- //initiliaze helper again to reflect the rodtype change.
280
- helper = new MethodHelper ( steam , rodType ) ;
281
- }
282
-
283
- private void backgroundThreadGetTimes_DoWork ( object sender , DoWorkEventArgs e ) {
284
- BackgroundWorker worker = sender as BackgroundWorker ;
285
- Invoke ( new Action ( ( ) => helper . getTimesMessageBox ( locationStartButton ) ) ) ;
286
- backgroundThreadGetTimes . CancelAsync ( ) ;
287
- }
288
-
289
- private void saveScreenshotButton_Click ( object sender , EventArgs e ) {
290
- helper . GetScreenShot ( true ) ;
291
- }
292
194
}
293
195
}
0 commit comments