├── .vs
└── Maple
│ └── v16
│ ├── .suo
│ └── Server
│ └── sqlite3
│ ├── db.lock
│ └── storage.ide
├── Maple.sln
├── Maple
├── App.config
├── App.xaml
├── App.xaml.cs
├── Controls
│ └── LabeledControl
│ │ └── LabeledControl.cs
├── Data
│ ├── CharacterData.cs
│ ├── GameData.cs
│ ├── ImageFinder.cs
│ ├── Imaging.cs
│ ├── Input.cs
│ ├── JumpData.cs
│ ├── MapData.cs
│ ├── MapleMath.cs
│ ├── MapleSerialPort.cs
│ ├── MobData.cs
│ └── SkillData.cs
├── Images
│ ├── BlueEspressoMachineLeft.png
│ ├── BlueEspressoMachineRight.png
│ ├── BlueRaspberryJellyJuiceLeft.png
│ ├── BlueRaspberryJellyJuiceRight.png
│ ├── ChangeChannel.png
│ ├── CharacterSelectionCharacterSlot.png
│ ├── ClaimReward.png
│ ├── ContentGuide.png
│ ├── DemonAvengerName.png
│ ├── FullHealthBar.png
│ ├── HP.png
│ ├── HealthBarDropping.png
│ ├── HealthBarEmpty.png
│ ├── LeftHealthBar.png
│ ├── OtherPlayerMiniMap.png
│ ├── OverheadQuest.png
│ ├── PlayerMiniMap.png
│ ├── RebootServer.png
│ ├── RebootServerChannelSelect.png
│ ├── Rune.png
│ ├── RuneMiniMap.png
│ ├── TheNextLegendTitle.png
│ ├── badguy1.png
│ ├── map1.png
│ ├── runetest1.png
│ ├── runetest2.png
│ ├── runetest3.png
│ ├── runetest4.png
│ └── runetest5.png
├── MainWindow.xaml
├── MainWindow.xaml.cs
├── Maple.csproj
├── Models
│ └── ModelBase.cs
├── Properties
│ ├── AssemblyInfo.cs
│ ├── Resources.Designer.cs
│ ├── Resources.resx
│ ├── Settings.Designer.cs
│ └── Settings.settings
├── ViewModels
│ ├── GamePlayerViewModel.cs
│ ├── JobEditViewModel.cs
│ ├── JobsWindowViewModel.cs
│ ├── MainWindowViewModel.cs
│ ├── MapCreatorViewModel.cs
│ ├── SkillEditViewModel.cs
│ └── ViewModelBase.cs
├── Windows
│ ├── GamePlayer.xaml
│ ├── GamePlayer.xaml.cs
│ ├── JobEdit.xaml
│ ├── JobEdit.xaml.cs
│ ├── JobsWindow.xaml
│ ├── JobsWindow.xaml.cs
│ ├── MapCreator.xaml
│ ├── MapCreator.xaml.cs
│ ├── SkillEdit.xaml
│ ├── SkillEdit.xaml.cs
│ ├── StatisticsViewer.xaml
│ └── StatisticsViewer.xaml.cs
├── bin
│ └── Debug
│ │ ├── Maple.exe
│ │ ├── Maple.exe.config
│ │ └── Maple.pdb
├── obj
│ └── Debug
│ │ ├── App.g.cs
│ │ ├── App.g.i.cs
│ │ ├── DesignTimeResolveAssemblyReferences.cache
│ │ ├── DesignTimeResolveAssemblyReferencesInput.cache
│ │ ├── MainWindow.baml
│ │ ├── MainWindow.g.cs
│ │ ├── MainWindow.g.i.cs
│ │ ├── Maple.Properties.Resources.resources
│ │ ├── Maple.csproj.CopyComplete
│ │ ├── Maple.csproj.FileListAbsolute.txt
│ │ ├── Maple.csproj.GenerateResource.cache
│ │ ├── Maple.csprojAssemblyReference.cache
│ │ ├── Maple.exe
│ │ ├── Maple.g.resources
│ │ ├── Maple.pdb
│ │ ├── Maple_Content.g.i.cs
│ │ ├── Maple_MarkupCompile.cache
│ │ ├── Maple_MarkupCompile.i.cache
│ │ ├── Maple_MarkupCompile.lref
│ │ └── Windows
│ │ ├── MapCreator.baml
│ │ ├── MapCreator.g.cs
│ │ ├── MapCreator.g.i.cs
│ │ ├── StatisticsViewer.baml
│ │ ├── StatisticsViewer.g.cs
│ │ └── StatisticsViewer.g.i.cs
└── packages.config
├── MaplestoryBotArduinoKeyboard
├── MaplestoryBotArduinoKeyboard.ino
└── Pro_micro_build.bat.txt
├── MaplestoryBotArduinoMaster
└── MaplestoryBotArduinoMaster.ino
├── MaplestoryBotArduinoMouse
└── MaplestoryBotArduinoMouse.ino
└── README.md
/.vs/Maple/v16/.suo:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/.vs/Maple/v16/.suo
--------------------------------------------------------------------------------
/.vs/Maple/v16/Server/sqlite3/db.lock:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/.vs/Maple/v16/Server/sqlite3/db.lock
--------------------------------------------------------------------------------
/.vs/Maple/v16/Server/sqlite3/storage.ide:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/.vs/Maple/v16/Server/sqlite3/storage.ide
--------------------------------------------------------------------------------
/Maple.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio Version 16
4 | VisualStudioVersion = 16.0.29806.167
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Maple", "Maple\Maple.csproj", "{4323BFC3-33BD-4478-A364-FAAC2BE09F74}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {4323BFC3-33BD-4478-A364-FAAC2BE09F74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {4323BFC3-33BD-4478-A364-FAAC2BE09F74}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {4323BFC3-33BD-4478-A364-FAAC2BE09F74}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {4323BFC3-33BD-4478-A364-FAAC2BE09F74}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {ACDE779A-102C-4B7F-AF93-3C89800D6FEF}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/Maple/App.config:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/Maple/App.xaml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/Maple/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Configuration;
4 | using System.Data;
5 | using System.Linq;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 |
9 | namespace Maple
10 | {
11 | ///
12 | /// Interaction logic for App.xaml
13 | ///
14 | public partial class App : Application
15 | {
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/Maple/Controls/LabeledControl/LabeledControl.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 |
9 | namespace Maple.Controls.LabeledControl
10 | {
11 | public class LabeledControl : HeaderedContentControl
12 | {
13 | static LabeledControl()
14 | {
15 | DefaultStyleKeyProperty.OverrideMetadata(typeof(LabeledControl), new FrameworkPropertyMetadata(typeof(LabeledControl)));
16 | }
17 |
18 | public double LabelWidth
19 | {
20 | get { return (double)GetValue(LabelWidthProperty); }
21 | set { SetValue(LabelWidthProperty, value); }
22 | }
23 |
24 | public static readonly DependencyProperty LabelWidthProperty =
25 | DependencyProperty.Register("LabelWidth", typeof(double), typeof(LabeledControl), new PropertyMetadata(Double.NaN));
26 |
27 | public double LabelHeight
28 | {
29 | get { return (double)GetValue(LabelHeightProperty); }
30 | set { SetValue(LabelHeightProperty, value); }
31 | }
32 |
33 | public static readonly DependencyProperty LabelHeightProperty =
34 | DependencyProperty.Register("LabelHeight", typeof(double), typeof(LabeledControl), new PropertyMetadata(Double.NaN));
35 |
36 | public Dock LabelDock
37 | {
38 | get { return (Dock)GetValue(LabelDockProperty); }
39 | set
40 | {
41 | switch (value)
42 | {
43 | case Dock.Bottom:
44 | break;
45 | case Dock.Left:
46 | break;
47 | case Dock.Right:
48 | break;
49 | case Dock.Top:
50 | break;
51 | }
52 | SetValue(LabelDockProperty, value);
53 | }
54 | }
55 |
56 | public static readonly DependencyProperty LabelDockProperty =
57 | DependencyProperty.Register("LabelDock", typeof(Dock), typeof(LabeledControl), new PropertyMetadata(Dock.Left));
58 |
59 | public TextAlignment LabelTextAlignment
60 | {
61 | get { return (TextAlignment)GetValue(LabelTextAlignmentProperty); }
62 | set { SetValue(LabelTextAlignmentProperty, value); }
63 | }
64 |
65 | public static readonly DependencyProperty LabelTextAlignmentProperty =
66 | DependencyProperty.Register("LabelTextAlignment", typeof(TextAlignment), typeof(LabeledControl), new PropertyMetadata(TextAlignment.Left));
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/Maple/Data/CharacterData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace Maple.Data
9 | {
10 | public enum Jobs
11 | {
12 | FirePoisonMage,
13 | AngelicBuster,
14 | Bowmaster,
15 | WildHunter,
16 | Paladin,
17 | Hero,
18 | Shadower,
19 | Zero,
20 | Evan,
21 | Buccaneer,
22 | Bishop,
23 | BeastTamer,
24 | Kinesis,
25 | Luminous,
26 | NightWalker,
27 | DemonSlayer,
28 | IceLightningMage,
29 | Blaster,
30 | DemonAvenger,
31 | BattleMage,
32 | Shade,
33 | Illium,
34 | Ark,
35 | Pathfinder,
36 | Kaiser,
37 | Hayato,
38 | Aran,
39 | Phantom,
40 | BlazeWizard,
41 | DarkKnight,
42 | Mechanic,
43 | NightLord,
44 | Corsair,
45 | Cannoneer,
46 | Marksman,
47 | Mercedes,
48 | DualBlade,
49 | WindArcher,
50 | DawnWarrior,
51 | Hoyoung,
52 | Mihile,
53 | Cadena,
54 | ThunderBreaker,
55 | Jett,
56 | Xenon,
57 | Adele,
58 | Kain,
59 | Kanna
60 | }
61 |
62 | class CharacterData
63 | {
64 | public string CharacterName { get; set; }
65 | public Jobs CharacterJob { get; set; }
66 | int Level { get; set; }
67 | public JumpData JumpDataData { get; set; }
68 | public List SkillDataList { get; set; }
69 | public int CharacterSelectionLocation { get; set; }
70 |
71 | public bool TryToUseSkill()
72 | {
73 | var curSkill = SkillDataList.OrderBy(x => x.NextUseTime).First();
74 | if (curSkill.NextUseTime < DateTime.Now)
75 | {
76 | curSkill.UseSkill();
77 | return true;
78 | }
79 | return false;
80 | }
81 |
82 | public CharacterData()
83 | {
84 | SkillDataList = new List();
85 | }
86 | }
87 | }
88 |
--------------------------------------------------------------------------------
/Maple/Data/Input.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Concurrent;
3 | using System.Collections.Generic;
4 | using System.Configuration;
5 | using System.IO.Ports;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading;
9 | using System.Threading.Tasks;
10 |
11 | namespace Maple.Data
12 | {
13 | public class Input
14 | {
15 | public enum SpecialCharacters
16 | {
17 | KEY_LEFT_CTRL = 128,
18 | KEY_LEFT_SHIFT = 129,
19 | KEY_LEFT_ALT = 130,
20 | KEY_LEFT_GUI = 131,
21 | KEY_RIGHT_CTRL = 132,
22 | KEY_RIGHT_SHIFT = 133,
23 | KEY_RIGHT_ALT = 134,
24 | KEY_RIGHT_GUI = 135,
25 | KEY_UP_ARROW = 218,
26 | KEY_DOWN_ARROW = 217,
27 | KEY_LEFT_ARROW = 216,
28 | KEY_RIGHT_ARROW = 215,
29 | KEY_BACKSPACE = 178,
30 | KEY_TAB = 179 ,
31 | KEY_RETURN = 176 ,
32 | KEY_ESC = 177 ,
33 | KEY_INSERT = 209 ,
34 | KEY_DELETE = 212 ,
35 | KEY_PAGE_UP = 211 ,
36 | KEY_PAGE_DOWN = 214 ,
37 | KEY_HOME = 210,
38 | KEY_END = 213,
39 | KEY_CAPS_LOCK = 193,
40 | KEY_F1 = 194,
41 | KEY_F2 = 195,
42 | KEY_F3 = 196,
43 | KEY_F4 = 197,
44 | KEY_F5 = 198,
45 | KEY_F6 = 199,
46 | KEY_F7 = 200,
47 | KEY_F8 = 201,
48 | KEY_F9 = 202,
49 | KEY_F10 = 203,
50 | KEY_F11 = 204,
51 | KEY_F12 = 205,
52 | }
53 |
54 | public static MapleSerialPort MasterArduinoData;
55 | public static MapleSerialPort KeyboardArduinoData;
56 | public static MapleSerialPort MouseArduinoData;
57 |
58 | public static ConcurrentDictionary ActiveCharInput = new ConcurrentDictionary();
59 | public static ConcurrentDictionary ActiveSpecialCharInput = new ConcurrentDictionary();
60 | public static bool NewInputEnabled;
61 |
62 | public static void StopAllKeyboardInput()
63 | {
64 | List charsToRemove = ActiveCharInput.Keys.ToList();
65 | List specialCharsToRemove = ActiveSpecialCharInput.Keys.ToList();
66 | foreach (var curChar in charsToRemove)
67 | {
68 | StopInput(curChar);
69 | }
70 | foreach (var curSpecialChar in specialCharsToRemove)
71 | {
72 | StopInput(curSpecialChar);
73 | }
74 | }
75 |
76 | public static void StartInput(char c)
77 | {
78 | if (!NewInputEnabled)
79 | {
80 | return;
81 | }
82 | ActiveCharInput[c] = DateTime.Now;
83 | int asciiVal = (int)c;
84 | string asciiValString = asciiVal.ToString().PadLeft(3, '0');
85 | MasterArduinoData.SendData($"KEYDOWN{asciiValString}");
86 | }
87 |
88 | public static void StartInput(SpecialCharacters specialCharacter)
89 | {
90 | if (!NewInputEnabled)
91 | {
92 | return;
93 | }
94 | ActiveSpecialCharInput[specialCharacter] = DateTime.Now;
95 | int asciiVal = (int)specialCharacter;
96 | string asciiValString = asciiVal.ToString().PadLeft(3, '0');
97 | MasterArduinoData.SendData($"KEYDOWN{asciiValString}");
98 | }
99 |
100 | public static void StopInput(char c)
101 | {
102 | if (!ActiveCharInput.TryRemove(c, out DateTime inputDateTime))
103 | {
104 | return;
105 | }
106 | int asciiVal = (int)c;
107 | string asciiValString = asciiVal.ToString().PadLeft(3, '0');
108 | MasterArduinoData.SendData($"KEYLIFT{asciiValString}");
109 | }
110 |
111 | public static void StopInput(SpecialCharacters specialCharacter)
112 | {
113 | if (!ActiveSpecialCharInput.TryRemove(specialCharacter, out DateTime inputDateTime))
114 | {
115 | return;
116 | }
117 | int asciiVal = (int)specialCharacter;
118 | string asciiValString = asciiVal.ToString().PadLeft(3, '0');
119 | MasterArduinoData.SendData($"KEYLIFT{asciiValString}");
120 | }
121 |
122 | private static void MoveMouse(Vector2 location)
123 | {
124 | // MV00000000
125 | string movXString = location.X.ToString().PadLeft(4, '0');
126 | string movYString = location.Y.ToString().PadLeft(4, '0');
127 | MasterArduinoData.SendData($"MV{movXString}{movYString}");
128 | _mouseLocation = new Vector2(Math.Max(_mouseLocation.X + location.X, 0), Math.Max(_mouseLocation.Y + location.Y, 0));
129 | }
130 |
131 | public static void SetMouseLocation(Vector2 location)
132 | {
133 | Random rand = new Random();
134 | /*int sleepAmount = 1;
135 | int randX;
136 | int randY;
137 | int numPolys = rand.Next(1, 4);*/
138 | if (_mouseLocation.X == location.X)
139 | {
140 | MoveMouse(new Vector2(rand.Next(3, 10), rand.Next(1, 5)));
141 | }
142 | List locations = new List() { location, _mouseLocation };
143 | /*for (int i = 0; i < numPolys; i++)
144 | {
145 | randX = location.X - _mouseLocation.X;
146 | randY = location.Y - _mouseLocation.Y;
147 | int moveAmountX = rand.Next(Math.Min(randX, 0), Math.Max(randX + 1, 0));
148 | int moveAmountY = rand.Next(Math.Min(randY, 0), Math.Max(randY + 1, 0));
149 | locations.Add(new Vector2(moveAmountX, moveAmountY));
150 | }*/
151 | var moveLocations = MapleMath.PolynomialLeastSquares(locations.OrderBy(x => x.X).ToList());
152 | int originalIterator = 0;
153 | int iteratorChangeAmount = 1;
154 | int maxVal = moveLocations.Count;
155 | if (_mouseLocation.X > location.X)
156 | {
157 | originalIterator = moveLocations.Count - 1;
158 | iteratorChangeAmount = -1;
159 | maxVal = -1;
160 | }
161 | for (int i = originalIterator; i != maxVal; i += iteratorChangeAmount)
162 | {
163 | Vector2 curLocation = moveLocations[i];
164 | MoveMouse(new Vector2(curLocation.X - _mouseLocation.X, curLocation.Y - _mouseLocation.Y));
165 | }
166 | /*while (_mouseLocation.X != location.X || _mouseLocation.Y != location.Y)
167 | {
168 |
169 | sleepAmount = rand.Next(5, 15);
170 | MoveMouse(new Vector2(moveAmountX, moveAmountY));
171 | Thread.Sleep(sleepAmount);
172 | }*/
173 | //MoveMouse(new Vector2(location.X, location.Y));
174 | }
175 |
176 | private static Vector2 _mouseLocation;
177 |
178 |
179 | public static void ClickMouse()
180 | {
181 | MasterArduinoData.SendData($"MOUSELCLCK");
182 | }
183 |
184 | public static void RightClickMouse()
185 | {
186 | MasterArduinoData.SendData($"MOUSERCLCK");
187 | }
188 |
189 | public static void ReleaseMouse()
190 | {
191 | MasterArduinoData.SendData($"MOUSELRLAX");
192 | }
193 |
194 | public static void RightReleaseMouse()
195 | {
196 | MasterArduinoData.SendData($"MOUSERRLAX");
197 | }
198 |
199 | public static void ResetMouse()
200 | {
201 | /*for (int i = 0; i < 10; i++)
202 | {
203 | Input.MoveMouse(new Vector2(10, 100));
204 | }*/
205 | _mouseLocation = new Vector2(500, 500);
206 | Input.MoveMouse(new Vector2(10, 10));
207 | for (int i = 0; i < 50; i++)
208 | {
209 | Input.MoveMouse(new Vector2(-100, 0));
210 | }
211 | Input.MoveMouse(new Vector2(10, 0));
212 | for (int i = 0; i < 50; i++)
213 | {
214 | Input.MoveMouse(new Vector2(0, -100));
215 | }
216 | for (int i = 0; i < 50; i++)
217 | {
218 | Input.MoveMouse(new Vector2(-100, 0));
219 | }
220 | Input.MoveMouse(new Vector2(-20, 0));
221 | _mouseLocation = new Vector2(0, 0);
222 | }
223 |
224 | public static void InitializeInputs()
225 | {
226 | Input.KeyboardArduinoData = new MapleSerialPort("Keyboard", ConfigurationManager.AppSettings["ArduinoKeyboardComNumber"]);
227 | Input.MasterArduinoData = new MapleSerialPort("Master", ConfigurationManager.AppSettings["ArduinoMasterComNumber"]);
228 | Input.MouseArduinoData = new MapleSerialPort("Mouse", ConfigurationManager.AppSettings["ArduinoMouseComNumber"]);
229 | ResetMouse();
230 | ClickMouse();
231 | Thread.Sleep(11);
232 | ReleaseMouse();
233 | }
234 |
235 | /*public static void DoubleClickMouse()
236 | {
237 | ArduinoPortData.Write($"MDCLCK");
238 | }
239 |
240 | private static void DisconnectFromArduino()
241 | {
242 | //IsConnected = false;
243 | ArduinoPortData.Write("#STOP\n");
244 | ArduinoPortData.Close();
245 | }*/
246 | }
247 | }
248 |
--------------------------------------------------------------------------------
/Maple/Data/JumpData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace Maple.Data
9 | {
10 | public enum JumpTypes
11 | {
12 | //ArrowUpJumpJump,
13 | ArrowJumpUpUp,
14 | ArrowJump,
15 | ArrowJumpJump,
16 | ArrowFlashJump,
17 | JumpDown
18 | }
19 |
20 | public class DelaysAndEquationCoefficients
21 | {
22 | public List MillisecondDelays { get; set; }
23 | public List EquationCoefficients { get; set; }
24 |
25 | public double MaxX;
26 |
27 | public double MaxY;
28 |
29 | public List JumpDataPoints { get; set; }
30 |
31 | public double GetYValueFromXValue(double xValue)
32 | {
33 | double curYValue = EquationCoefficients[EquationCoefficients.Count - 1];
34 | int curNumXs = 1;
35 | for (int i = EquationCoefficients.Count - 2; i >= 0; i--)
36 | //for (int i = 0; i < EquationCoefficients.Count - 1; i++)
37 | {
38 | double curVal = xValue;
39 | for (int j = 1; j < curNumXs; j++)
40 | {
41 | curVal = curVal * xValue;
42 | }
43 | curVal = curVal * EquationCoefficients[i];
44 | curYValue += curVal;
45 | curNumXs++;
46 | }
47 | return curYValue;
48 | }
49 |
50 | public List EnumerateValues()
51 | {
52 | List returnData = new List();
53 | for (int i = 0; i < MaxX; i++)
54 | {
55 | returnData.Add(new Vector2(i, GetYValueFromXValue(i)));
56 | }
57 | return returnData;
58 | }
59 |
60 | public DelaysAndEquationCoefficients(List millisecondDelays, List equationCoefficients, double maxX, double maxY, List jumpDataPoints)
61 | {
62 | MillisecondDelays = millisecondDelays;
63 | EquationCoefficients = equationCoefficients;
64 | MaxX = maxX;
65 | MaxY = maxY;
66 | JumpDataPoints = jumpDataPoints;
67 | }
68 | }
69 |
70 | public class JumpInformation
71 | {
72 | public JumpTypes JumpType { get; set; }
73 |
74 | public List MillisecondDelaysToEquationCoefficients { get; set; }
75 |
76 | public JumpInformation(JumpTypes jumpType)
77 | {
78 | JumpType = jumpType;
79 | MillisecondDelaysToEquationCoefficients = new List();
80 | }
81 |
82 | public void AddToDelaysAndEquationCoefficients(Tuple, List, double, double, List> newData)
83 | {
84 | MillisecondDelaysToEquationCoefficients.Add(new DelaysAndEquationCoefficients(newData.Item1, newData.Item2, newData.Item3, newData.Item4, newData.Item5));
85 | }
86 | }
87 |
88 | public class JumpData
89 | {
90 | public static Dictionary JumpTypesToNumberOfPauses = new Dictionary()
91 | {
92 | { JumpTypes.ArrowJumpUpUp, 5 },
93 | { JumpTypes.ArrowJump, 1 },
94 | { JumpTypes.ArrowJumpJump, 3 },
95 | { JumpTypes.ArrowFlashJump, 1 },
96 | { JumpTypes.JumpDown, 3 }
97 | };
98 |
99 | public static List MilliDelays = new List() { 20, 50, 100 };
100 | // int is intercharacter delay
101 | //public Dictionary>, List> JumpTypeAndDelayToEquationCoefficients { get; set; }
102 | public List JumpInformationDataList;
103 |
104 |
105 | public JumpData()
106 | {
107 | JumpInformationDataList = new List();
108 | //JumpTypeAndDelayToEquationCoefficients = new Dictionary>, List>();
109 | }
110 |
111 | private enum GenerateEquationCoefficientsStatuses
112 | {
113 | Unstarted = 5,
114 | FindingInitialYMovement = 1,
115 | FindingYMovementStop = 2,
116 | Finished = 3
117 | }
118 |
119 | public static JumpData GenerateJumpData()
120 | {
121 | JumpData jumpDataData = new JumpData();
122 | foreach (var curJumpType in (JumpTypes[]) Enum.GetValues(typeof(JumpTypes)))
123 | {
124 | jumpDataData.JumpInformationDataList.Add(new JumpInformation(curJumpType));
125 | List, List, double, double, List>> equationCoefficientData = GenerateEquationCoefficientsForJumpType(curJumpType);
126 | foreach (var curEquationCoefficientData in equationCoefficientData)
127 | {
128 | jumpDataData.JumpInformationDataList.Last().AddToDelaysAndEquationCoefficients(curEquationCoefficientData);
129 | var x = jumpDataData.JumpInformationDataList.Last().MillisecondDelaysToEquationCoefficients.Last().EnumerateValues();
130 | //jumpDataData.JumpTypeAndDelayToEquationCoefficients[new Tuple>(curJumpType, curEquationCoefficientData.Item1)] = curEquationCoefficientData.Item2;
131 | }
132 | }
133 | return jumpDataData;
134 | }
135 |
136 | private static bool IncrementIterators(ref List iterators, int max)
137 | {
138 | iterators.Reverse();
139 | bool ableToIncrement = false;
140 | for (int i = 0; i < iterators.Count; i++)
141 | {
142 | if (iterators[i] == max)
143 | {
144 | continue;
145 | }
146 | for (int j = 0; j < i; j++)
147 | {
148 | iterators[j] = 0;
149 | }
150 | iterators[i]++;
151 | ableToIncrement = true;
152 | break;
153 | }
154 | iterators.Reverse();
155 | return ableToIncrement;
156 | }
157 |
158 | private static List, List, double, double, List>> GenerateEquationCoefficientsForJumpType(JumpTypes jumpType)
159 | {
160 | int numberOfDelays = JumpTypesToNumberOfPauses[jumpType];
161 | List curDelays = new List();
162 | var returnData = new List, List, double, double, List>>();
163 | double maxX, maxY;
164 | List jumpDataPoints;
165 | for (int i = 0; i < numberOfDelays; i++)
166 | {
167 | curDelays.Add(0);
168 | }
169 | do
170 | {
171 | var millisecondDelays = curDelays.Select(x => { return MilliDelays[x]; }).ToList();
172 | Console.WriteLine($"Generating equation coefficients for jump type [{jumpType.ToString()}] and iterators [{string.Join(", ", curDelays)}]");
173 | var equationCoefficients = GenerateEquationCoefficients(jumpType, millisecondDelays, out maxX, out maxY, out jumpDataPoints);
174 | if (equationCoefficients == null || equationCoefficients.Count == 0)
175 | {
176 | continue;
177 | }
178 | returnData.Add(new Tuple, List, double, double, List>(millisecondDelays, equationCoefficients, maxX, maxY, jumpDataPoints));
179 |
180 | }
181 | while (IncrementIterators(ref curDelays, MilliDelays.Count - 1));
182 | return returnData;
183 | }
184 |
185 | public static void TryToJump(JumpTypes jumpType, List millisecondDelays)
186 | {
187 | switch (jumpType)
188 | {
189 | case JumpTypes.ArrowFlashJump:
190 | Input.StartInput('e');
191 | Thread.Sleep(millisecondDelays[0]);
192 | Input.StopInput('e');
193 | break;
194 | case JumpTypes.ArrowJump:
195 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
196 | Thread.Sleep(millisecondDelays[0]);
197 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
198 | break;
199 | case JumpTypes.ArrowJumpJump:
200 |
201 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
202 | Thread.Sleep(millisecondDelays[0]);
203 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
204 | Thread.Sleep(millisecondDelays[1]);
205 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
206 | Thread.Sleep(millisecondDelays[2]);
207 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
208 | break;
209 | case JumpTypes.ArrowJumpUpUp:
210 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
211 | Thread.Sleep(millisecondDelays[0]);
212 | Input.StartInput(Input.SpecialCharacters.KEY_UP_ARROW);
213 | Thread.Sleep(millisecondDelays[1]);
214 | Input.StopInput(Input.SpecialCharacters.KEY_UP_ARROW);
215 | Thread.Sleep(millisecondDelays[2]);
216 | Input.StartInput(Input.SpecialCharacters.KEY_UP_ARROW);
217 | Thread.Sleep(millisecondDelays[3]);
218 | Input.StopInput(Input.SpecialCharacters.KEY_UP_ARROW);
219 | Thread.Sleep(millisecondDelays[4]);
220 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
221 | break;
222 | case JumpTypes.JumpDown:
223 | Input.StartInput(Input.SpecialCharacters.KEY_DOWN_ARROW);
224 | Thread.Sleep(millisecondDelays[0]);
225 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
226 | Thread.Sleep(millisecondDelays[1]);
227 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
228 | Thread.Sleep(millisecondDelays[2]);
229 | Input.StopInput(Input.SpecialCharacters.KEY_DOWN_ARROW);
230 | break;
231 | }
232 | }
233 |
234 | private static List GenerateEquationCoefficients(JumpTypes jumpType, List millisecondDelays, out double maxX, out double maxY, out List jumpDataPoints)
235 | {
236 | maxX = 0;
237 | maxY = 0;
238 | PhotoTaker.StartTakingImages(75);
239 | Thread.Sleep(100);
240 | Input.StartInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
241 | TryToJump(jumpType, millisecondDelays);
242 | Thread.Sleep(2000);
243 | Input.StopInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
244 | PhotoTaker.StopTakingImages();
245 | var photosWithTimestampDataList = PhotoTaker.GetPhotosAndDeleteFromMemory();
246 | Vector2 previous = null;
247 | jumpDataPoints = null;
248 | Vector2 beginning = null;
249 | List dataPoints = null;
250 | GenerateEquationCoefficientsStatuses status = GenerateEquationCoefficientsStatuses.Unstarted;
251 | var playerImage = Imaging.GetImageFromFile(Imaging.ImageFiles.PlayerMiniMap);
252 | foreach (var curPhoto in photosWithTimestampDataList)
253 | {
254 | var curMinimap = Imaging.CropImage(curPhoto.Photo, Imaging.MiniMapRect);
255 | if (!Imaging.FindBitmap(new List() { playerImage }, curMinimap, out List locations))
256 | {
257 | continue;
258 | }
259 | Vector2 cur = locations[0];
260 | switch (status)
261 | {
262 | case GenerateEquationCoefficientsStatuses.Unstarted:
263 | beginning = cur;
264 | status = GenerateEquationCoefficientsStatuses.FindingInitialYMovement;
265 | break;
266 | case GenerateEquationCoefficientsStatuses.FindingInitialYMovement:
267 | previous = cur;
268 | if (cur.Y == beginning.Y && cur.X == beginning.X)
269 | {
270 | continue;
271 | }
272 | dataPoints = new List() { previous, cur };
273 | status = GenerateEquationCoefficientsStatuses.FindingYMovementStop;
274 | break;
275 | case GenerateEquationCoefficientsStatuses.FindingYMovementStop:
276 |
277 | if (cur.Y == dataPoints[0].Y)
278 | {
279 | status = GenerateEquationCoefficientsStatuses.Finished;
280 | }
281 | else
282 | {
283 | dataPoints.Add(cur);
284 | }
285 | previous = cur;
286 | break;
287 | }
288 | if (status == GenerateEquationCoefficientsStatuses.Finished)
289 | {
290 | break;
291 | }
292 | }
293 | photosWithTimestampDataList.Clear();
294 | // attempt to reset location
295 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ARROW);
296 | Thread.Sleep(3000);
297 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ARROW);
298 | Thread.Sleep(100);
299 | Input.StartInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
300 | //TryToJump(jumpType, millisecondDelays);
301 | Thread.Sleep(100);
302 | Input.StopInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
303 | if (dataPoints == null || dataPoints.Count == 0)
304 | {
305 | return new List();
306 | }
307 | var originalDataPoint = dataPoints[0];
308 | // normalize
309 | dataPoints = dataPoints.Select(x => { return new Vector2(x.X - originalDataPoint.X, x.Y - originalDataPoint.Y); }).ToList();
310 | if (!dataPoints.Where(x => x.Y > 0).Any())
311 | {
312 | return new List();
313 | }
314 | maxX = dataPoints.Select(x => x.X).Max();
315 | maxY = dataPoints.Select(x => x.Y).Max();
316 | jumpDataPoints = dataPoints;
317 | return MapleMath.PolynomialRegressionCoefficients(dataPoints);
318 | }
319 | }
320 | }
321 |
--------------------------------------------------------------------------------
/Maple/Data/MapleMath.cs:
--------------------------------------------------------------------------------
1 | using Accord.Math;
2 | using Accord.Math.Optimization.Losses;
3 | using Accord.Statistics.Models.Regression.Linear;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 |
10 | namespace Maple.Data
11 | {
12 | public class Vector2
13 | {
14 | public double X;
15 | public double Y;
16 | public Vector2(double x, double y)
17 | {
18 | X = x;
19 | Y = y;
20 | }
21 | }
22 |
23 | public class MapleMath
24 | {
25 | public struct Line
26 | {
27 | public double x1 { get; set; }
28 | public double y1 { get; set; }
29 |
30 | public double x2 { get; set; }
31 | public double y2 { get; set; }
32 |
33 | public Line(Vector2 begin, Vector2 end)
34 | {
35 | x1 = begin.X;
36 | x2 = end.X;
37 | y1 = begin.Y;
38 | y2 = end.Y;
39 | }
40 | }
41 |
42 | public class LineIntersection
43 | {
44 | // Returns Point of intersection if do intersect otherwise default Point (null)
45 | public static bool FindIntersection(Line lineA, Line lineB, out Vector2 intersection, double tolerance = 0.001)
46 | {
47 | intersection = null;
48 | double x1 = lineA.x1, y1 = lineA.y1;
49 | double x2 = lineA.x2, y2 = lineA.y2;
50 |
51 | double x3 = lineB.x1, y3 = lineB.y1;
52 | double x4 = lineB.x2, y4 = lineB.y2;
53 |
54 | // equations of the form x = c (two vertical lines)
55 | if (Math.Abs(x1 - x2) < tolerance && Math.Abs(x3 - x4) < tolerance && Math.Abs(x1 - x3) < tolerance)
56 | {
57 | // Both lines overlap vertically, ambiguous intersection points.
58 | return false;
59 | }
60 |
61 | //equations of the form y=c (two horizontal lines)
62 | if (Math.Abs(y1 - y2) < tolerance && Math.Abs(y3 - y4) < tolerance && Math.Abs(y1 - y3) < tolerance)
63 | {
64 | // Both lines overlap horizontally, ambiguous intersection points.
65 | return false;
66 | }
67 |
68 | //equations of the form x=c (two vertical parallel lines)
69 | if (Math.Abs(x1 - x2) < tolerance && Math.Abs(x3 - x4) < tolerance)
70 | {
71 | //return default (no intersection)
72 | return false;
73 | }
74 |
75 | //equations of the form y=c (two horizontal parallel lines)
76 | if (Math.Abs(y1 - y2) < tolerance && Math.Abs(y3 - y4) < tolerance)
77 | {
78 | //return default (no intersection)
79 | return false;
80 | }
81 |
82 | //general equation of line is y = mx + c where m is the slope
83 | //assume equation of line 1 as y1 = m1x1 + c1
84 | //=> -m1x1 + y1 = c1 ----(1)
85 | //assume equation of line 2 as y2 = m2x2 + c2
86 | //=> -m2x2 + y2 = c2 -----(2)
87 | //if line 1 and 2 intersect then x1=x2=x & y1=y2=y where (x,y) is the intersection point
88 | //so we will get below two equations
89 | //-m1x + y = c1 --------(3)
90 | //-m2x + y = c2 --------(4)
91 |
92 | double x, y;
93 |
94 | //lineA is vertical x1 = x2
95 | //slope will be infinity
96 | //so lets derive another solution
97 | if (Math.Abs(x1 - x2) < tolerance)
98 | {
99 | //compute slope of line 2 (m2) and c2
100 | double m2 = (y4 - y3) / (x4 - x3);
101 | double c2 = -m2 * x3 + y3;
102 |
103 | //equation of vertical line is x = c
104 | //if line 1 and 2 intersect then x1=c1=x
105 | //subsitute x=x1 in (4) => -m2x1 + y = c2
106 | // => y = c2 + m2x1
107 | x = x1;
108 | y = c2 + m2 * x1;
109 | }
110 | //lineB is vertical x3 = x4
111 | //slope will be infinity
112 | //so lets derive another solution
113 | else if (Math.Abs(x3 - x4) < tolerance)
114 | {
115 | //compute slope of line 1 (m1) and c2
116 | double m1 = (y2 - y1) / (x2 - x1);
117 | double c1 = -m1 * x1 + y1;
118 |
119 | //equation of vertical line is x = c
120 | //if line 1 and 2 intersect then x3=c3=x
121 | //subsitute x=x3 in (3) => -m1x3 + y = c1
122 | // => y = c1 + m1x3
123 | x = x3;
124 | y = c1 + m1 * x3;
125 | }
126 | //lineA & lineB are not vertical
127 | //(could be horizontal we can handle it with slope = 0)
128 | else
129 | {
130 | //compute slope of line 1 (m1) and c2
131 | double m1 = (y2 - y1) / (x2 - x1);
132 | double c1 = -m1 * x1 + y1;
133 |
134 | //compute slope of line 2 (m2) and c2
135 | double m2 = (y4 - y3) / (x4 - x3);
136 | double c2 = -m2 * x3 + y3;
137 |
138 | //solving equations (3) & (4) => x = (c1-c2)/(m2-m1)
139 | //plugging x value in equation (4) => y = c2 + m2 * x
140 | x = (c1 - c2) / (m2 - m1);
141 | y = c2 + m2 * x;
142 |
143 | //verify by plugging intersection point (x, y)
144 | //in orginal equations (1) & (2) to see if they intersect
145 | //otherwise x,y values will not be finite and will fail this check
146 | if (!(Math.Abs(-m1 * x + y - c1) < tolerance
147 | && Math.Abs(-m2 * x + y - c2) < tolerance))
148 | {
149 | //return default (no intersection)
150 | return false;
151 | }
152 | }
153 |
154 | //x,y can intersect outside the line segment since line is infinitely long
155 | //so finally check if x, y is within both the line segments
156 | if (IsInsideLine(lineA, x, y) &&
157 | IsInsideLine(lineB, x, y))
158 | {
159 | intersection = new Vector2(x, y);
160 | return true;
161 | }
162 |
163 | //return default (no intersection)
164 | return false;
165 |
166 | }
167 |
168 | // Returns true if given point(x,y) is inside the given line segment
169 | private static bool IsInsideLine(Line line, double x, double y)
170 | {
171 | return (x >= line.x1 && x <= line.x2
172 | || x >= line.x2 && x <= line.x1)
173 | && (y >= line.y1 && y <= line.y2
174 | || y >= line.y2 && y <= line.y1);
175 | }
176 | }
177 |
178 | internal class PolynomialRegressionData
179 | {
180 | private PolynomialRegression poly;
181 | public PolynomialRegressionData(List pointData, int maxDegree = 100)
182 | {
183 | double[] inputs = pointData.Select(x => (double)x.X).ToArray();
184 | double[] outputs = pointData.Select(x => (double)x.Y).ToArray();
185 | poly = null;
186 | double[] pred;
187 | int degree = 1;
188 | double error = 0.0;
189 | do
190 | {
191 | var ls = new PolynomialLeastSquares()
192 | {
193 | Degree = degree++
194 | };
195 | try
196 | {
197 | poly = ls.Learn(inputs, outputs);
198 | }
199 | catch (Exception ex)
200 | {
201 | continue;
202 | }
203 | //string str = poly.ToString("N1");
204 | //double[] weights = poly.Weights;
205 | //double intercept = poly.Intercept;
206 |
207 | // Finally, we can use this polynomial
208 | // to predict values for the input data
209 | pred = poly.Transform(inputs);
210 | error = new SquareLoss(outputs).Loss(pred); // 0.0
211 | if (degree > maxDegree)
212 | {
213 | return;
214 | }
215 | } while (error > 0.0001);
216 | }
217 |
218 | public List PredictData(List xValues)
219 | {
220 | // We can create a learning algorithm
221 | //var xVals = Enumerable.Range((int)inputs[0], (int)(inputs[inputs.Length - 1] - inputs[0]));
222 | double[] pred = poly.Transform(xValues.Select(Convert.ToDouble).ToArray());
223 | List returnData = new List();
224 | for (int i = 0; i < pred.Length; i++)
225 | {
226 | returnData.Add(new Vector2((int)xValues.ElementAt(i), (int)pred[i]));
227 | }
228 | return returnData;
229 | }
230 |
231 | public List GetCoefficients()
232 | {
233 | if (poly == null || poly.Weights == null)
234 | {
235 | return new List();
236 | }
237 | List coefficients = poly.Weights.ToList();
238 | coefficients.Add(poly.Intercept);
239 | return coefficients;
240 | }
241 | }
242 |
243 | public static List FindRoute(MapData map, MapPiece sourceNode, MapPiece destinationNode)
244 | {
245 | List path = new List();
246 | path.Add(sourceNode);
247 |
248 | MapPiece currentNode = sourceNode;
249 | while (true)
250 | {
251 | //get all neighbors of current-node (nodes within transmission range)
252 | List allNeighbors = currentNode.MapPieceLinkDataList.Select(x => x.JoiningMapPiece).ToList();
253 |
254 | //remove neighbors that are already added to path
255 | IEnumerable neighbors = from neighbor in allNeighbors
256 | where !path.Contains(neighbor)
257 | select neighbor;
258 |
259 | //stop if no neighbors or destination reached
260 | if (neighbors.Count() == 0) break;
261 | if (neighbors.Contains(destinationNode))
262 | {
263 | path.Add(destinationNode);
264 | break;
265 | }
266 |
267 | //choose next-node (the neighbor with shortest distance to destination)
268 | double bestMinDist = double.MaxValue;
269 | MapPiece nearestNode = null;
270 | foreach (var curNeighbor in neighbors)
271 | {
272 | var curMapPieceLink = curNeighbor.MapPieceLinkDataList.Where(x => x.JoiningMapPiece.Beginning.X == destinationNode.Beginning.X && x.JoiningMapPiece.Beginning.Y == destinationNode.Beginning.Y).FirstOrDefault();
273 | if (curMapPieceLink == null)
274 | {
275 | continue;
276 | }
277 | var curMinDist = curMapPieceLink.MinimumDistance;
278 | if (curMinDist < bestMinDist)
279 | {
280 | bestMinDist = curMinDist;
281 | nearestNode = curNeighbor;
282 | }
283 | }
284 | if (nearestNode == null)
285 | {
286 | nearestNode = neighbors.OrderBy(x => MapleMath.PixelCoordinateDistance(x.Beginning, destinationNode.Beginning)).First(); // todo this isnt good
287 | }
288 | path.Add(nearestNode);
289 | currentNode = nearestNode;
290 | }
291 |
292 | return (path);
293 | }
294 |
295 | /*public static Vector2 CorrectImageHeight(Vector2 pixelCoordinate, int imageHeight)
296 | {
297 | return new Vector2(pixelCoordinate.X, Math.Abs(pixelCoordinate.Y - imageHeight));
298 | }*/
299 |
300 | public static int PixelCoordinateToPixel(Vector2 pixelLocation, int imageWidth)
301 | {
302 | return (int)(pixelLocation.Y * imageWidth + pixelLocation.X);
303 | }
304 |
305 | public static double PixelCoordinateDistance(Vector2 pixelCoordinate1, Vector2 pixelCoordinate2)
306 | {
307 | return Math.Sqrt(Math.Pow(pixelCoordinate2.X - pixelCoordinate1.X, 2) + Math.Pow(pixelCoordinate2.Y - pixelCoordinate1.Y, 2));
308 | }
309 |
310 | public static Vector2 MapCoordinatesToMiniMapCoordinates(Vector2 mapCoordinates, Vector2 playerScreenLocation, Vector2 playerMinimapLocation)
311 | {
312 | double mapCoordinatesChangeX = (mapCoordinates.X - playerScreenLocation.X) * MapData.MinimapToPixelRatio;
313 | double mapCoordinatesChangeY = (mapCoordinates.Y - playerScreenLocation.Y) * MapData.MinimapToPixelRatio;
314 | return new Vector2((int)(playerMinimapLocation.X + mapCoordinatesChangeX), (int)(playerMinimapLocation.Y + mapCoordinatesChangeY));
315 | }
316 |
317 | public static bool LocationWithinBounds(Vector2 locationToCheck, Vector2 minLocation, Vector2 maxLocation)
318 | {
319 | return (locationToCheck.X >= minLocation.X && locationToCheck.X <= maxLocation.X
320 | && locationToCheck.Y >= minLocation.Y && locationToCheck.Y <= maxLocation.Y);
321 | }
322 |
323 | public static Vector2 GetAverage(List coordinateDataList)
324 | {
325 | double totalX = 0;
326 | double totalY = 0;
327 | foreach (var curCoordinate in coordinateDataList)
328 | {
329 | totalX += curCoordinate.X;
330 | totalY += curCoordinate.Y;
331 | }
332 | return new Vector2(totalX / coordinateDataList.Count, totalY / coordinateDataList.Count);
333 | }
334 |
335 | public static List PolynomialRegressionCoefficients(List pointData)
336 | {
337 | PolynomialRegressionData poly = new PolynomialRegressionData(pointData);
338 | return poly.GetCoefficients();
339 | }
340 |
341 | public static List PolynomialLeastSquares(List pointData)
342 | {
343 | PolynomialRegressionData poly = new PolynomialRegressionData(pointData);
344 | var xVals = Enumerable.Range((int)pointData[0].X, (int)(pointData[pointData.Count - 1].X - pointData[0].X));
345 | return poly.PredictData(xVals.ToList());
346 | }
347 |
348 | }
349 | }
350 |
--------------------------------------------------------------------------------
/Maple/Data/MapleSerialPort.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.IO.Ports;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace Maple.Data
10 | {
11 | public class MapleSerialPort
12 | {
13 | private SerialPort ArduinoPortData;
14 | private string _portName;
15 | public MapleSerialPort(string portName, string comNumber)
16 | {
17 | ArduinoPortData = new SerialPort(comNumber, 9600);
18 | ArduinoPortData.RtsEnable = true;
19 | ArduinoPortData.Open();
20 | _portName = portName;
21 | //ArduinoPortData.DataReceived += ArduinoDataReceived;
22 | ReadThread = new Thread(Read) { Name = "Maple Serial Port REad Thread" };
23 | ReadThread.Start();
24 | }
25 |
26 | Thread ReadThread;
27 |
28 | private void Read()
29 | {
30 | while (true)
31 | {
32 | string s = ArduinoPortData.ReadExisting();
33 | if (s.Length > 0)
34 | {
35 | //Console.WriteLine($"Data Received from {_portName} [{s}]");
36 | }
37 | Thread.Sleep(100);
38 | }
39 | }
40 |
41 | public void SendData(string message)
42 | {
43 | ArduinoPortData.RtsEnable = false;
44 | char endString = '#';
45 | ArduinoPortData.Write($"{message} {endString}");
46 | ArduinoPortData.RtsEnable = true;
47 | }
48 |
49 | ~MapleSerialPort()
50 | {
51 | ReadThread.Join();
52 | ArduinoPortData.Close();
53 | }
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/Maple/Data/MobData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | namespace Maple.Data
8 | {
9 | public class MobCluster
10 | {
11 | public List Locations;
12 |
13 | public Vector2 Center
14 | {
15 | get { return MapleMath.GetAverage(Locations); }
16 | }
17 |
18 | public MobCluster(Vector2 location)
19 | {
20 | Locations = new List() { location };
21 | }
22 |
23 | public MobCluster()
24 | {
25 | Locations = new List();
26 | }
27 |
28 | public void AddHit(Vector2 newLocation)
29 | {
30 | Locations.Add(newLocation);
31 | }
32 |
33 | public static List FindMobClustersFromPixelData(List mobLocations, int imageWidth, int imageHeight, int maxVerticalClusterDistance = 100, int maxHorizontalClusterDistance = 300)
34 | {
35 | List mobClusters = new List();
36 | foreach (var curMobLocation in mobLocations)
37 | {
38 | var curCoordinate = curMobLocation;
39 | bool added = false;
40 | foreach (var curMobCluster in mobClusters)
41 | {
42 | double verticalDistance = Math.Abs(curCoordinate.Y - curMobCluster.Center.Y);
43 | double horizontalDistance = Math.Abs(curCoordinate.X - curMobCluster.Center.X);
44 | //double distance = MapleMath.PixelCoordinateDistance(curCoordinate, curMobCluster.Center);
45 | if (verticalDistance < maxVerticalClusterDistance
46 | && horizontalDistance < maxHorizontalClusterDistance)
47 | {
48 | curMobCluster.AddHit(curCoordinate);
49 | added = true;
50 | break;
51 | }
52 | }
53 | if (!added)
54 | {
55 | mobClusters.Add(new MobCluster(curCoordinate));
56 | }
57 | }
58 | return mobClusters;
59 | }
60 | }
61 |
62 | public enum MobNames
63 | {
64 | BlueRaspberryJellyJuice,
65 | EnragedEspressoMachine
66 | }
67 |
68 | public class MobData
69 | {
70 | public static Dictionary> MobNamesToImagingFiles = new Dictionary>()
71 | {
72 | { MobNames.BlueRaspberryJellyJuice, new List()
73 | {
74 | Imaging.ImageFiles.BlueRaspberryJellyJuiceLeft,
75 | Imaging.ImageFiles.BlueRaspberryJellyJuiceRight
76 | }
77 | },
78 | { MobNames.EnragedEspressoMachine, new List()
79 | {
80 | Imaging.ImageFiles.BlueEspressoMachineLeft,
81 | Imaging.ImageFiles.BlueEspressoMachineRight
82 | }
83 | },
84 | };
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/Maple/Data/SkillData.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading;
6 | using System.Threading.Tasks;
7 |
8 | namespace Maple.Data
9 | {
10 | public class SkillData
11 | {
12 | public string SkillName { get; set; }
13 | public int DiscrepencyTimeMillis { get; set; }
14 | private int _currentDiscrepencyTimeMillis;
15 | public int HoldMillis { get; set; }
16 | public int HoldDiscrepencyTimeMillis { get; set; }
17 |
18 | public char Key { get; set; }
19 | public int RefreshMillis { get; set; }
20 | public bool UseOnLogin { get; set; }
21 | public static Random rand = new Random();
22 | public DateTime NextUseTime
23 | {
24 | get { return LastUseTime + new TimeSpan(0, 0, 0, 0, RefreshMillis + _currentDiscrepencyTimeMillis); }
25 | }
26 |
27 | public DateTime LastUseTime;
28 |
29 | public void UseSkill()
30 | {
31 | Input.StartInput(Key);
32 | Thread.Sleep(HoldMillis);
33 | Input.StopInput(Key);
34 | _currentDiscrepencyTimeMillis = rand.Next(DiscrepencyTimeMillis);
35 | LastUseTime = DateTime.Now;
36 | }
37 |
38 | public SkillData()
39 | {
40 |
41 |
42 |
43 | LastUseTime = DateTime.Now;
44 |
45 | }
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/Maple/Images/BlueEspressoMachineLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/BlueEspressoMachineLeft.png
--------------------------------------------------------------------------------
/Maple/Images/BlueEspressoMachineRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/BlueEspressoMachineRight.png
--------------------------------------------------------------------------------
/Maple/Images/BlueRaspberryJellyJuiceLeft.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/BlueRaspberryJellyJuiceLeft.png
--------------------------------------------------------------------------------
/Maple/Images/BlueRaspberryJellyJuiceRight.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/BlueRaspberryJellyJuiceRight.png
--------------------------------------------------------------------------------
/Maple/Images/ChangeChannel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/ChangeChannel.png
--------------------------------------------------------------------------------
/Maple/Images/CharacterSelectionCharacterSlot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/CharacterSelectionCharacterSlot.png
--------------------------------------------------------------------------------
/Maple/Images/ClaimReward.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/ClaimReward.png
--------------------------------------------------------------------------------
/Maple/Images/ContentGuide.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/ContentGuide.png
--------------------------------------------------------------------------------
/Maple/Images/DemonAvengerName.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/DemonAvengerName.png
--------------------------------------------------------------------------------
/Maple/Images/FullHealthBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/FullHealthBar.png
--------------------------------------------------------------------------------
/Maple/Images/HP.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/HP.png
--------------------------------------------------------------------------------
/Maple/Images/HealthBarDropping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/HealthBarDropping.png
--------------------------------------------------------------------------------
/Maple/Images/HealthBarEmpty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/HealthBarEmpty.png
--------------------------------------------------------------------------------
/Maple/Images/LeftHealthBar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/LeftHealthBar.png
--------------------------------------------------------------------------------
/Maple/Images/OtherPlayerMiniMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/OtherPlayerMiniMap.png
--------------------------------------------------------------------------------
/Maple/Images/OverheadQuest.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/OverheadQuest.png
--------------------------------------------------------------------------------
/Maple/Images/PlayerMiniMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/PlayerMiniMap.png
--------------------------------------------------------------------------------
/Maple/Images/RebootServer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/RebootServer.png
--------------------------------------------------------------------------------
/Maple/Images/RebootServerChannelSelect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/RebootServerChannelSelect.png
--------------------------------------------------------------------------------
/Maple/Images/Rune.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/Rune.png
--------------------------------------------------------------------------------
/Maple/Images/RuneMiniMap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/RuneMiniMap.png
--------------------------------------------------------------------------------
/Maple/Images/TheNextLegendTitle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/TheNextLegendTitle.png
--------------------------------------------------------------------------------
/Maple/Images/badguy1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/badguy1.png
--------------------------------------------------------------------------------
/Maple/Images/map1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/map1.png
--------------------------------------------------------------------------------
/Maple/Images/runetest1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/runetest1.png
--------------------------------------------------------------------------------
/Maple/Images/runetest2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/runetest2.png
--------------------------------------------------------------------------------
/Maple/Images/runetest3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/runetest3.png
--------------------------------------------------------------------------------
/Maple/Images/runetest4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/runetest4.png
--------------------------------------------------------------------------------
/Maple/Images/runetest5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/Images/runetest5.png
--------------------------------------------------------------------------------
/Maple/MainWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Maple/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | //using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Drawing;
16 | using System.Runtime.InteropServices;
17 | using System.Windows.Interop;
18 | using System.Windows.Forms;
19 | using System.Windows.Threading;
20 | using System.Threading;
21 | using System.Drawing.Drawing2D;
22 | using System.Drawing.Text;
23 | using IronOcr;
24 | using System.IO;
25 | using Maple.Data;
26 | using Maple.ViewModels;
27 | using System.ComponentModel;
28 | using System.Configuration;
29 | using Newtonsoft.Json;
30 |
31 | namespace Maple
32 | {
33 |
34 |
35 |
36 | ///
37 | /// Interaction logic for MainWindow.xaml
38 | ///
39 | public partial class MainWindow : Window
40 | {
41 | void DataWindow_Closing(object sender, CancelEventArgs e)
42 | {
43 | ModelData.IsClosing = true;
44 | }
45 |
46 | MainWindowViewModel ModelData
47 | {
48 | get { return DataContext as MainWindowViewModel; }
49 | }
50 |
51 | private void CameraUpdate()
52 | {
53 | List enemyImages = new List()
54 | {
55 | /*Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueEspressoMachineLeft),
56 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueEspressoMachineRight),
57 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueRaspberryJellyJuiceLeft),
58 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueRaspberryJellyJuiceRight)*/
59 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.TheNextLegendTitle)
60 | };
61 | //path = Path.Combine(Environment.CurrentDirectory, "..\\..\\Images\\BlueRaspberryJellyJuiceRight.png");
62 | //Bitmap enemy2 = new Bitmap(path);
63 |
64 | var runeData = Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.runetest3);
65 | // 730, 180, 370, 50
66 |
67 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(730, 180, 92, 50));
68 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(822, 180, 92, 50));
69 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(914, 180, 92, 50));
70 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1006, 180, 92, 50));
71 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1098, 180, 92, 50));
72 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1190, 180, 92, 50));
73 |
74 | bool isClosing = false;
75 | bool isActive = false;
76 | //Bitmap croppedImage = CropImage(src, new Rectangle(0, 0, 350, 200));
77 | while (!isClosing)
78 | {
79 | try
80 | {
81 | this.Dispatcher.Invoke(() =>
82 | {
83 | isClosing = ModelData.IsClosing;
84 | isActive = ModelData.IsActive;
85 | });
86 | }
87 | catch (Exception ex)
88 | {
89 | break;
90 | }
91 | Thread.Sleep(100);
92 | if (!isActive)
93 | {
94 |
95 | continue;
96 | }
97 | if (isClosing)
98 | {
99 | return;
100 | }
101 | Bitmap croppedImage;
102 | /*if (!Data.Imaging.GetCurrentGameScreen(out croppedImage))
103 | {
104 | continue;
105 | }*/
106 | croppedImage = RuneTestData;
107 | //Bitmap croppedImage = Data.Imaging.CropImage(src, new Rectangle(730, 180, 92, 50));
108 |
109 | Graphics g = Graphics.FromImage(croppedImage);
110 | g.SmoothingMode = SmoothingMode.AntiAlias;
111 | g.InterpolationMode = InterpolationMode.HighQualityBicubic;
112 | g.PixelOffsetMode = PixelOffsetMode.HighQuality;
113 | g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
114 | // Create string formatting options (used for alignment)
115 | StringFormat format = new StringFormat()
116 | {
117 | Alignment = StringAlignment.Center,
118 | LineAlignment = StringAlignment.Center
119 | };
120 | var cursorPosition = System.Windows.Forms.Cursor.Position;
121 | // Draw the text onto the image
122 | //g.DrawString($"x: {xVal} y: {yVal}\n x: {cursorPosition.X} y: {cursorPosition.Y}", new Font("Arial", 18), Brushes.Red, new RectangleF(0, 0, croppedImage.Width, croppedImage.Height), format);
123 | /*if (Maple.Data.Imaging.FindBitmap(enemyImages, croppedImage, out List locations, ImageFindTypes.Traditional))
124 | {
125 | //List mobClusterData = MobCluster.FindMobClustersFromPixelData(locations, croppedImage.Width, croppedImage.Height);
126 | //var curMobCluster = mobClusterData.OrderByDescending(x => x.Locations.Count()).Take(1);
127 | //g.DrawRectangle(new Pen(Color.Red, 10), new Rectangle(curMobCluster.Center.X - 10, curMobCluster.Center.Y - 10, 4 + 20, 6 + 20));
128 | locations = locations.Select(x => { return new Vector2(x.X, Math.Abs(x.Y - croppedImage.Height)); }).ToList();
129 | foreach (var curLocation in locations)
130 | {
131 | //Input.SetMouseLocation(MapleMath.PixelToPixelCoordinate(curLocation, croppedImage.Width));
132 | g.DrawRectangle(new Pen(Color.Red, 10), new Rectangle((int)(curLocation.X) + 50, (int)curLocation.Y - 50, 4 + 20, 6 + 20));
133 | }
134 |
135 | }*/
136 | foreach (var curLocation in imageLocations)
137 | {
138 | g.DrawRectangle(new Pen(Color.Red, 10), new Rectangle((int)(curLocation.X) - 10, (int)curLocation.Y - 10, 4 + 20, 6 + 20));
139 | }
140 | /*var results = new IronTesseract().Read(croppedImage);*/
141 | // Flush all graphics changes to the bitmap
142 | g.Flush();
143 | try
144 | {
145 | this.Dispatcher.Invoke(() =>
146 | {
147 | ImageBrushData.ImageSource = Data.Imaging.ImageSourceFromBitmap(croppedImage);
148 | });
149 | }
150 | catch (Exception ex)
151 | {
152 | continue;
153 | }
154 |
155 |
156 | //bitmap.Save("test.jpg", ImageFormat.Jpeg);
157 | }
158 | }
159 |
160 | Thread CameraUpdateThread;
161 | Bitmap RuneTestData = null;
162 | List imageLocations = new List();
163 | public MainWindow()
164 | {
165 | InitializeComponent();
166 | DataContext = new MainWindowViewModel();
167 | CameraUpdateThread = new Thread(CameraUpdate) { Name = "Main Window Camera Update Thread" };
168 | CameraUpdateThread.Start();
169 | var runeTestData = Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.runetest2);
170 | //runeTestData = Data.Imaging.CropImage(runeTestData, new Rectangle(100, 0, runeTestData.Width - 200, 400));
171 |
172 | RuneTestData = runeTestData;
173 | Data.Imaging.SolveRune(runeTestData, out List chars, out imageLocations);
174 | Console.WriteLine(string.Join(", ", chars.Select(x => x.ToString())));
175 | Input.InitializeInputs();
176 | var mapImage = Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.map1);
177 | var badguyImage = Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.badguy1);
178 | var hpImage = Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.ChangeChannel);
179 | //SURFFeatureExample.Program.MatchPicBySurf(mapImage, new List() { hpImage, badguyImage });
180 | //SURFFeatureExample.Program.MatchPicByBF(mapImage, new List() { badguyImage });
181 | //Data.Imaging.GetCurrentGameScreen(out Bitmap curGameScreen);
182 | //var curPoint = SURFFeatureExample.Program.FindPicFromImage(curGameScreen, hpImage);
183 | //Input.SetMouseLocation(new Vector2(curPoint.X, curPoint.Y));
184 | //Input.StartInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
185 | //Input.StopInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
186 |
187 | //ImageBrushData.ImageSource = ImageSourceFromBitmap(CropImage(src, cropRect));
188 | /*using (Graphics g = Graphics.FromImage(src))
189 | {
190 | g.DrawImage(src, new Rectangle(0, 0, target.Width, target.Height), cropRect, GraphicsUnit.Pixel);
191 |
192 | }*/
193 | }
194 | }
195 | }
196 |
--------------------------------------------------------------------------------
/Maple/Maple.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Debug
7 | AnyCPU
8 | {4323BFC3-33BD-4478-A364-FAAC2BE09F74}
9 | WinExe
10 | Maple
11 | Maple
12 | v4.7.2
13 | 512
14 | {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
15 | 4
16 | true
17 | true
18 |
19 |
20 |
21 |
22 |
23 | AnyCPU
24 | true
25 | full
26 | false
27 | bin\Debug\
28 | DEBUG;TRACE
29 | prompt
30 | 4
31 | true
32 |
33 |
34 | AnyCPU
35 | pdbonly
36 | true
37 | bin\Release\
38 | TRACE
39 | prompt
40 | 4
41 | true
42 |
43 |
44 |
45 | ..\packages\Accord.3.8.0\lib\net462\Accord.dll
46 |
47 |
48 | ..\packages\Accord.Math.3.8.0\lib\net462\Accord.Math.dll
49 |
50 |
51 | ..\packages\Accord.Math.3.8.0\lib\net462\Accord.Math.Core.dll
52 |
53 |
54 | ..\packages\Accord.Statistics.3.8.0\lib\net462\Accord.Statistics.dll
55 |
56 |
57 | ..\packages\Google.Protobuf.3.15.2\lib\net45\Google.Protobuf.dll
58 |
59 |
60 | ..\packages\IronOcr.2021.6.0\lib\net40\IronOcr.dll
61 |
62 |
63 | ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll
64 |
65 |
66 | ..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net461\OpenCvSharp.dll
67 |
68 |
69 | ..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net461\OpenCvSharp.Blob.dll
70 |
71 |
72 | ..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net461\OpenCvSharp.Extensions.dll
73 |
74 |
75 | ..\packages\OpenCvSharp3-AnyCPU.4.0.0.20181129\lib\net461\OpenCvSharp.UserInterface.dll
76 |
77 |
78 | ..\packages\OpenTK.1.1.2225.0\lib\net20\OpenTK.dll
79 |
80 |
81 | ..\packages\OpenTK.GLControl.1.1.2225.0\lib\net20\OpenTK.GLControl.dll
82 |
83 |
84 |
85 | ..\packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll
86 |
87 |
88 |
89 |
90 |
91 |
92 | ..\packages\System.Drawing.Common.5.0.2\lib\net461\System.Drawing.Common.dll
93 |
94 |
95 | ..\packages\System.Drawing.Primitives.4.3.0\lib\net45\System.Drawing.Primitives.dll
96 | True
97 | True
98 |
99 |
100 | ..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll
101 |
102 |
103 |
104 | ..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll
105 |
106 |
107 | ..\packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll
108 | True
109 | True
110 |
111 |
112 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll
113 |
114 |
115 | ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll
116 | True
117 | True
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 | 4.0
128 |
129 |
130 |
131 |
132 |
133 | ..\packages\ZedGraph.5.1.5\lib\ZedGraph.dll
134 |
135 |
136 |
137 |
138 | MSBuild:Compile
139 | Designer
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 | GamePlayer.xaml
156 |
157 |
158 | JobEdit.xaml
159 |
160 |
161 | JobsWindow.xaml
162 |
163 |
164 | MapCreator.xaml
165 |
166 |
167 | SkillEdit.xaml
168 |
169 |
170 | StatisticsViewer.xaml
171 |
172 |
173 | MSBuild:Compile
174 | Designer
175 |
176 |
177 | App.xaml
178 | Code
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 | MainWindow.xaml
189 | Code
190 |
191 |
192 | Designer
193 | MSBuild:Compile
194 |
195 |
196 | Designer
197 | MSBuild:Compile
198 |
199 |
200 | Designer
201 | MSBuild:Compile
202 |
203 |
204 | Designer
205 | MSBuild:Compile
206 |
207 |
208 | Designer
209 | MSBuild:Compile
210 |
211 |
212 | Designer
213 | MSBuild:Compile
214 |
215 |
216 |
217 |
218 | Code
219 |
220 |
221 | True
222 | True
223 | Resources.resx
224 |
225 |
226 | True
227 | Settings.settings
228 | True
229 |
230 |
231 | ResXFileCodeGenerator
232 | Resources.Designer.cs
233 |
234 |
235 |
236 |
237 | SettingsSingleFileGenerator
238 | Settings.Designer.cs
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 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
321 |
322 |
323 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
324 |
325 |
326 |
327 |
328 |
329 |
330 |
--------------------------------------------------------------------------------
/Maple/Models/ModelBase.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Runtime.CompilerServices;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 |
9 | namespace Maple.Models
10 | {
11 | public class ModelBase : INotifyPropertyChanged
12 | {
13 | public event PropertyChangedEventHandler PropertyChanged;
14 | public void NotifyPropertyChanged([CallerMemberName] string propertyName = "")
15 | {
16 | var handler = PropertyChanged;
17 | if (handler != null)
18 | {
19 | handler(this, new PropertyChangedEventArgs(propertyName));
20 | }
21 | }
22 |
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/Maple/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Resources;
3 | using System.Runtime.CompilerServices;
4 | using System.Runtime.InteropServices;
5 | using System.Windows;
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | [assembly: AssemblyTitle("Maple")]
11 | [assembly: AssemblyDescription("")]
12 | [assembly: AssemblyConfiguration("")]
13 | [assembly: AssemblyCompany("")]
14 | [assembly: AssemblyProduct("Maple")]
15 | [assembly: AssemblyCopyright("Copyright © 2021")]
16 | [assembly: AssemblyTrademark("")]
17 | [assembly: AssemblyCulture("")]
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | [assembly: ComVisible(false)]
23 |
24 | //In order to begin building localizable applications, set
25 | //CultureYouAreCodingWith in your .csproj file
26 | //inside a . For example, if you are using US english
27 | //in your source files, set the to en-US. Then uncomment
28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in
29 | //the line below to match the UICulture setting in the project file.
30 |
31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
32 |
33 |
34 | [assembly: ThemeInfo(
35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
36 | //(used if a resource is not found in the page,
37 | // or application resource dictionaries)
38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
39 | //(used if a resource is not found in the page,
40 | // app, or any theme specific resource dictionaries)
41 | )]
42 |
43 |
44 | // Version information for an assembly consists of the following four values:
45 | //
46 | // Major Version
47 | // Minor Version
48 | // Build Number
49 | // Revision
50 | //
51 | // You can specify all the values or you can default the Build and Revision Numbers
52 | // by using the '*' as shown below:
53 | // [assembly: AssemblyVersion("1.0.*")]
54 | [assembly: AssemblyVersion("1.0.0.0")]
55 | [assembly: AssemblyFileVersion("1.0.0.0")]
56 |
--------------------------------------------------------------------------------
/Maple/Properties/Resources.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Maple.Properties
12 | {
13 |
14 |
15 | ///
16 | /// A strongly-typed resource class, for looking up localized strings, etc.
17 | ///
18 | // This class was auto-generated by the StronglyTypedResourceBuilder
19 | // class via a tool like ResGen or Visual Studio.
20 | // To add or remove a member, edit your .ResX file then rerun ResGen
21 | // with the /str option, or rebuild your VS project.
22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
25 | internal class Resources
26 | {
27 |
28 | private static global::System.Resources.ResourceManager resourceMan;
29 |
30 | private static global::System.Globalization.CultureInfo resourceCulture;
31 |
32 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
33 | internal Resources()
34 | {
35 | }
36 |
37 | ///
38 | /// Returns the cached ResourceManager instance used by this class.
39 | ///
40 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
41 | internal static global::System.Resources.ResourceManager ResourceManager
42 | {
43 | get
44 | {
45 | if ((resourceMan == null))
46 | {
47 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Maple.Properties.Resources", typeof(Resources).Assembly);
48 | resourceMan = temp;
49 | }
50 | return resourceMan;
51 | }
52 | }
53 |
54 | ///
55 | /// Overrides the current thread's CurrentUICulture property for all
56 | /// resource lookups using this strongly typed resource class.
57 | ///
58 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
59 | internal static global::System.Globalization.CultureInfo Culture
60 | {
61 | get
62 | {
63 | return resourceCulture;
64 | }
65 | set
66 | {
67 | resourceCulture = value;
68 | }
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/Maple/Properties/Resources.resx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
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 | text/microsoft-resx
107 |
108 |
109 | 2.0
110 |
111 |
112 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
113 |
114 |
115 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
116 |
117 |
--------------------------------------------------------------------------------
/Maple/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace Maple.Properties
12 | {
13 |
14 |
15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
18 | {
19 |
20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
21 |
22 | public static Settings Default
23 | {
24 | get
25 | {
26 | return defaultInstance;
27 | }
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/Maple/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/Maple/ViewModels/GamePlayerViewModel.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading;
7 | using System.Threading.Tasks;
8 |
9 | namespace Maple.ViewModels
10 | {
11 | class GamePlayerViewModel : ViewModelBase
12 | {
13 | public GameData GameDataData;
14 |
15 | private Thread _gameBrainThread;
16 |
17 | public void StartGameBrain()
18 | {
19 | GameDataData = new GameData();
20 | GameDataData.GameBrain();
21 | }
22 |
23 | public GamePlayerViewModel()
24 | {
25 | Input.NewInputEnabled = true;
26 | IsActive = true;
27 | IsClosing = false;
28 | _gameBrainThread = new Thread(StartGameBrain) { Name = "Game Brain Thread" };
29 | _gameBrainThread.Start();
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/Maple/ViewModels/JobEditViewModel.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using Maple.Windows;
3 | using Newtonsoft.Json;
4 | using System;
5 | using System.Collections.Generic;
6 | using System.Collections.ObjectModel;
7 | using System.IO;
8 | using System.Linq;
9 | using System.Text;
10 | using System.Threading;
11 | using System.Threading.Tasks;
12 | using System.Windows;
13 | using System.Windows.Input;
14 |
15 | namespace Maple.ViewModels
16 | {
17 | class JobEditViewModel : ViewModelBase
18 | {
19 | private CharacterData _characterData;
20 |
21 | public ObservableCollection PotentialJobs
22 | {
23 | get { return new ObservableCollection((Jobs[])Enum.GetValues(typeof(Jobs))); }
24 | }
25 |
26 | public Jobs SelectedJob
27 | {
28 | get { return _characterData.CharacterJob; }
29 | set { _characterData.CharacterJob = value; NotifyPropertyChanged(); }
30 | }
31 |
32 | public string CharacterName
33 | {
34 | get { return _characterData.CharacterName; }
35 | set { _characterData.CharacterName = value; NotifyPropertyChanged(); }
36 | }
37 |
38 |
39 | //private List _skillDataList;
40 | public List SkillDataList
41 | {
42 | get { return _characterData.SkillDataList; }
43 | set { _characterData.SkillDataList = value; NotifyPropertyChanged("SkillNamesDataList"); NotifyPropertyChanged(); }
44 | }
45 |
46 | public ObservableCollection SkillNamesDataList
47 | {
48 | get { return new ObservableCollection(SkillDataList?.Select(x => x.SkillName) ?? new List()); }
49 | }
50 |
51 | //private int _characterSelectionLocation;
52 | public int CharacterSelectionLocation
53 | {
54 | get { return _characterData.CharacterSelectionLocation; }
55 | set { _characterData.CharacterSelectionLocation = value; NotifyPropertyChanged(); }
56 | }
57 |
58 | private string _selectedSkillName;
59 | public string SelectedSkillName
60 | {
61 | get { return _selectedSkillName; }
62 | set { _selectedSkillName = value; NotifyPropertyChanged(); }
63 | }
64 |
65 | private ICommand _addSkillCommand;
66 |
67 | public ICommand AddSkillCommand
68 | {
69 | get
70 | {
71 | return _addSkillCommand ?? (_addSkillCommand = new CommandHandler(() => AddSkill(), () => true));
72 | }
73 | }
74 |
75 | private void AddSkill()
76 | {
77 | SkillEdit skillEditWindowData = new SkillEdit();
78 | skillEditWindowData.ShowDialog();
79 | if (skillEditWindowData.IsWindowAccepted)
80 | {
81 | SkillDataList.Add(skillEditWindowData.SkillDataData);
82 | }
83 | }
84 |
85 | private ICommand _deleteSkillCommand;
86 |
87 | public ICommand DeleteSkillCommand
88 | {
89 | get
90 | {
91 | return _deleteSkillCommand ?? (_deleteSkillCommand = new CommandHandler(() => DeleteSkill(), () => true));
92 | }
93 | }
94 |
95 | private void DeleteSkill()
96 | {
97 | var skillToRemove = _characterData.SkillDataList.Where(x => x.SkillName == SelectedSkillName).FirstOrDefault();
98 | if (skillToRemove == null)
99 | {
100 | return;
101 | }
102 | _characterData.SkillDataList.Remove(skillToRemove);
103 | SelectedSkillName = SkillDataList?.FirstOrDefault()?.SkillName ?? "";
104 | }
105 |
106 | private ICommand _recordJumpsCommand;
107 |
108 | public ICommand RecordJumpsCommand
109 | {
110 | get
111 | {
112 | return _recordJumpsCommand ?? (_recordJumpsCommand = new CommandHandler(() => RecordJumps(), () => true));
113 | }
114 | }
115 |
116 | private void RecordJumps()
117 | {
118 | Input.ResetMouse();
119 | Input.ClickMouse();
120 | Thread.Sleep(10);
121 | Input.ReleaseMouse();
122 | _characterData.JumpDataData = JumpData.GenerateJumpData();
123 | }
124 |
125 | private ICommand _acceptCommand;
126 |
127 | public ICommand AcceptCommand
128 | {
129 | get
130 | {
131 | return _acceptCommand ?? (_acceptCommand = new CommandHandler(() => Accept(), () => true));
132 | }
133 | }
134 |
135 | private void Accept()
136 | {
137 | string fileName = _characterData.CharacterJob.ToString();
138 | string jsonString = JsonConvert.SerializeObject(_characterData, Formatting.Indented);
139 | string characterExportLocation = System.Configuration.ConfigurationManager.AppSettings["ClassExportLocation"];
140 | string filePath = Path.Combine(characterExportLocation, fileName);
141 | File.WriteAllText(filePath, jsonString);
142 | _parentWindow.Close();
143 | }
144 |
145 | private ICommand _cancelCommand;
146 |
147 | public ICommand CancelCommand
148 | {
149 | get
150 | {
151 | return _cancelCommand ?? (_cancelCommand = new CommandHandler(() => Cancel(), () => true));
152 | }
153 | }
154 |
155 | private void Cancel()
156 | {
157 | _parentWindow.Close();
158 | }
159 |
160 | private Window _parentWindow;
161 |
162 | public JobEditViewModel(Jobs? selectedJob, Window window)
163 | {
164 | if (selectedJob == null)
165 | {
166 | _characterData = new CharacterData();
167 | SelectedJob = PotentialJobs[0];
168 | }
169 | else
170 | {
171 | string fileLocation = System.Configuration.ConfigurationManager.AppSettings["ClassExportLocation"];
172 | string fullPath = Path.Combine(fileLocation, selectedJob.ToString());
173 | string jsonString = File.ReadAllText(fullPath);
174 | _characterData = JsonConvert.DeserializeObject(jsonString);
175 | }
176 | if (SkillDataList?.Any() ?? false)
177 | {
178 | SelectedSkillName = SkillDataList[0].SkillName;
179 | }
180 | _parentWindow = window;
181 | IsActive = true;
182 | IsClosing = false;
183 |
184 | }
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/Maple/ViewModels/JobsWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Collections.ObjectModel;
5 | using System.IO;
6 | using System.Linq;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Input;
10 |
11 | namespace Maple.ViewModels
12 | {
13 | class JobsWindowViewModel : ViewModelBase
14 | {
15 | private ObservableCollection _jobsDataList;
16 | public ObservableCollection JobsDataList
17 | {
18 | get { return _jobsDataList; }
19 | set { _jobsDataList = value; NotifyPropertyChanged(); }
20 | }
21 |
22 | private string _selectedJobData;
23 |
24 | public string SelectedJobData
25 | {
26 | get { return _selectedJobData; }
27 | set { _selectedJobData = value; NotifyPropertyChanged(); }
28 | }
29 |
30 | private ICommand _editJobCommand;
31 |
32 | public ICommand EditJobCommand
33 | {
34 | get
35 | {
36 | return _editJobCommand ?? (_editJobCommand = new CommandHandler(() => EditJob(), () => true));
37 | }
38 | }
39 |
40 | private void EditJob()
41 | {
42 | Windows.JobEdit jobEditWindow = new Windows.JobEdit((Jobs)Enum.Parse(typeof(Jobs), SelectedJobData));
43 | IsActive = false;
44 | jobEditWindow.ShowDialog();
45 | IsActive = true;
46 | }
47 |
48 | private ICommand _createNewJobCommand;
49 |
50 | public ICommand CreateNewJobCommand
51 | {
52 | get
53 | {
54 | return _createNewJobCommand ?? (_createNewJobCommand = new CommandHandler(() => CreateNewJob(), () => true));
55 | }
56 | }
57 |
58 | private void CreateNewJob()
59 | {
60 | Windows.JobEdit jobEditWindow = new Windows.JobEdit(null);
61 | IsActive = false;
62 | jobEditWindow.ShowDialog();
63 | IsActive = true;
64 | }
65 |
66 | public JobsWindowViewModel()
67 | {
68 | IsActive = true;
69 | IsClosing = false;
70 | var classExportLocation = System.Configuration.ConfigurationManager.AppSettings["ClassExportLocation"];
71 | var jobsWithDirectories = Directory.GetFiles(classExportLocation).ToList();
72 | var jobs = jobsWithDirectories.Select(x => { return x.Split('\\').Last(); }).ToList();
73 | JobsDataList = new ObservableCollection(jobs);
74 | SelectedJobData = JobsDataList.FirstOrDefault();
75 | }
76 | }
77 | }
78 |
--------------------------------------------------------------------------------
/Maple/ViewModels/MainWindowViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.ComponentModel;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows.Input;
8 |
9 | namespace Maple.ViewModels
10 | {
11 | class MainWindowViewModel : ViewModelBase
12 | {
13 |
14 | private ICommand _alterJobsCommand;
15 |
16 | public ICommand AlterJobsCommand
17 | {
18 | get
19 | {
20 | return _alterJobsCommand ?? (_alterJobsCommand = new CommandHandler(() => AlterJobs(), () => true));
21 | }
22 | }
23 |
24 | private void AlterJobs()
25 | {
26 | Windows.JobsWindow jobsWindow = new Windows.JobsWindow();
27 | IsActive = false;
28 | jobsWindow.ShowDialog();
29 | IsActive = true;
30 | }
31 |
32 | private ICommand _createNewMapCommand;
33 | public ICommand CreateNewMapCommand
34 | {
35 | get
36 | {
37 | return _createNewMapCommand ?? (_createNewMapCommand = new CommandHandler(() => CreateNewMap(), () => true));
38 | }
39 | }
40 |
41 | public void CreateNewMap()
42 | {
43 | Windows.MapCreator mapCreatorWindow = new Windows.MapCreator();
44 | IsActive = false;
45 | mapCreatorWindow.ShowDialog();
46 | IsActive = true;
47 | }
48 |
49 | private ICommand _gamePlayerCommand;
50 | public ICommand GamePlayerCommand
51 | {
52 | get
53 | {
54 | return _gamePlayerCommand ?? (_gamePlayerCommand = new CommandHandler(() => GamePlayer(), () => true));
55 | }
56 | }
57 |
58 | public void GamePlayer()
59 | {
60 | Windows.GamePlayer gamePlayerWindow = new Windows.GamePlayer();
61 | IsActive = false;
62 | gamePlayerWindow.ShowDialog();
63 | IsActive = true;
64 | }
65 |
66 | public MainWindowViewModel()
67 | {
68 | IsActive = true;
69 | IsClosing = false;
70 | }
71 |
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/Maple/ViewModels/MapCreatorViewModel.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using Newtonsoft.Json;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Collections.ObjectModel;
6 | using System.ComponentModel;
7 | using System.Drawing;
8 | using System.IO;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading;
12 | using System.Threading.Tasks;
13 | using System.Windows.Input;
14 |
15 | namespace Maple.ViewModels
16 | {
17 | public class MapCreatorViewModel : ViewModelBase
18 | {
19 | public SerializableBitmapImageWrapper CurrentImage { get; set; }
20 |
21 | MapData _mapInfoData;
22 | public MapData MapInfoData
23 | {
24 | get { return _mapInfoData; }
25 | set { _mapInfoData = value; }
26 | }
27 |
28 | MapPiece _mapPieceData;
29 |
30 | public MapPiece MapPieceData
31 | {
32 | get { return _mapPieceData; }
33 | set { _mapPieceData = value; }
34 | }
35 |
36 | private Vector2 _currentPosition;
37 |
38 | public Vector2 CurrentPosition
39 | {
40 | get { return _currentPosition; }
41 | set { _currentPosition = value; }
42 | }
43 |
44 | private string _mapNameText;
45 |
46 | public string MapNameText
47 | {
48 | get { return _mapNameText; }
49 | set { _mapNameText = value; NotifyPropertyChanged(); }
50 | }
51 |
52 | private string _recordRopeText;
53 |
54 | public string RecordRopeText
55 | {
56 | get { return _recordRopeText; }
57 | set { _recordRopeText = value; NotifyPropertyChanged(); }
58 | }
59 |
60 | private bool _isRecordRopeEnabled;
61 |
62 | public bool IsRecordRopeEnabled
63 | {
64 | get { return _isRecordRopeEnabled; }
65 | set { _isRecordRopeEnabled = value; NotifyPropertyChanged(); }
66 | }
67 |
68 | /*private double _minimapToPixelRatioX;
69 |
70 | public double MinimapToPixelRatioX
71 | {
72 | get { return _minimapToPixelRatioX; }
73 | set { _minimapToPixelRatioX = value; NotifyPropertyChanged(); }
74 | }
75 |
76 | private double _minimapToPixelRatioY;
77 |
78 | public double MinimapToPixelRatioY
79 | {
80 | get { return _minimapToPixelRatioY; }
81 | set { _minimapToPixelRatioY = value; NotifyPropertyChanged(); }
82 | }*/
83 |
84 | private ICommand _recordRopeCommand;
85 | public ICommand RecordRopeCommand
86 | {
87 | get
88 | {
89 | return _recordRopeCommand ?? (_recordRopeCommand = new CommandHandler(() => RecordRope(), () => true));
90 | }
91 | }
92 |
93 | public void RecordRope()
94 | {
95 | if (MapPieceData == null)
96 | {
97 | MapPieceData = new MapPiece(MapPieceTypes.Rope);
98 | MapPieceData.SetBeginningOrEnd(CurrentPosition);
99 | }
100 | else
101 | {
102 | MapPieceData.SetBeginningOrEnd(CurrentPosition);
103 | MapInfoData.MapPieceDataList.Add(MapPieceData);
104 | MapPieceData = null;
105 | }
106 | IsExportMapEnabled = !IsExportMapEnabled;
107 | IsRecordPlatformEdgeEnabled = !IsRecordPlatformEdgeEnabled;
108 | }
109 |
110 |
111 | private string _recordPlatformEdgeText;
112 |
113 | public string RecordPlatformEdgeText
114 | {
115 | get { return _recordPlatformEdgeText; }
116 | set { _recordPlatformEdgeText = value; NotifyPropertyChanged(); }
117 | }
118 |
119 | private ICommand _recordPlatformEdgeCommand;
120 | public ICommand RecordPlatformEdgeCommand
121 | {
122 | get
123 | {
124 | return _recordPlatformEdgeCommand ?? (_recordPlatformEdgeCommand = new CommandHandler(() => RecordPlatformEdge(), () => true));
125 | }
126 | }
127 |
128 | public void RecordPlatformEdge()
129 | {
130 | if (MapPieceData == null)
131 | {
132 | MapPieceData = new MapPiece(MapPieceTypes.Ledge);
133 | MapPieceData.SetBeginningOrEnd(CurrentPosition);
134 | }
135 | else
136 | {
137 | MapPieceData.SetBeginningOrEnd(CurrentPosition);
138 | MapInfoData.MapPieceDataList.Add(MapPieceData);
139 | MapPieceData = null;
140 | }
141 | IsRecordRopeEnabled = !IsRecordRopeEnabled;
142 | IsExportMapEnabled = !IsExportMapEnabled;
143 | }
144 |
145 | private ICommand _exportMapCommand;
146 | public ICommand ExportMapCommand
147 | {
148 | get
149 | {
150 | return _exportMapCommand ?? (_exportMapCommand = new CommandHandler(() => ExportMap(), () => true));
151 | }
152 | }
153 |
154 | public ObservableCollection MapNamesDataList
155 | {
156 | get { return new ObservableCollection(Enum.GetNames(typeof(MapNames)).ToList()); }
157 | }
158 |
159 | public void ExportMap()
160 | {
161 | MapInfoData.MapName = (MapNames)Enum.Parse(typeof(MapNames), MapNameText);
162 | MapInfoData.MapNameImage = new SerializableBitmapImageWrapper(Imaging.CropImage(CurrentImage.BitmapData, Imaging.MapNameRect));
163 | string fileName = MapInfoData.MapName.ToString();
164 | if (fileName.Length <= 0)
165 | {
166 | return;
167 | }
168 | string jsonString = JsonConvert.SerializeObject(MapInfoData, Formatting.Indented);
169 | string mapExportLocation = System.Configuration.ConfigurationManager.AppSettings["MapExportLocation"];
170 | string filePath = Path.Combine(mapExportLocation, fileName);
171 | File.WriteAllText(filePath, jsonString);
172 | MapInfoData = new MapData();
173 | }
174 |
175 | private ICommand _recordPixelToMapPixelCommand;
176 | public ICommand RecordPixelToMapPixelCommand
177 | {
178 | get
179 | {
180 | return _recordPixelToMapPixelCommand ?? (_recordPixelToMapPixelCommand = new CommandHandler(() => RecordPixelToMapPixel(), () => true));
181 | }
182 | }
183 |
184 | public enum RecordPixelToMapPixelStatuses
185 | {
186 | XFindingInitialPhotoLocation,
187 | XFindingFirstImageWhereOriginalMinimapLocationChanged,
188 | XFindingSecondImageWhereOriginalMinimapLocationChanged,
189 | YFindingInitialPhotoLocation,
190 | YFindingFirstImageWhereOriginalMinimapLocationChanged,
191 | YFindingSecondImageWhereOriginalMinimapLocationChanged,
192 | Finished
193 | }
194 |
195 | public void RecordPixelToMapPixel() { }
196 |
197 | /*public void RecordPixelToMapPixel()
198 | {
199 | Input.ResetMouse();
200 | Input.ClickMouse();
201 | Thread.Sleep(50);
202 | Input.ReleaseMouse();
203 | List photoWithTimeDataList = new List();
204 | //PhotoTaker.StartTakingImages(10);
205 | for (int i = 0; i < 200; i++)
206 | {
207 | Input.StartInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
208 | Thread.Sleep(10);
209 | Input.StopInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
210 | Thread.Sleep(600);
211 | if (Imaging.GetCurrentGameScreen(out Bitmap gameScreen))
212 | {
213 | photoWithTimeDataList.Add(new PhotoWithTimestamp(gameScreen));
214 | }
215 | }
216 |
217 | var playerImage = Imaging.GetImageFromFile(Imaging.ImageFiles.PlayerMiniMap);
218 | var playerNameImage = Imaging.GetImageFromFile(Imaging.ImageFiles.DemonAvengerName);
219 | RecordPixelToMapPixelStatuses currentStatus = RecordPixelToMapPixelStatuses.XFindingInitialPhotoLocation;
220 | List minimapLocations;
221 | List nameLocations;
222 | Vector2 minimapLocationPre = null;
223 | Vector2 minimapLocationOriginal = null;
224 | Vector2 minimapLocationChanged = null;
225 | Vector2 playerLocationOriginal = null;
226 | Vector2 playerLocationChanged = null;
227 |
228 | //foreach (var curPhotoWithTimestamp in photoWithTimeDataList)
229 | while (currentStatus != RecordPixelToMapPixelStatuses.YFindingInitialPhotoLocation)
230 | {
231 | Input.StartInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
232 | Thread.Sleep(10);
233 | Input.StopInput(Input.SpecialCharacters.KEY_RIGHT_ARROW);
234 | Thread.Sleep(600);
235 | PhotoWithTimestamp curPhotoWithTimestamp = null;
236 | if (Imaging.GetCurrentGameScreen(out Bitmap gameScreen))
237 | {
238 | curPhotoWithTimestamp = new PhotoWithTimestamp(gameScreen);
239 | }
240 | else
241 | {
242 | continue;
243 | }
244 | if (Imaging.FindBitmap(new List() { playerImage }, curPhotoWithTimestamp.Photo, 20, out minimapLocations))
245 | {
246 | switch (currentStatus)
247 | {
248 | case RecordPixelToMapPixelStatuses.XFindingInitialPhotoLocation:
249 | minimapLocationPre = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
250 | currentStatus = RecordPixelToMapPixelStatuses.XFindingFirstImageWhereOriginalMinimapLocationChanged;
251 | break;
252 | case RecordPixelToMapPixelStatuses.XFindingFirstImageWhereOriginalMinimapLocationChanged:
253 | minimapLocationOriginal = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
254 | if (minimapLocationOriginal.X == minimapLocationPre.X || minimapLocationOriginal.Y == minimapLocationPre.Y)
255 | {
256 | continue;
257 | }
258 | if (Imaging.FindBitmap(new List() { playerNameImage }, curPhotoWithTimestamp.Photo, 125, out nameLocations))
259 | {
260 | playerLocationOriginal = MapleMath.PixelToPixelCoordinate(nameLocations[0], curPhotoWithTimestamp.Photo.Width);
261 | currentStatus = RecordPixelToMapPixelStatuses.XFindingSecondImageWhereOriginalMinimapLocationChanged;
262 | }
263 | break;
264 | case RecordPixelToMapPixelStatuses.XFindingSecondImageWhereOriginalMinimapLocationChanged:
265 | minimapLocationChanged = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
266 | if (minimapLocationChanged.X == minimapLocationOriginal.X || minimapLocationChanged.Y == minimapLocationOriginal.Y)
267 | {
268 | continue;
269 | }
270 | if (Imaging.FindBitmap(new List() { playerNameImage }, curPhotoWithTimestamp.Photo, 125, out nameLocations))
271 | {
272 | playerLocationChanged = MapleMath.PixelToPixelCoordinate(nameLocations[0], curPhotoWithTimestamp.Photo.Width);
273 | if (playerLocationChanged.X == playerLocationOriginal.X || playerLocationChanged.Y == playerLocationOriginal.Y)
274 | {
275 | continue;
276 | }
277 | currentStatus = RecordPixelToMapPixelStatuses.YFindingInitialPhotoLocation;
278 | }
279 | break;
280 | default:
281 | break;
282 | }
283 | }
284 | if (currentStatus == RecordPixelToMapPixelStatuses.YFindingInitialPhotoLocation)
285 | {
286 | break;
287 | }
288 | }
289 | MinimapToPixelRatioX = ((double)(minimapLocationChanged.X - minimapLocationOriginal.X)) / (playerLocationChanged.X - playerLocationOriginal.X);
290 | MinimapToPixelRatioY = ((double)(minimapLocationChanged.Y - minimapLocationOriginal.Y)) / (playerLocationChanged.Y - playerLocationOriginal.Y);
291 | PhotoTaker.StartTakingImages(10);
292 | Input.StartInput(Input.SpecialCharacters.KEY_LEFT_ALT);
293 | Thread.Sleep(1000);
294 | PhotoTaker.StopTakingImages();
295 | Input.StopInput(Input.SpecialCharacters.KEY_LEFT_ALT);
296 | Input.StopInput('d');
297 | // todo clean this up
298 | photoWithTimeDataList = PhotoTaker.GetPhotosAndDeleteFromMemory();
299 | foreach (var curPhotoWithTimestamp in photoWithTimeDataList)
300 | {
301 | if (Imaging.FindBitmap(new List() { playerImage }, curPhotoWithTimestamp.Photo, 20, out minimapLocations))
302 | {
303 | switch (currentStatus)
304 | {
305 | case RecordPixelToMapPixelStatuses.YFindingInitialPhotoLocation:
306 | minimapLocationPre = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
307 | currentStatus = RecordPixelToMapPixelStatuses.XFindingFirstImageWhereOriginalMinimapLocationChanged;
308 | break;
309 | case RecordPixelToMapPixelStatuses.YFindingFirstImageWhereOriginalMinimapLocationChanged:
310 | minimapLocationOriginal = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
311 | if (minimapLocationOriginal.Y == minimapLocationPre.Y)
312 | {
313 | continue;
314 | }
315 | if (Imaging.FindBitmap(new List() { playerNameImage }, curPhotoWithTimestamp.Photo, 125, out nameLocations))
316 | {
317 | playerLocationOriginal = MapleMath.PixelToPixelCoordinate(nameLocations[0], curPhotoWithTimestamp.Photo.Width);
318 | currentStatus = RecordPixelToMapPixelStatuses.XFindingSecondImageWhereOriginalMinimapLocationChanged;
319 | }
320 | break;
321 | case RecordPixelToMapPixelStatuses.YFindingSecondImageWhereOriginalMinimapLocationChanged:
322 | minimapLocationChanged = MapleMath.PixelToPixelCoordinate(minimapLocations[0], curPhotoWithTimestamp.Photo.Width);
323 | if (minimapLocationChanged.Y == minimapLocationOriginal.Y)
324 | {
325 | continue;
326 | }
327 | if (Imaging.FindBitmap(new List() { playerNameImage }, curPhotoWithTimestamp.Photo, 125, out nameLocations))
328 | {
329 | playerLocationChanged = MapleMath.PixelToPixelCoordinate(nameLocations[0], curPhotoWithTimestamp.Photo.Width);
330 | currentStatus = RecordPixelToMapPixelStatuses.Finished;
331 | }
332 | break;
333 | default:
334 | break;
335 | }
336 | }
337 | if (currentStatus == RecordPixelToMapPixelStatuses.Finished)
338 | {
339 | break;
340 | }
341 | }
342 | MinimapToPixelRatioY = ((double)(minimapLocationChanged.Y - minimapLocationOriginal.Y)) / (playerLocationChanged.Y - playerLocationOriginal.Y);
343 |
344 | }*/
345 |
346 |
347 | private bool _isRecordPlatformEdgeEnabled;
348 | public bool IsRecordPlatformEdgeEnabled
349 | {
350 | get { return _isRecordPlatformEdgeEnabled; }
351 | set { _isRecordPlatformEdgeEnabled = value; NotifyPropertyChanged(); }
352 | }
353 |
354 | private bool _isExportMapEnabled;
355 |
356 | public bool IsExportMapEnabled
357 | {
358 | get { return _isRecordRopeEnabled; }
359 | set { _isExportMapEnabled = value; NotifyPropertyChanged(); }
360 | }
361 |
362 | public MapCreatorViewModel()
363 | {
364 | base.InitializeData();
365 | MapNameText = MapNamesDataList[0];
366 | RecordPlatformEdgeText = "Record Platform Edge";
367 | RecordRopeText = "Record Rope Edge";
368 | MapInfoData = new MapData();
369 | IsExportMapEnabled = true;
370 | IsRecordPlatformEdgeEnabled = true;
371 | IsRecordRopeEnabled = true;
372 | }
373 |
374 | }
375 | }
376 |
--------------------------------------------------------------------------------
/Maple/ViewModels/SkillEditViewModel.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Input;
9 |
10 | namespace Maple.ViewModels
11 | {
12 | class SkillEditViewModel : ViewModelBase
13 | {
14 | private SkillData _skillDataData;
15 |
16 | public SkillData SkillDataData
17 | {
18 | get { return _skillDataData; }
19 | set { _skillDataData = value; NotifyPropertyChanged(); }
20 | }
21 |
22 | public string SkillName
23 | {
24 | get { return _skillDataData.SkillName; }
25 | set { _skillDataData.SkillName = value; NotifyPropertyChanged(); }
26 | }
27 |
28 | public int DiscrepencyTimeMillis
29 | {
30 | get { return _skillDataData.DiscrepencyTimeMillis; }
31 | set { _skillDataData.DiscrepencyTimeMillis = value; NotifyPropertyChanged(); }
32 | }
33 |
34 | public int HoldTimeMills
35 | {
36 | get { return _skillDataData.HoldMillis; }
37 | set { _skillDataData.HoldMillis = value; NotifyPropertyChanged(); }
38 | }
39 |
40 | public string Key
41 | {
42 | get { return _skillDataData.Key.ToString(); }
43 | set { char c; char.TryParse(value[0].ToString(), out c); _skillDataData.Key = c; NotifyPropertyChanged(); }
44 | }
45 |
46 | public bool UseOnLogin
47 | {
48 | get { return _skillDataData.UseOnLogin; }
49 | set { _skillDataData.UseOnLogin = value; NotifyPropertyChanged(); }
50 | }
51 |
52 | private ICommand _acceptCommand;
53 |
54 | public ICommand AcceptCommand
55 | {
56 | get
57 | {
58 | return _acceptCommand ?? (_acceptCommand = new CommandHandler(() => Accept(), () => true));
59 | }
60 | }
61 |
62 | private void Accept()
63 | {
64 | WindowAccepted = true;
65 | _parentWindow.Close();
66 | }
67 |
68 | private ICommand _cancelCommand;
69 |
70 | public ICommand CancelCommand
71 | {
72 | get
73 | {
74 | return _cancelCommand ?? (_cancelCommand = new CommandHandler(() => Cancel(), () => true));
75 | }
76 | }
77 |
78 | private void Cancel()
79 | {
80 | _parentWindow.Close();
81 | }
82 |
83 | private bool _windowAccepted;
84 | public bool WindowAccepted
85 | {
86 | get { return _windowAccepted; }
87 | set { _windowAccepted = value; NotifyPropertyChanged(); }
88 | }
89 |
90 | private Window _parentWindow;
91 |
92 | public SkillEditViewModel(Window parentWindow)
93 | {
94 | _skillDataData = new SkillData();
95 | _parentWindow = parentWindow;
96 | WindowAccepted = false;
97 | IsActive = true;
98 | IsClosing = false;
99 | }
100 | }
101 | }
102 |
--------------------------------------------------------------------------------
/Maple/ViewModels/ViewModelBase.cs:
--------------------------------------------------------------------------------
1 | using Maple.Models;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.ComponentModel;
5 | using System.Linq;
6 | using System.Runtime.CompilerServices;
7 | using System.Text;
8 | using System.Threading.Tasks;
9 | using System.Windows.Input;
10 |
11 | namespace Maple.ViewModels
12 | {
13 | public class ViewModelBase : ModelBase
14 | {
15 |
16 |
17 | public bool IsClosing;
18 | public bool IsActive;
19 |
20 |
21 |
22 | public void InitializeData()
23 | {
24 | IsClosing = false;
25 | IsActive = true;
26 | }
27 |
28 |
29 | public class CommandHandler : ICommand
30 | {
31 | private Action _action;
32 | private Func _canExecute;
33 |
34 | ///
35 | /// Creates instance of the command handler
36 | ///
37 | /// Action to be executed by the command
38 | /// A bolean property to containing current permissions to execute the command
39 | public CommandHandler(Action action, Func canExecute)
40 | {
41 | _action = action;
42 | _canExecute = canExecute;
43 | }
44 |
45 | ///
46 | /// Wires CanExecuteChanged event
47 | ///
48 | public event EventHandler CanExecuteChanged
49 | {
50 | add { CommandManager.RequerySuggested += value; }
51 | remove { CommandManager.RequerySuggested -= value; }
52 | }
53 |
54 | ///
55 | /// Forcess checking if execute is allowed
56 | ///
57 | ///
58 | ///
59 | public bool CanExecute(object parameter)
60 | {
61 | return _canExecute.Invoke();
62 | }
63 |
64 | public void Execute(object parameter)
65 | {
66 | _action();
67 | }
68 | }
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/Maple/Windows/GamePlayer.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/Maple/Windows/GamePlayer.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Drawing;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | //using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Navigation;
15 | using System.Drawing;
16 | using System.Runtime.InteropServices;
17 | using System.Windows.Interop;
18 | using System.Windows.Forms;
19 | using System.Windows.Threading;
20 | using System.Threading;
21 | using System.Drawing.Drawing2D;
22 | using System.Drawing.Text;
23 | using IronOcr;
24 | using System.IO;
25 | using Maple.Data;
26 | using Maple.ViewModels;
27 | using System.ComponentModel;
28 | using System.Configuration;
29 | using Newtonsoft.Json;
30 |
31 | namespace Maple.Windows
32 | {
33 | ///
34 | /// Interaction logic for GamePlayer.xaml
35 | ///
36 | public partial class GamePlayer : Window
37 | {
38 | GamePlayerViewModel ModelData { get { return DataContext as GamePlayerViewModel; } }
39 |
40 | private void CameraUpdate()
41 | {
42 | List enemyImages = new List()
43 | {
44 | /*Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueEspressoMachineLeft),
45 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueEspressoMachineRight),
46 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueRaspberryJellyJuiceLeft),
47 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.BlueRaspberryJellyJuiceRight)*/
48 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.TheNextLegendTitle)
49 | };
50 | //path = Path.Combine(Environment.CurrentDirectory, "..\\..\\Images\\BlueRaspberryJellyJuiceRight.png");
51 | //Bitmap enemy2 = new Bitmap(path);
52 |
53 | var runeData = Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.runetest3);
54 | // 730, 180, 370, 50
55 |
56 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(730, 180, 92, 50));
57 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(822, 180, 92, 50));
58 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(914, 180, 92, 50));
59 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1006, 180, 92, 50));
60 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1098, 180, 92, 50));
61 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1190, 180, 92, 50));
62 |
63 | bool isClosing = false;
64 | bool isActive = false;
65 | //Bitmap croppedImage = CropImage(src, new Rectangle(0, 0, 350, 200));
66 | while (!isClosing)
67 | {
68 | this.Dispatcher.Invoke(() =>
69 | {
70 | isClosing = ModelData.IsClosing;
71 | isActive = ModelData.IsActive;
72 | });
73 | if (!isActive)
74 | {
75 | Thread.Sleep(100);
76 | continue;
77 | }
78 | if (isClosing)
79 | {
80 | return;
81 | }
82 | Bitmap croppedImage;
83 | if (!Data.Imaging.GetCurrentGameScreen(out croppedImage))
84 | {
85 | continue;
86 | }
87 | //Bitmap croppedImage = Data.Imaging.CropImage(src, new Rectangle(730, 180, 92, 50));
88 |
89 | Graphics g = Graphics.FromImage(croppedImage);
90 | g.SmoothingMode = SmoothingMode.AntiAlias;
91 | g.InterpolationMode = InterpolationMode.HighQualityBicubic;
92 | g.PixelOffsetMode = PixelOffsetMode.HighQuality;
93 | g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
94 | // Create string formatting options (used for alignment)
95 | StringFormat format = new StringFormat()
96 | {
97 | Alignment = StringAlignment.Center,
98 | LineAlignment = StringAlignment.Center
99 | };
100 | var cursorPosition = System.Windows.Forms.Cursor.Position;
101 | List locationsOfInterest = null;
102 | Dispatcher.Invoke(() =>
103 | {
104 | locationsOfInterest = ModelData.GameDataData.LocationsOfInterest;
105 | locationsOfInterest = locationsOfInterest.Select(x => { return new Vector2(x.X, Math.Abs(x.Y - croppedImage.Height)); }).ToList();
106 | });
107 | foreach (var curLocation in locationsOfInterest)
108 | {
109 | //Input.SetMouseLocation(MapleMath.PixelToPixelCoordinate(curLocation, croppedImage.Width));
110 | g.DrawRectangle(new Pen(Color.Red, 10), new System.Drawing.Rectangle((int)(curLocation.X) - 10, (int)curLocation.Y - 10, 4 + 20, 6 + 20));
111 | }
112 | // Draw the text onto the image
113 | //g.DrawString($"x: {xVal} y: {yVal}\n x: {cursorPosition.X} y: {cursorPosition.Y}", new Font("Arial", 18), Brushes.Red, new RectangleF(0, 0, croppedImage.Width, croppedImage.Height), format);
114 |
115 | /*var results = new IronTesseract().Read(croppedImage);*/
116 | // Flush all graphics changes to the bitmap
117 | g.Flush();
118 | try
119 | {
120 | this.Dispatcher.Invoke(() =>
121 | {
122 | ImageBrushData.ImageSource = Data.Imaging.ImageSourceFromBitmap(croppedImage);
123 | });
124 | }
125 | catch (Exception ex)
126 | {
127 | continue;
128 | }
129 |
130 |
131 | //bitmap.Save("test.jpg", ImageFormat.Jpeg);
132 | }
133 | }
134 |
135 | void DataWindow_Closing(object sender, CancelEventArgs e)
136 | {
137 | ModelData.IsClosing = true;
138 | Dispatcher.Invoke(() =>
139 | {
140 | Input.NewInputEnabled = false;
141 | ModelData.GameDataData.Closing = true;
142 | Input.StopAllKeyboardInput();
143 | });
144 |
145 | }
146 |
147 | Thread CameraUpdateThread;
148 |
149 | public GamePlayer()
150 | {
151 | InitializeComponent();
152 | DataContext = new GamePlayerViewModel();
153 | CameraUpdateThread = new Thread(CameraUpdate) { Name = "Game Player Camera Update Thread" };
154 | CameraUpdateThread.Start();
155 | }
156 | }
157 | }
158 |
--------------------------------------------------------------------------------
/Maple/Windows/JobEdit.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/Maple/Windows/JobEdit.xaml.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using Maple.ViewModels;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace Maple.Windows
18 | {
19 | ///
20 | /// Interaction logic for JobEdit.xaml
21 | ///
22 | public partial class JobEdit : Window
23 | {
24 | JobEditViewModel ModelData
25 | {
26 | get { return DataContext as JobEditViewModel; }
27 | }
28 | public JobEdit(Jobs? selectedJob)
29 | {
30 | InitializeComponent();
31 | DataContext = new JobEditViewModel(selectedJob, this);
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Maple/Windows/JobsWindow.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Maple/Windows/JobsWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using Maple.ViewModels;
2 | using System;
3 | using System.Collections.Generic;
4 | using System.Linq;
5 | using System.Text;
6 | using System.Threading.Tasks;
7 | using System.Windows;
8 | using System.Windows.Controls;
9 | using System.Windows.Data;
10 | using System.Windows.Documents;
11 | using System.Windows.Input;
12 | using System.Windows.Media;
13 | using System.Windows.Media.Imaging;
14 | using System.Windows.Shapes;
15 |
16 | namespace Maple.Windows
17 | {
18 | ///
19 | /// Interaction logic for JobsWindow.xaml
20 | ///
21 | public partial class JobsWindow : Window
22 | {
23 | JobsWindowViewModel ModelData
24 | {
25 | get { return DataContext as JobsWindowViewModel; }
26 | }
27 |
28 | public JobsWindow()
29 | {
30 | InitializeComponent();
31 | DataContext = new JobsWindowViewModel();
32 | }
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/Maple/Windows/MapCreator.xaml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
12 |
13 |
14 |
15 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Maple/Windows/MapCreator.xaml.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using Maple.ViewModels;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.ComponentModel;
6 | using System.Drawing;
7 | using System.Drawing.Drawing2D;
8 | using System.Drawing.Text;
9 | using System.Linq;
10 | using System.Text;
11 | using System.Threading;
12 | using System.Threading.Tasks;
13 | using System.Windows;
14 | using System.Windows.Forms;
15 |
16 |
17 | namespace Maple.Windows
18 | {
19 |
20 |
21 | ///
22 | /// Interaction logic for MapCreator.xaml
23 | ///
24 | public partial class MapCreator : Window
25 | {
26 | void DataWindow_Closing(object sender, CancelEventArgs e)
27 | {
28 | ModelData.IsClosing = true;
29 | }
30 |
31 | MapCreatorViewModel ModelData { get { return DataContext as MapCreatorViewModel; } }
32 |
33 | private void CameraUpdate()
34 | {
35 | List playerImages = new List()
36 | {
37 | Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.PlayerMiniMap),
38 | };
39 | //path = Path.Combine(Environment.CurrentDirectory, "..\\..\\Images\\BlueRaspberryJellyJuiceRight.png");
40 | //Bitmap enemy2 = new Bitmap(path);
41 | Rectangle bounds = Screen.GetBounds(System.Drawing.Point.Empty);
42 |
43 | //var runeData = Maple.Data.Imaging.GetImageFromFile(Data.Imaging.ImageFiles.runetest3);
44 | // 730, 180, 370, 50
45 |
46 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(730, 180, 92, 50));
47 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(822, 180, 92, 50));
48 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(914, 180, 92, 50));
49 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1006, 180, 92, 50));
50 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1098, 180, 92, 50));
51 | // Bitmap croppedImage = CropImage(runeData, new Rectangle(1190, 180, 92, 50));
52 |
53 | bool isClosing = false;
54 | bool isActive = false;
55 | //Bitmap croppedImage = CropImage(src, new Rectangle(0, 0, 350, 200));
56 | while (!isClosing)
57 | {
58 | this.Dispatcher.Invoke(() =>
59 | {
60 | isClosing = ModelData.IsClosing;
61 | isActive = ModelData.IsActive;
62 | });
63 | if (!isActive)
64 | {
65 | Thread.Sleep(100);
66 | continue;
67 | }
68 | if (isClosing)
69 | {
70 | return;
71 | }
72 | Bitmap src = new Bitmap(bounds.Width, bounds.Height);
73 | //src = Imaging.ChangeBackgroundToBlack(src, 6);
74 | //Bitmap croppedImage = src;
75 | Graphics gr = Graphics.FromImage(src);
76 | gr.CopyFromScreen(System.Drawing.Point.Empty, System.Drawing.Point.Empty, bounds.Size);
77 | Bitmap croppedImage = Data.Imaging.CropImage(src, Imaging.MiniMapRect);
78 |
79 | //croppedImage = new Bitmap(Imaging.ColorReplace(croppedImage, 200, Color.Black, Color.White));
80 | //croppedImage = new Bitmap(b.Width, b.Height);
81 | this.Dispatcher.Invoke(() =>
82 | {
83 | ModelData.CurrentImage = new SerializableBitmapImageWrapper(croppedImage);
84 | });
85 |
86 |
87 | Graphics g = Graphics.FromImage(croppedImage);
88 | g.SmoothingMode = SmoothingMode.AntiAlias;
89 | g.InterpolationMode = InterpolationMode.HighQualityBicubic;
90 | g.PixelOffsetMode = PixelOffsetMode.HighQuality;
91 | g.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
92 | // Create string formatting options (used for alignment)
93 | StringFormat format = new StringFormat()
94 | {
95 | Alignment = StringAlignment.Center,
96 | LineAlignment = StringAlignment.Center
97 | };
98 | var cursorPosition = System.Windows.Forms.Cursor.Position;
99 | // Draw the text onto the image
100 | //g.DrawString($"x: {xVal} y: {yVal}\n x: {cursorPosition.X} y: {cursorPosition.Y}", new Font("Arial", 18), Brushes.Red, new RectangleF(0, 0, croppedImage.Width, croppedImage.Height), format);
101 | if (Maple.Data.Imaging.FindBitmap(playerImages, croppedImage, out List locations))
102 | {
103 | Bitmap title = Imaging.GetImageFromFile(Imaging.ImageFiles.TheNextLegendTitle);
104 | if (locations?.Count > 0)
105 | {
106 | var curLocation = locations[0];
107 | g.DrawString($"minimap x: {curLocation.X} y: {curLocation.Y}", new Font("Arial", 18), Brushes.Red, new Rectangle(0, 0, croppedImage.Width, croppedImage.Height), format);
108 | this.Dispatcher.Invoke(() =>
109 | {
110 | ModelData.CurrentPosition = curLocation;
111 | });
112 | //g.DrawRectangle(new Pen(Color.Red, 10), new Rectangle(curMobCluster.Center.X - 10, curMobCluster.Center.Y - 10, 4 + 20, 6 + 20));
113 | }
114 |
115 |
116 | }
117 | /*var results = new IronTesseract().Read(croppedImage);*/
118 | // Flush all graphics changes to the bitmap
119 | g.Flush();
120 |
121 | this.Dispatcher.Invoke(() =>
122 | {
123 | ImageBrushData.ImageSource = Data.Imaging.ImageSourceFromBitmap(croppedImage);
124 | });
125 |
126 |
127 | //bitmap.Save("test.jpg", ImageFormat.Jpeg);
128 | }
129 | }
130 |
131 | Thread CameraUpdateThread;
132 |
133 | public MapCreator()
134 | {
135 | InitializeComponent();
136 | DataContext = new ViewModels.MapCreatorViewModel();
137 | CameraUpdateThread = new Thread(CameraUpdate) { Name = "Map Creator Camera Update Thread" };
138 | CameraUpdateThread.Start();
139 | }
140 | }
141 | }
142 |
--------------------------------------------------------------------------------
/Maple/Windows/SkillEdit.xaml:
--------------------------------------------------------------------------------
1 |
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 |
--------------------------------------------------------------------------------
/Maple/Windows/SkillEdit.xaml.cs:
--------------------------------------------------------------------------------
1 | using Maple.Data;
2 | using Maple.ViewModels;
3 | using System;
4 | using System.Collections.Generic;
5 | using System.Linq;
6 | using System.Text;
7 | using System.Threading.Tasks;
8 | using System.Windows;
9 | using System.Windows.Controls;
10 | using System.Windows.Data;
11 | using System.Windows.Documents;
12 | using System.Windows.Input;
13 | using System.Windows.Media;
14 | using System.Windows.Media.Imaging;
15 | using System.Windows.Shapes;
16 |
17 | namespace Maple.Windows
18 | {
19 | ///
20 | /// Interaction logic for SkillEdit.xaml
21 | ///
22 | public partial class SkillEdit : Window
23 | {
24 | SkillEditViewModel ModelData
25 | {
26 | get { return DataContext as SkillEditViewModel; }
27 | }
28 |
29 | public SkillData SkillDataData
30 | {
31 | get { return ModelData.SkillDataData; }
32 | }
33 |
34 | public bool IsWindowAccepted
35 | {
36 | get { return ModelData.WindowAccepted; }
37 | }
38 |
39 | public SkillEdit()
40 | {
41 | InitializeComponent();
42 | DataContext = new SkillEditViewModel(this);
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/Maple/Windows/StatisticsViewer.xaml:
--------------------------------------------------------------------------------
1 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/Maple/Windows/StatisticsViewer.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Windows;
7 | using System.Windows.Controls;
8 | using System.Windows.Data;
9 | using System.Windows.Documents;
10 | using System.Windows.Input;
11 | using System.Windows.Media;
12 | using System.Windows.Media.Imaging;
13 | using System.Windows.Shapes;
14 |
15 | namespace Maple.Windows
16 | {
17 | ///
18 | /// Interaction logic for StatisticsViewer.xaml
19 | ///
20 | public partial class StatisticsViewer : Window
21 | {
22 | public StatisticsViewer()
23 | {
24 | InitializeComponent();
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/Maple/bin/Debug/Maple.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/bin/Debug/Maple.exe
--------------------------------------------------------------------------------
/Maple/bin/Debug/Maple.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Maple/bin/Debug/Maple.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/bin/Debug/Maple.pdb
--------------------------------------------------------------------------------
/Maple/obj/Debug/App.g.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1941C7B2472A9C13376759CC6E6A8EF83F1A733F2EB5A63CC993B9F5FC670FA3"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple {
36 |
37 |
38 | ///
39 | /// App
40 | ///
41 | public partial class App : System.Windows.Application {
42 |
43 | ///
44 | /// InitializeComponent
45 | ///
46 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
47 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
48 | public void InitializeComponent() {
49 |
50 | #line 5 "..\..\App.xaml"
51 | this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
52 |
53 | #line default
54 | #line hidden
55 | }
56 |
57 | ///
58 | /// Application Entry Point.
59 | ///
60 | [System.STAThreadAttribute()]
61 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
62 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
63 | public static void Main() {
64 | Maple.App app = new Maple.App();
65 | app.InitializeComponent();
66 | app.Run();
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/App.g.i.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "1941C7B2472A9C13376759CC6E6A8EF83F1A733F2EB5A63CC993B9F5FC670FA3"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple {
36 |
37 |
38 | ///
39 | /// App
40 | ///
41 | public partial class App : System.Windows.Application {
42 |
43 | ///
44 | /// InitializeComponent
45 | ///
46 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
47 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
48 | public void InitializeComponent() {
49 |
50 | #line 5 "..\..\App.xaml"
51 | this.StartupUri = new System.Uri("MainWindow.xaml", System.UriKind.Relative);
52 |
53 | #line default
54 | #line hidden
55 | }
56 |
57 | ///
58 | /// Application Entry Point.
59 | ///
60 | [System.STAThreadAttribute()]
61 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
62 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
63 | public static void Main() {
64 | Maple.App app = new Maple.App();
65 | app.InitializeComponent();
66 | app.Run();
67 | }
68 | }
69 | }
70 |
71 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/DesignTimeResolveAssemblyReferences.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/DesignTimeResolveAssemblyReferences.cache
--------------------------------------------------------------------------------
/Maple/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
--------------------------------------------------------------------------------
/Maple/obj/Debug/MainWindow.baml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/MainWindow.baml
--------------------------------------------------------------------------------
/Maple/obj/Debug/MainWindow.g.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6CF7D272A9657B364819FCF48ACCD8B64ED664760613214D6B45CCDB096C548E"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple {
36 |
37 |
38 | ///
39 | /// MainWindow
40 | ///
41 | public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 |
44 | #line 17 "..\..\MainWindow.xaml"
45 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
46 | internal System.Windows.Media.ImageBrush ImageBrushData;
47 |
48 | #line default
49 | #line hidden
50 |
51 | private bool _contentLoaded;
52 |
53 | ///
54 | /// InitializeComponent
55 | ///
56 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
57 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
58 | public void InitializeComponent() {
59 | if (_contentLoaded) {
60 | return;
61 | }
62 | _contentLoaded = true;
63 | System.Uri resourceLocater = new System.Uri("/Maple;component/mainwindow.xaml", System.UriKind.Relative);
64 |
65 | #line 1 "..\..\MainWindow.xaml"
66 | System.Windows.Application.LoadComponent(this, resourceLocater);
67 |
68 | #line default
69 | #line hidden
70 | }
71 |
72 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
73 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
74 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
75 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
76 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
77 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
78 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
79 | switch (connectionId)
80 | {
81 | case 1:
82 |
83 | #line 8 "..\..\MainWindow.xaml"
84 | ((Maple.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.DataWindow_Closing);
85 |
86 | #line default
87 | #line hidden
88 | return;
89 | case 2:
90 | this.ImageBrushData = ((System.Windows.Media.ImageBrush)(target));
91 | return;
92 | }
93 | this._contentLoaded = true;
94 | }
95 | }
96 | }
97 |
98 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/MainWindow.g.i.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\MainWindow.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6CF7D272A9657B364819FCF48ACCD8B64ED664760613214D6B45CCDB096C548E"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple {
36 |
37 |
38 | ///
39 | /// MainWindow
40 | ///
41 | public partial class MainWindow : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 |
44 | #line 17 "..\..\MainWindow.xaml"
45 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
46 | internal System.Windows.Media.ImageBrush ImageBrushData;
47 |
48 | #line default
49 | #line hidden
50 |
51 | private bool _contentLoaded;
52 |
53 | ///
54 | /// InitializeComponent
55 | ///
56 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
57 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
58 | public void InitializeComponent() {
59 | if (_contentLoaded) {
60 | return;
61 | }
62 | _contentLoaded = true;
63 | System.Uri resourceLocater = new System.Uri("/Maple;component/mainwindow.xaml", System.UriKind.Relative);
64 |
65 | #line 1 "..\..\MainWindow.xaml"
66 | System.Windows.Application.LoadComponent(this, resourceLocater);
67 |
68 | #line default
69 | #line hidden
70 | }
71 |
72 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
73 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
74 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
75 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
76 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
77 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
78 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
79 | switch (connectionId)
80 | {
81 | case 1:
82 |
83 | #line 8 "..\..\MainWindow.xaml"
84 | ((Maple.MainWindow)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.DataWindow_Closing);
85 |
86 | #line default
87 | #line hidden
88 | return;
89 | case 2:
90 | this.ImageBrushData = ((System.Windows.Media.ImageBrush)(target));
91 | return;
92 | }
93 | this._contentLoaded = true;
94 | }
95 | }
96 | }
97 |
98 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.Properties.Resources.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.Properties.Resources.resources
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.csproj.CopyComplete:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.csproj.CopyComplete
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.csproj.FileListAbsolute.txt:
--------------------------------------------------------------------------------
1 | C:\Users\cubma\source\repos\Maple\Maple\bin\Debug\Maple.exe.config
2 | C:\Users\cubma\source\repos\Maple\Maple\bin\Debug\Maple.exe
3 | C:\Users\cubma\source\repos\Maple\Maple\bin\Debug\Maple.pdb
4 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.csprojAssemblyReference.cache
5 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\MainWindow.g.cs
6 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\App.g.cs
7 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple_MarkupCompile.cache
8 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple_MarkupCompile.lref
9 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\MainWindow.baml
10 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.g.resources
11 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.Properties.Resources.resources
12 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.csproj.GenerateResource.cache
13 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.exe
14 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.pdb
15 | C:\Users\cubma\source\repos\Maple\Maple\bin\Debug\IronOcr.dll
16 | C:\Users\cubma\source\repos\Maple\Maple\bin\Debug\IronOcr.xml
17 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Maple.csproj.CopyComplete
18 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Windows\MapCreator.g.cs
19 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Windows\StatisticsViewer.g.cs
20 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Windows\MapCreator.baml
21 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\Windows\StatisticsViewer.baml
22 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.csproj.GenerateResource.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.csproj.GenerateResource.cache
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.csprojAssemblyReference.cache:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.csprojAssemblyReference.cache
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.exe
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.g.resources:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.g.resources
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple.pdb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Maple.pdb
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple_Content.g.i.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | [assembly: System.Windows.Resources.AssemblyAssociatedContentFileAttribute("images/maple.sln")]
12 |
13 |
14 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple_MarkupCompile.cache:
--------------------------------------------------------------------------------
1 | Maple
2 |
3 |
4 | winexe
5 | C#
6 | .cs
7 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\
8 | Maple
9 | none
10 | false
11 | DEBUG;TRACE
12 | C:\Users\cubma\source\repos\Maple\Maple\App.xaml
13 | 3-1898261
14 |
15 | 19736676295
16 | 17-1641455387
17 | MainWindow.xaml;Windows\MapCreator.xaml;Windows\StatisticsViewer.xaml;
18 |
19 | False
20 |
21 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple_MarkupCompile.i.cache:
--------------------------------------------------------------------------------
1 | Maple
2 |
3 |
4 | winexe
5 | C#
6 | .cs
7 | C:\Users\cubma\source\repos\Maple\Maple\obj\Debug\
8 | Maple
9 | none
10 | false
11 | DEBUG;TRACE
12 | C:\Users\cubma\source\repos\Maple\Maple\App.xaml
13 | 3-1898261
14 |
15 | 20-1236747041
16 | 17-1641455387
17 | MainWindow.xaml;Windows\MapCreator.xaml;Windows\StatisticsViewer.xaml;
18 |
19 | False
20 |
21 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Maple_MarkupCompile.lref:
--------------------------------------------------------------------------------
1 |
2 |
3 | FC:\Users\cubma\source\repos\Maple\Maple\MainWindow.xaml;;
4 | FC:\Users\cubma\source\repos\Maple\Maple\Windows\MapCreator.xaml;;
5 | FC:\Users\cubma\source\repos\Maple\Maple\Windows\StatisticsViewer.xaml;;
6 |
7 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/MapCreator.baml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Windows/MapCreator.baml
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/MapCreator.g.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\..\Windows\MapCreator.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6BAEEB39FC9224DDAC248FE4E4BD153CAD42C6F5E9081CFEF6523788D00AD1D3"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple.Windows;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple.Windows {
36 |
37 |
38 | ///
39 | /// MapCreator
40 | ///
41 | public partial class MapCreator : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 |
44 | #line 17 "..\..\..\Windows\MapCreator.xaml"
45 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
46 | internal System.Windows.Media.ImageBrush ImageBrushData;
47 |
48 | #line default
49 | #line hidden
50 |
51 |
52 | #line 22 "..\..\..\Windows\MapCreator.xaml"
53 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
54 | internal System.Windows.Controls.Button RecordRope;
55 |
56 | #line default
57 | #line hidden
58 |
59 |
60 | #line 23 "..\..\..\Windows\MapCreator.xaml"
61 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
62 | internal System.Windows.Controls.Button RecordPlatformEdge;
63 |
64 | #line default
65 | #line hidden
66 |
67 | private bool _contentLoaded;
68 |
69 | ///
70 | /// InitializeComponent
71 | ///
72 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
73 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
74 | public void InitializeComponent() {
75 | if (_contentLoaded) {
76 | return;
77 | }
78 | _contentLoaded = true;
79 | System.Uri resourceLocater = new System.Uri("/Maple;component/windows/mapcreator.xaml", System.UriKind.Relative);
80 |
81 | #line 1 "..\..\..\Windows\MapCreator.xaml"
82 | System.Windows.Application.LoadComponent(this, resourceLocater);
83 |
84 | #line default
85 | #line hidden
86 | }
87 |
88 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
89 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
90 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
91 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
92 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
93 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
94 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
95 | switch (connectionId)
96 | {
97 | case 1:
98 |
99 | #line 7 "..\..\..\Windows\MapCreator.xaml"
100 | ((Maple.Windows.MapCreator)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.DataWindow_Closing);
101 |
102 | #line default
103 | #line hidden
104 | return;
105 | case 2:
106 | this.ImageBrushData = ((System.Windows.Media.ImageBrush)(target));
107 | return;
108 | case 3:
109 | this.RecordRope = ((System.Windows.Controls.Button)(target));
110 | return;
111 | case 4:
112 | this.RecordPlatformEdge = ((System.Windows.Controls.Button)(target));
113 | return;
114 | }
115 | this._contentLoaded = true;
116 | }
117 | }
118 | }
119 |
120 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/MapCreator.g.i.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\..\Windows\MapCreator.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "6BAEEB39FC9224DDAC248FE4E4BD153CAD42C6F5E9081CFEF6523788D00AD1D3"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple.Windows;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple.Windows {
36 |
37 |
38 | ///
39 | /// MapCreator
40 | ///
41 | public partial class MapCreator : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 |
44 | #line 17 "..\..\..\Windows\MapCreator.xaml"
45 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
46 | internal System.Windows.Media.ImageBrush ImageBrushData;
47 |
48 | #line default
49 | #line hidden
50 |
51 |
52 | #line 22 "..\..\..\Windows\MapCreator.xaml"
53 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
54 | internal System.Windows.Controls.Button RecordRope;
55 |
56 | #line default
57 | #line hidden
58 |
59 |
60 | #line 23 "..\..\..\Windows\MapCreator.xaml"
61 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields")]
62 | internal System.Windows.Controls.Button RecordPlatformEdge;
63 |
64 | #line default
65 | #line hidden
66 |
67 | private bool _contentLoaded;
68 |
69 | ///
70 | /// InitializeComponent
71 | ///
72 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
73 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
74 | public void InitializeComponent() {
75 | if (_contentLoaded) {
76 | return;
77 | }
78 | _contentLoaded = true;
79 | System.Uri resourceLocater = new System.Uri("/Maple;component/windows/mapcreator.xaml", System.UriKind.Relative);
80 |
81 | #line 1 "..\..\..\Windows\MapCreator.xaml"
82 | System.Windows.Application.LoadComponent(this, resourceLocater);
83 |
84 | #line default
85 | #line hidden
86 | }
87 |
88 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
89 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
90 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
91 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
92 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
93 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
94 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
95 | switch (connectionId)
96 | {
97 | case 1:
98 |
99 | #line 7 "..\..\..\Windows\MapCreator.xaml"
100 | ((Maple.Windows.MapCreator)(target)).Closing += new System.ComponentModel.CancelEventHandler(this.DataWindow_Closing);
101 |
102 | #line default
103 | #line hidden
104 | return;
105 | case 2:
106 | this.ImageBrushData = ((System.Windows.Media.ImageBrush)(target));
107 | return;
108 | case 3:
109 | this.RecordRope = ((System.Windows.Controls.Button)(target));
110 | return;
111 | case 4:
112 | this.RecordPlatformEdge = ((System.Windows.Controls.Button)(target));
113 | return;
114 | }
115 | this._contentLoaded = true;
116 | }
117 | }
118 | }
119 |
120 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/StatisticsViewer.baml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/cubman3134/MapleStoryBot/ad87ced536cfd9739a4e7061e3c11ff3f0c70ef3/Maple/obj/Debug/Windows/StatisticsViewer.baml
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/StatisticsViewer.g.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\..\Windows\StatisticsViewer.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81AA8F844F1A241B87F095D4E66C37BC17BBC9710D8A65C4753BEA5D07AD0A70"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple.Windows;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple.Windows {
36 |
37 |
38 | ///
39 | /// StatisticsViewer
40 | ///
41 | public partial class StatisticsViewer : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 | private bool _contentLoaded;
44 |
45 | ///
46 | /// InitializeComponent
47 | ///
48 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
49 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
50 | public void InitializeComponent() {
51 | if (_contentLoaded) {
52 | return;
53 | }
54 | _contentLoaded = true;
55 | System.Uri resourceLocater = new System.Uri("/Maple;component/windows/statisticsviewer.xaml", System.UriKind.Relative);
56 |
57 | #line 1 "..\..\..\Windows\StatisticsViewer.xaml"
58 | System.Windows.Application.LoadComponent(this, resourceLocater);
59 |
60 | #line default
61 | #line hidden
62 | }
63 |
64 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
65 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
66 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
67 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
68 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
69 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
70 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
71 | this._contentLoaded = true;
72 | }
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/Maple/obj/Debug/Windows/StatisticsViewer.g.i.cs:
--------------------------------------------------------------------------------
1 | #pragma checksum "..\..\..\Windows\StatisticsViewer.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "81AA8F844F1A241B87F095D4E66C37BC17BBC9710D8A65C4753BEA5D07AD0A70"
2 | //------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Runtime Version:4.0.30319.42000
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | //------------------------------------------------------------------------------
11 |
12 | using Maple.Windows;
13 | using System;
14 | using System.Diagnostics;
15 | using System.Windows;
16 | using System.Windows.Automation;
17 | using System.Windows.Controls;
18 | using System.Windows.Controls.Primitives;
19 | using System.Windows.Data;
20 | using System.Windows.Documents;
21 | using System.Windows.Ink;
22 | using System.Windows.Input;
23 | using System.Windows.Markup;
24 | using System.Windows.Media;
25 | using System.Windows.Media.Animation;
26 | using System.Windows.Media.Effects;
27 | using System.Windows.Media.Imaging;
28 | using System.Windows.Media.Media3D;
29 | using System.Windows.Media.TextFormatting;
30 | using System.Windows.Navigation;
31 | using System.Windows.Shapes;
32 | using System.Windows.Shell;
33 |
34 |
35 | namespace Maple.Windows {
36 |
37 |
38 | ///
39 | /// StatisticsViewer
40 | ///
41 | public partial class StatisticsViewer : System.Windows.Window, System.Windows.Markup.IComponentConnector {
42 |
43 | private bool _contentLoaded;
44 |
45 | ///
46 | /// InitializeComponent
47 | ///
48 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
49 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
50 | public void InitializeComponent() {
51 | if (_contentLoaded) {
52 | return;
53 | }
54 | _contentLoaded = true;
55 | System.Uri resourceLocater = new System.Uri("/Maple;component/windows/statisticsviewer.xaml", System.UriKind.Relative);
56 |
57 | #line 1 "..\..\..\Windows\StatisticsViewer.xaml"
58 | System.Windows.Application.LoadComponent(this, resourceLocater);
59 |
60 | #line default
61 | #line hidden
62 | }
63 |
64 | [System.Diagnostics.DebuggerNonUserCodeAttribute()]
65 | [System.CodeDom.Compiler.GeneratedCodeAttribute("PresentationBuildTasks", "4.0.0.0")]
66 | [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
67 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes")]
68 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")]
69 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")]
70 | void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) {
71 | this._contentLoaded = true;
72 | }
73 | }
74 | }
75 |
76 |
--------------------------------------------------------------------------------
/Maple/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/MaplestoryBotArduinoKeyboard/MaplestoryBotArduinoKeyboard.ino:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | // this is the keyboard unit
4 | #define SLAVE_ADDR 9
5 | #define ANSWERSIZE 10
6 | void setup() {
7 | // put your setup code here, to run once:
8 | Wire.begin(SLAVE_ADDR);
9 | Wire.onReceive(receiveEvent);
10 | Serial.begin(9600);
11 | Keyboard.begin();
12 | }
13 |
14 | void receiveEvent() {
15 | byte curByte;
16 | char curChar;
17 | String curMessage = "";
18 | Serial.write("received data");
19 | while (Wire.available() > 0)
20 | {
21 | curByte = Wire.read();
22 | curChar = (char)curByte;
23 | //Serial.write(curChar);
24 | curMessage += curChar;
25 | }
26 | String keyString;
27 | int keyStringInt;
28 | //if (curMessage.length() == ANSWERSIZE)
29 | //{
30 | keyString = curMessage.substring(7);
31 | keyStringInt = keyString.toInt();
32 | char keyStringChar = keyStringInt;
33 | char charArray[keyString.length()];
34 | keyString.toCharArray(charArray, keyString.length());
35 | Serial.print(charArray);
36 | String curProcess = curMessage.substring(0, 7);
37 | char otherCharArray[curProcess.length() + 1];
38 | curProcess.toCharArray(otherCharArray, curProcess.length());
39 | //Serial.print(otherCharArray);
40 | if (curProcess == "KEYDOWN")
41 | {
42 | Keyboard.press(keyStringChar);
43 | }
44 | else if (curProcess == "KEYLIFT")
45 | {
46 | Keyboard.release(keyStringChar);
47 | }
48 | //}
49 |
50 | }
51 |
52 | void loop() {
53 | // put your main code here, to run repeatedly:
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/MaplestoryBotArduinoKeyboard/Pro_micro_build.bat.txt:
--------------------------------------------------------------------------------
1 | @rem ------------------------------------------------------------------------------------------------------------------------
2 | @rem Arduino build from command line.
3 | @rem 24/07/2020 Modified for SparkFun Pro Micro
4 | @rem
5 | @rem This uses arduino_debug.exe to compile the sketch, then avrdude to load it to the Pro Micro. When prompted, press
6 | @rem the Pro Micro's reset button (that you connected).
7 | @rem
8 | @rem Put this file in the Arduino project folder (with MyProg.ino)
9 | @rem
10 | @rem The board type is correct for the Pro-Micro but you'll need to edit the port, Arduino.exe location, Avrdude location.
11 | @rem
12 | @rem The port is the bootload port which appears in Device Manager only briefly after you reset the Pro-Micro. Connecting
13 | @rem reset twice quickly makes that port stay around for a few seconds longer. Even with that, sometimes Windows is not
14 | @rem quick enough to show it.
15 | @rem
16 | @rem Arduino build: https://github.com/arduino/Arduino/blob/master/build/shared/manpage.adoc
17 | @Rem
18 | @rem Pro micro: https://learn.sparkfun.com/tutorials/pro-micro--fio-v3-hookup-guide
19 | @rem
20 | @rem Tested on Windows-XP and Windows-10.
21 | @rem ------------------------------------------------------------------------------------------------------------------------
22 |
23 | echo off
24 | setlocal EnableDelayedExpansion
25 | set "startTime=%time: =0%"
26 |
27 | @rem ------ edited-settings... --------------------------------------------------------------------
28 |
29 | @rem Arduino Board Type
30 | @REM ==================
31 | @rem SparkFun Pro Micro
32 | set brd=SparkFun:avr:promicro:cpu=16MHzatmega32U4
33 |
34 | @rem Port name
35 | @rem =========
36 | set prt=COM9
37 |
38 | @rem Arduino software executable
39 | @rem
40 | @rem If there are spaces in the directory names, use dir/x in each to get the shortnames so
41 | @rem the path here doesn't have spaces in it.
42 | @rem
43 | set cmd=C:\Programs\Arduino\arduino_debug.exe
44 |
45 | @rem Avrdude location
46 | @rem ================
47 | @rem Windows-XP (use short path to avoid spaces)
48 | set avrdude=C:\DOCUME~1\RDL\LOCALS~1\APPLIC~1\ARDUIN~1\packages\arduino\tools\avrdude\6345AA~1.0-A
49 | @rem Windows-10
50 | set avrdude="C:\Programs\Arduino\hardware\tools\avr"
51 | @rem ------- ... edited-settings ------------------------------------------------------------------
52 |
53 |
54 |
55 | @rem ----------------------------------------------------------------------------------------------
56 | @rem Project folder (and file name)
57 | for /F "delims=\" %%A in ("%0%") do (
58 | set src=%%~nxA
59 | )
60 | set afl=C:%~sp0%src%.ino
61 | echo %afl%
62 | echo %brd% %prt%
63 |
64 | @rem ----------------------------------------------------------------------------------------------
65 | @rem Temporary files
66 | set tmp=%temp%\Arduino\%src%
67 | if not exist %tmp% mkdir %tmp%
68 |
69 | @rem ----------------------------------------------------------------------------------------------
70 | @rem Compile
71 |
72 | @%cmd% --board %brd% --preserve-temp-files --verify --pref build.path=%tmp% %afl%
73 |
74 | if %errorlevel% == 0 goto deliver
75 | echo "FAIL."
76 | pause
77 | exit /b
78 |
79 | @rem ----------------------------------------------------------------------------------------------
80 | :deliver
81 | @rem get the hex file from the temporary folder
82 | copy %tmp%\%src%.ino.hex .\
83 | echo .
84 | echo RESET THE PRO MICRO.
85 | echo .
86 | @rem use count to prevent infinite loop
87 | set /a count=0
88 |
89 | @rem ----------------------------------------------------------------------------------------------
90 | @rem wait for the port to appear.
91 | :loop
92 | mode > ports.lis
93 | @rem mode side-effect makes Ard lamp flash! (what about other serial devices?)
94 | findstr %prt% ports.lis
95 | if %errorlevel% == 0 goto do_load
96 | @rem 0 = not found, 1 = found
97 |
98 | set /a count=%count%+1
99 | echo Looking for %prt% %count%
100 |
101 | if %count% leq 100 goto loop
102 |
103 |
104 | echo Failed to find %prt%
105 | pause
106 | goto done_or_not
107 |
108 | :do_load
109 |
110 | @rem ----------------------------------------------------------------------------------------------
111 | @rem Load the hex file into the Pro Micro.
112 | %avrdude%\bin\avrdude.exe -C%avrdude%\etc\AVRDUD~1.CON -v -patmega32u4 -cavr109 -P%prt% -b57600 -D -Uflash:w:%src%.ino.hex:i
113 |
114 | goto postload
115 | :postload
116 |
117 | set "endTime=%time: =0%"
118 | @rem Get elapsed time:
119 | set "end=!endTime:%time:~8,1%=%%100)*100+1!" & set "start=!startTime:%time:~8,1%=%%100)*100+1!"
120 | set /A "elap=((((10!end:%time:~2,1%=%%100)*60+1!%%100)-((((10!start:%time:~2,1%=%%100)*60+1!%%100)"
121 | @rem Convert elapsed time to HH:MM:SS:CC format:
122 | set /A "cc=elap%%100+100,elap/=100,ss=elap%%60+100,elap/=60,mm=elap%%60+100,hh=elap/60+100"
123 | echo Elapsed: %hh:~1%%time:~2,1%%mm:~1%%time:~2,1%%ss:~1%%time:~8,1%%cc:~1%
124 | @rem
125 | pause done_or_not
126 | exit /b
127 | @rem ------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------
/MaplestoryBotArduinoMaster/MaplestoryBotArduinoMaster.ino:
--------------------------------------------------------------------------------
1 | #include
2 | // this is the master unit
3 | //SDA connects to Arduino Micro pin Labeled 2 (not A2) connect all 2
4 | //SCL connects to Arduino Micro, pin Labeled 3 (not A3) connect all 3
5 | //GND connects to GND connect all 3 gnd pins
6 | #define KEYBOARD_SLAVE_ADDR 9
7 | #define MOUSE_SLAVE_ADDR 10
8 | #define ANSWERSIZE 10
9 |
10 | String FullData;
11 | void setup()
12 | {
13 | Wire.begin();
14 | Serial.begin(9600);
15 | FullData = "";
16 | }
17 |
18 | char charData;
19 | //int curCharInt;
20 | void loop()
21 | {
22 | if (Serial.available() > 0)
23 | {
24 | charData = Serial.read();
25 | //Serial.print("got some data");
26 | //curCharInt = charData - '0';
27 | if (charData == '#')
28 | { // 4 is end character of our serial messages
29 | // transfer string to slave arduinos
30 | Serial.print("key was equal to 4.");
31 | if (FullData[0] == 'M')
32 | { // mouse message
33 | Wire.beginTransmission(MOUSE_SLAVE_ADDR);
34 | Serial.print("Writing to mouse.");
35 | }
36 | else
37 | { // keyboard message
38 | Wire.beginTransmission(KEYBOARD_SLAVE_ADDR);
39 | Serial.print("Writing to keyboard.");
40 | }
41 | char charArray[FullData.length() + 1];
42 | FullData.toCharArray(charArray, FullData.length());
43 | Serial.print(charArray);
44 | Wire.write(charArray);
45 | Wire.endTransmission();
46 | FullData = "";
47 | }
48 | else
49 | {
50 | FullData += charData;
51 | char charArray[FullData.length() + 1];
52 | FullData.toCharArray(charArray, FullData.length());
53 | Serial.print(charArray);
54 | }
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/MaplestoryBotArduinoMouse/MaplestoryBotArduinoMouse.ino:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | // this is the mouse unit
4 | #define SLAVE_ADDR 10
5 | #define ANSWERSIZE 10
6 | void setup() {
7 | // put your setup code here, to run once:
8 | Wire.begin(SLAVE_ADDR);
9 | Wire.onReceive(receiveEvent);
10 | Serial.begin(9600);
11 | }
12 |
13 | void receiveEvent() {
14 | byte curByte;
15 | char curChar;
16 | String curMessage = "";
17 | while (Wire.available() > 0)
18 | {
19 | curByte = Wire.read();
20 | curChar = (char)curByte;
21 | curMessage += curChar;
22 | }
23 | String xPosString, yPosString;
24 | int xPosInt, yPosInt;
25 | int startString;
26 | //if (curMessage.length() == ANSWERSIZE)
27 | //{
28 | if (curMessage.substring(0, 2) == "MV")
29 | {
30 | if (curMessage[2] == '0') {
31 | startString = 3;
32 | if (curMessage[3] == '0'){
33 | startString = 4;
34 | if (curMessage[4] == '0') {
35 | startString = 5;
36 | }
37 | }
38 | }
39 | else {
40 | startString = 2;
41 | }
42 | xPosString = curMessage.substring(startString, 6);
43 | if (curMessage[6] == '0') {
44 | startString = 7;
45 | if (curMessage[7] == '0'){
46 | startString = 8;
47 | if (curMessage[8] == '0') {
48 | startString = 9;
49 | }
50 | }
51 | }
52 | else {
53 | startString = 6;
54 | }
55 | yPosString = curMessage.substring(startString, 10);
56 | xPosInt = xPosString.toInt();
57 | yPosInt = yPosString.toInt();
58 | //char keyStringChar = keyStringInt;
59 | Mouse.move(xPosInt, yPosInt, 0);
60 | curMessage = "";
61 | }
62 | else if (curMessage == "MOUSELCLCK")
63 | {
64 | Serial.print("Left clicking mouse");
65 | Mouse.press(MOUSE_LEFT);
66 | curMessage = "";
67 | }
68 | else if (curMessage == "MOUSERCLCK")
69 | {
70 | Serial.print("Right clicking mouse");
71 | Mouse.press(MOUSE_RIGHT);
72 | curMessage = "";
73 | }
74 | else if (curMessage == "MOUSELRLAX")
75 | {
76 | Serial.print("Left releasing mouse");
77 | Mouse.release(MOUSE_LEFT);
78 | curMessage = "";
79 | }
80 | else if (curMessage == "MOUSERRLAX")
81 | {
82 | Serial.print("Right releasing mouse");
83 | Mouse.release(MOUSE_RIGHT);
84 | curMessage = "";
85 | }
86 | //}
87 |
88 | }
89 |
90 | void loop() {
91 | // put your main code here, to run repeatedly:
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # MapleStoryBot
2 |
--------------------------------------------------------------------------------