From 1a03890095ce78fb0eae0249822c6960217e00ba Mon Sep 17 00:00:00 2001 From: davpapp Date: Thu, 15 Feb 2018 06:27:12 -0500 Subject: [PATCH] Refactoring. Starting work with OpenCV --- bin/Cursor.class | Bin 7025 -> 7551 bytes bin/CursorDataFileParser.class | Bin 3297 -> 3299 bytes bin/CursorPath.class | Bin 5642 -> 5737 bytes bin/CursorPathTest.class | Bin 3602 -> 4044 bytes bin/CursorPoint.class | Bin 1908 -> 1881 bytes bin/CursorPointTest.class | Bin 2209 -> 2620 bytes bin/CursorTest.class | Bin 3116 -> 3376 bytes bin/OpenCVTest.class | Bin 0 -> 576 bytes bin/main.class | Bin 1094 -> 463 bytes src/Cursor.java | 53 ++++++++++----------- src/CursorDataFileParser.java | 10 ++-- src/CursorPath.java | 52 ++++++++++++-------- src/CursorPathTest.java | 84 +++++++++++++++++---------------- src/CursorPoint.java | 14 +++--- src/CursorPointTest.java | 31 +++++++++--- src/CursorTest.java | 28 +++++++---- src/OpenCVTest.java | 11 +++++ src/main.java | 4 +- 18 files changed, 172 insertions(+), 115 deletions(-) create mode 100644 bin/OpenCVTest.class create mode 100644 src/OpenCVTest.java diff --git a/bin/Cursor.class b/bin/Cursor.class index b72457658e1ff804222e7828215b400b993b882e..8dcf495416d22c5e3ffa0c0ceaa10079c9ed4581 100644 GIT binary patch literal 7551 zcmbtZ33wdmS$_Z3O1oN*Wm%GCDUxj2u^nk;S&8Gsv1B{eVcCi$*_GrgJ*=^IByF>o30c-17i#Q%52QDOB|5vpG8(L0F;s9`l0Pl`_*aUB}Pg zV@){bB>vIPMN8^RR%;KQK%ak8XX!r zIdZOlc&Pu_x#7d3M<$MP4)ZeCduG+SZz_~$?ejL(RS#KPPoH__B<-#f*<{)oce0i_ z*AvAKh58}lNSdkSeaZAptLu(kyLQFUhIj<+46lZ=e5-*D>{N(kL|Q6M1#Pa~Ix#4o zvU=K2MX^g^N7t-9XLThqW+u~hWY*3(BX&M#bxqlJHj$(=t=ukW-iblsW&^i~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n?+grfT|tx; zKCy`A-h4#ISNAZ(j}P*L8_IvKzC>ZKk9i^7O@KX2xnV-?Vbbn%U5ZhLpoQ+T1y8sg zr7TUeCIJ}hzJkx4=jEC6*YL#`3s90&zyuR#zYFIzmL>%kVz<6Pt9iP} zl&FArDC=|~jukF#LK>dmxJjRJx>rh}4*Rg03s}$Mkiwec zU9h4&alU?m{x0F-1?apzcLAZ`r9d%s%iZuCqgxNKLmcw~M-{MC3{7jLH=GUC4x`HB zR$AIs-~R$u$U}qn%=2aV-a%vda9c}pTZqI#QsLgCa9ar1e$hp3ZwUOOGOFoAZ7D@< zA`WLxg*vWK+Z3-C(V(8{`zu3RKIpbm=v4%L0pBI0Hv)Xmt)4!970N>bTps&5A6iJE zX;>^|w_mxvJgXn7sQmpxR`)6AWamxAJobp6uc-V3&KF+MUuH>2eNK9O>>6K0Lr=cs z$Jp3^$Tzp%|8*HZzK&OpG+tf8l4381YmGn6;dQ>Uq^{-g^BjInxyHA6FCTNxGQS={ xl-+tg9>pks%pJtzu6bUGO)6qqXwo0t5|hkpkj798Hfhxt>iFz)9{{<)s|4RS> diff --git a/bin/CursorPathTest.class b/bin/CursorPathTest.class index ff407ad82629069a8c7e424863476c2ad5521223..09bb02e57cfca7090f13aa325702f85d6b1076d6 100644 GIT binary patch literal 4044 zcmai0S#uoK75-Y9p0-A9S+*8yBmuU(jWz}xB!fnlEqiP{L5q@s7g_J%xfO=3-X$(JS7$9JGWc2U{}Rub@$wR&iTHx z+;i?<|NFt80gT`S0}UElj<0%U*E?&v(~1ZvY*n>H18}GEq~RsHSD>Y%=lClE;T`o=(tmK{0R+>iT(u* zk>hUOj-e4-O*A2uo6pGKS7JX;MUU13|Eld`Ru5bB{TjXBvlN8ahqv z6khE@+p!AHOLo#CW}T@!n;k0C4CmzbdTO$#+?OBpzzAyy?A!+!Le7!VKI@=m!_u-3v|*D3mC z@o>n*Fz#n4>H|0LTb^H@^k+S1$tg0fiJDla`WHm?0TU03>aeJuDCV8wQjPU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c50c44ec30e0f770012e976853..630dceb796ff934f57861f28730689a7216ebe88 100644 GIT binary patch delta 644 zcmZXQPj3=Y6vfYD7^u?;D2PZD4Sr1?SD>XGxf;KdZf-c{p?q1TLhRWEI{Y;#@3G%oU2uIS7A=!#i0HZoCRE~;3ZO9wYiy)|Qhv?$9xe{toQG1DS%SV%yN27HgzVh$`*1YDZx4 z;cp8p1_)O=6Yd?ba(~E8Ah?AXf9OdKOgQ0T#BiEICFt-|Uyt*PXOZErJp)u@*OOwC vFTDHpb34eE1Gz2Ciu^9F1g>>a5H|>Y^Op{i?qZ>fWj^Cgc<)hD7w-QA*a?rz delta 644 zcmXYt%Wo1<6vn?h!vIbvjG%EysfKDT1BLQvtCeb7?NGI%R$CwVDkBi=3lcz0H*VQA zsW)-qpJ5u>w5AIaH|~w`A8=>l!nN^Sn8m&G-S2+qcg~%kzP~>8+rNV&028ox)Gvd2 zwbHUyn=QLms?0a)n+(Uz{M_qCv))*&uhv>qJHIj^_L9L%!R1$#mdzlWQA@=D&TAOv zV{C!N_&fIYbVkD%#_76LZ!)+{tCzZ<;UdO)Kw3L9gR36QQj0bFjh)=EYt`h^R7%-K;SyTB9@4saW8C?7Uft&^JQ;@7L& z!WIX;E$lQ;xD7((+^Lz#F3Lazmk1%#Nk^8Hm~RS~9ej@9;?e#?u!7(SaA*%vzUxj| zSKxDUMdw|aPnbT0RS3-Q;fBa}a4T@PgL|S*=;fY1LAry79X#QtC+1n977~j80pVDF AhyVZp diff --git a/bin/CursorPointTest.class b/bin/CursorPointTest.class index dc274bfa31fbf537a187eb24d52e5448d474b52c..c9a74ab0bbda8fb03922ff7ac8313682e9c05084 100644 GIT binary patch delta 1455 zcmZvcUu;uV9LK-6_fNZWg?20Jx>eX_%UZgU$)vKvD6kGTL>Ti@U;$=bx=}Z$wwlTNbuUv8>NMU1SK{R&zbk7!O0d;pK+>C$=8eX!jAzR zX@n#+v&jG0TIT1==dW+L`jeJ<_}wo*Xj30*neRWnm$>`&B`xzu*I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Hix|ZSA-ILpq~pEdiy)g;uobFD(gwmkVc+kRUDc+vk9WZWnrt$X!NwhIC8MTUwQi zE)4RScB?Mg^zYUYr(}l;8!LOJ$K>YmP&kr9sRup}Dsnjb5jCN3)QAKNB3{`Dh4w>{ z-A$4GNYvcauou$b%QZv2D8?w0gQG!(*L=n@U*ewDs9N@nqJi>9r$fy+e&`4!L z0JCVKvhp$}xIYG&JDc@MrF%J^!>Lx8*-r~$i+a#5gu;j+RIj{=&NUQ^-{cxp`3+<% zyYt!@x35DJBI%~uw-j3L65&xL-L67U6`t`NRkGjxx4_(BSyni?HnJU{jO~FItGNLb(DAo1Py-*Ab9O0q~(W&Yu{X^o!=_3_Zh{F3$G)iAQ{#3nnS$cFxnAe ze^HKW1I9QEY4){39&brvn+(LzjKjfoXK!e}m_t*BjlH3HEy%@%{{T z-5?fCbYqyq6(+M2;zLK=DqhhoM@#agkuqdVozF}OUg%ZMv&1rdEOV53gt|s$LqD|@ MQaSB$N((0b0ghwA=Kufz diff --git a/bin/CursorTest.class b/bin/CursorTest.class index c5850dcb35e6b3f6cbc1583f708c80ae223cc1ca..dee61fce8b8019bcd06929f97fbc18a9f7442e53 100644 GIT binary patch literal 3376 zcma)8Yf~H78GaVsKv@IA0)t}=Zekk=uyV1J#w0cv>y0+tMm0=SnMCHN%lUM?e7-((qr;U@y;W62?#|^{=CMPos@zI6XG+z?=NfTej zQ!JLEDtSs(^X{Bgv@M6579E(#ObGZ96HntA?o3JT0nWff15-O=j_jU`pR*WCVAMeW z-lUCHtIE^FnmC7X){LcB&c9r<%0v?zn3xdk7Xs|@v;VCB@OMY#@*W(3XBNcZiixXYaA0Nc z0u-I=CSJgc0jaD8PdR>A6td;4l!46doLcZTSP8te<7m&XSADf&ViC+W;?`)|85r7b zZq}o(dEZmk%18o4d|<2IxokV7b2YnMR9-VmOeX-)ubiSP_SY)?uG61H5w?`iP5KSf z)h#73AIU7Vu)xYDR^X7YH9nJKQ!()}JRVuAQlUQ{mVwDIp>5`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mQ31?KO_3 zZO?Swa?vxFs#!Ip=E}Bbt(gl}$zoY!w(WR^0;{1T>$uB9cgie=zeS7wLq^dWQdK4h zrdvl75@H?F(JQpIzXg`;%joErea*6O&RSma#tT+{)h|Lrt1RbMOwTxHdK;!`Uv@0p zBX5T_)K_^^iwO+kh#b~Y4bk4|>AnS_?YNE;I7yP1%{Ro+aG*E)YM7Dj^S+4$PT@=( zr!{oFx&E^U9t$oY)(7+ur${L@sY#B0;rx19okzM$iZK<`*LUF-IJ-(|WqZI3&Q zk@qea47sY&q6k3pT-R|!Ang%I{`OZyzms~nrQcyNtZYBMmC4Gw&6N%v=iQsckVYn{J-f z8_R4Yr?9G{fHhu!e^<_xJdxh(B8*+@k~ZhaMdHklt8N{S#H%!_T09MP^PZ7koiU0* z-$_VRT}Ig$c7K{9FO11dd@8AF#L<9KwgRLiA|I zN3_E9tH)VdQXPBmmJ{d_TC^3uk>maSRpd$hkizc=vol!X_r%5k%DlQ?lamJ&@OLDo_DD&RJB&`^;&*D6- zIHU5Lww-_c6(}dC$f_`_)Keu^2`E|NRY@pWr8S~xol>+;`Ls@vR#G)pkM^PQ5U~4uT{4}1&Z=I zmC`ryv5Y*+Ss6F+$!unjvrlV4Ta~oON&f@^O!7d_Q~Vbcu#6un0LGvJFtL1KZKU}s z$(9br&*eMAx%PHA7YQfJv@?V=OE{PQ2ONIJctfQTtrDaF?9TK*!Od?5Y=BCROy(vBju z_pH3;$2Gv<1sKwY`Uv425!|3=Z*D=5t`?l;t@aV5s|eC?w<2gG0u3di2*LXgv(QER diff --git a/bin/OpenCVTest.class b/bin/OpenCVTest.class new file mode 100644 index 0000000000000000000000000000000000000000..33d43cbccbbdcffdabb25b69146310c85ee175d3 GIT binary patch literal 576 zcmZ`$Jx>Bb5Pi$naVH9*pmt{m6jIrUu_0Qa6d;MQT8<4aId(653yJ^9#)?D}?fp^4 zIYPKbn%SLsv+wP^`T70$0&s~l2N?#h9|_eR4Ml7n6DAYUM{pljJ@k75E-5qlI%n|lfS nl({%SnJUTS7EvaB-X|(g)#?hz-;`yLGB|673{@FU*4XJEK6{B6 literal 0 HcmV?d00001 diff --git a/bin/main.class b/bin/main.class index e1f966c89b717780c504900c62e6978bd93f08ec..8317e8f62e53f58b6c02c476d25133054b1f002b 100644 GIT binary patch delta 81 zcmX@cah{p$)W2Q(7#J8#8Kfq1eVsgkNq#aXbG4Z^P>2zPHv$PJ1}-4U1{RQH;0CgJ RAd(DX4B{X~3=&{fk^sN63gQ3& literal 1094 zcmZuv?M@Rx6g^W~wp|t}l-42@D=3z)R#e1LM3E0I7BFdpQGYG%3JcraX1hi4O?(1> z>klxJ_yE3zFM^(Fp_GJ8c4qFKJNMjs?)h{2>o|B^4umuW&?(T9H*I61UfDL>qP}ez0)2U>q+46M zYfAgf>GyWc8nfjkR#qUE`jEc>D|oJH?_?!_y7IYXR6WzNYYKV=qKzp1lb2b1TWsAa zhzJZ_B*@vG;kxyzXO!Dwq5_ddjOk=@n{5}@S;a~3p1JZd@ zAe6HY4BKTqH1};STPS3$xaWU#(kKgS7V{+{2iH)FpZg zhc(ZrXc)%?qntXKjy4Hlt#8PNM@|gAk_}=?V6c@o`H^|k$(2ggJ0xZ4bXr9Q(+cjl z_1gAc!vj1NP^vPeWfLWJ74Nd+84ZsyE0ACeEskMfzba#jHh+H8GGF@tnN+5WS z%4s!ya#{k~nO|DeR>(Xbnm|`ufdbtHPcQAS>(w(=ss*R+mW)+X>NX^$nU;FtfH{;# zD?Xm6bFK>Q40pjjFn)~ScOHCDxyoxWpo^>44B*~PE5wLv{Cju~GG!Qj=x?Mtrsb!1 z?gX)S$B5@oFu;9q{R9c_LmN{^xW#|?D|&xmv~ThV>B$K?9`)nNPt1M$_m{6b8u+8c z0nvj*4HGxcHGy7?5N!exOe2a})*$N}Z=&Kk7HI`3j~7^C&0*dwV}-TGF^pBbWbRjt W=z;GPaRo620}2vxhUVz@VeLQRF7)^S diff --git a/src/Cursor.java b/src/Cursor.java index 1d70c4d..78b00bd 100644 --- a/src/Cursor.java +++ b/src/Cursor.java @@ -18,14 +18,10 @@ import java.util.regex.Pattern; public class Cursor { - public static final int NUMBER_OF_DISTANCES = 1000; + public static final int NUMBER_OF_DISTANCES = 2203; // For 1080p screen public static final int MINIMUM_CLICK_LENGTH = 120; public static final int MAXIMUM_CLICK_LENGTH = 240; - public static final int GAME_WINDOW_OFFSET_WIDTH = 100; // top left corner of main game screen, from top left corner of screen - public static final int GAME_WINDOW_OFFSET_HEIGHT = 81; - - private Robot robot; private Randomizer randomizer; private Random random; @@ -96,38 +92,39 @@ public class Cursor { leftClickCursor(); } + public void moveAndRightClickAtCoordinates(Point goalPoint) throws InterruptedException { + moveCursorToCoordinates(goalPoint); + rightClickCursor(); + } + public Point moveAndLeftClickAtCoordinatesWithRandomness(Point goalPoint, int xTolerance, int yTolerance) throws InterruptedException { Point randomizedGoalPoint = randomizePoint(goalPoint, xTolerance, yTolerance); moveCursorToCoordinates(randomizedGoalPoint); leftClickCursor(); - return randomizedGoalPoint; // Return the point in case we need precise movement afterwards - } - - public void moveAndRightClickAtCoordinates(Point goalPoint) throws InterruptedException { - moveCursorToCoordinates(goalPoint); - rightClickCursor(); + return randomizedGoalPoint; // Return the point we moved to in case we need precise movement afterwards } public Point moveAndRightlickAtCoordinatesWithRandomness(Point goalPoint, int xTolerance, int yTolerance) throws InterruptedException { Point randomizedGoalPoint = randomizePoint(goalPoint, xTolerance, yTolerance); moveCursorToCoordinates(randomizedGoalPoint); rightClickCursor(); - return randomizedGoalPoint; // Return the point in case we need precise movement afterwards + return randomizedGoalPoint; // Return the point we moved to in case we need precise movement afterwards } public void moveCursorToCoordinates(Point goalPoint) throws InterruptedException { Point startingPoint = getCurrentCursorPoint(); int distanceToMoveCursor = getDistanceBetweenPoints(startingPoint, goalPoint); + double angleToRotateCursorPathTo = getThetaBetweenPoints(startingPoint, goalPoint); + System.out.println("R:" + distanceToMoveCursor + ", theta:" + angleToRotateCursorPathTo); if (distanceToMoveCursor == 0) { return; } - double angleToMoveCursor = getThetaBetweenPoints(startingPoint, goalPoint); - CursorPath cursorPathToFollow = chooseCursorPathToFollowBasedOnDistance(distanceToMoveCursor); - - double angleToTranslatePathBy = angleToMoveCursor - cursorPathToFollow.getCursorPathTheta(); - - followCursorPath(startingCursorPoint, angleToTranslatePathBy, cursorPathToFollow); + CursorPath cursorPathWithDistanceSet = chooseCursorPathToFollowBasedOnDistance(distanceToMoveCursor); + CursorPath cursorPathWithDistanceAndAngleSet = cursorPathWithDistanceSet.getRotatedCopyOfCursorPath(angleToRotateCursorPathTo); + System.out.println("Rotated the points: "); + //cursorPathWithDistanceAndAngleSet.displayCursorPoints(); + followCursorPath(cursorPathWithDistanceAndAngleSet, startingPoint); } public int getDistanceBetweenPoints(Point startingPoint, Point goalPoint) { @@ -135,14 +132,14 @@ public class Cursor { } public double getThetaBetweenPoints(Point startingPoint, Point goalPoint) { - return Math.atan2(goalPoint.x - startingPoint.x, goalPoint.y - startingPoint.y); + return Math.atan2((goalPoint.x - startingPoint.x), (goalPoint.y - startingPoint.y)); } - private void followCursorPath(Point startingCursorPoint, double angleToTranslatePathBy, CursorPath cursorPathToFollow) throws InterruptedException { - for (CursorPoint untranslatedCursorPoint : cursorPathToFollow.getCursorPathPoints()) { - Point translatedPointToClick = translatePoint(startingCursorPoint, angleToTranslatePathBy, untranslatedCursorPoint); + private void followCursorPath(CursorPath cursorPathToFollow, Point startingPoint) throws InterruptedException { + for (CursorPoint cursorPoint : cursorPathToFollow.getCursorPathPoints()) { + Point translatedPointToClick = new Point(cursorPoint.x + startingPoint.x, cursorPoint.y + startingPoint.y); robotMouseMove(translatedPointToClick); - Thread.sleep(untranslatedCursorPoint.delay); + Thread.sleep(cursorPoint.delay); } } @@ -153,11 +150,13 @@ public class Cursor { private CursorPath chooseCursorPathToFollowBasedOnDistance(int distanceToMoveCursor) { int newDistanceToMoveCursor = findNearestPathLengthThatExists(distanceToMoveCursor); double scaleToFactorBy = getScaleToFactorBy(newDistanceToMoveCursor, distanceToMoveCursor); - + System.out.println("new distance to follow cursor is: " + newDistanceToMoveCursor); ArrayList cursorPathsWithSameDistance = cursorPathsByDistance.get(newDistanceToMoveCursor); int indexOfRandomPathToFollow = random.nextInt(cursorPathsWithSameDistance.size()); - ArrayList scaledCursorPath = cursorPathsWithSameDistance.get(indexOfRandomPathToFollow).getScaledCopyOfCursorPath(scaleToFactorBy); - return scaledCursorPath; + //CursorPath scaledCursorPath = cursorPathsWithSameDistance.get(indexOfRandomPathToFollow).getScaledCopyOfCursorPath(scaleToFactorBy); + //System.out.println("Chose the following path: "); + //scaledCursorPath.displayCursorPoints(); + return cursorPathsByDistance.get(newDistanceToMoveCursor).get(indexOfRandomPathToFollow);//scaledCursorPath; } private int findNearestPathLengthThatExists(int distanceToMoveCursor) { @@ -188,7 +187,7 @@ public class Cursor { } public void displayCursorPaths() { - for (int i = 0; i < 200; i++) { + for (int i = 0; i < 1000; i++) { System.out.println("There are " + cursorPathsByDistance.get(i).size() + " paths of size " + i); } System.out.println("--------------"); diff --git a/src/CursorDataFileParser.java b/src/CursorDataFileParser.java index 06f9868..0ca8650 100644 --- a/src/CursorDataFileParser.java +++ b/src/CursorDataFileParser.java @@ -26,8 +26,8 @@ public class CursorDataFileParser { String line; CursorPoint lastCursorPoint = new CursorPoint(0, 0, 0); int numberOfRepeats = 0; - ArrayList currentCursorPath = new ArrayList(); - currentCursorPath.add(lastCursorPoint); + ArrayList currentCursorPoints = new ArrayList(); + currentCursorPoints.add(lastCursorPoint); while ((line = bufferedReader.readLine()) != null) { if (lineMatchesPattern(line)) { @@ -35,14 +35,14 @@ public class CursorDataFileParser { if (cursorPointsHaveEqualCoordinates(newCursorPoint, lastCursorPoint)) { numberOfRepeats++; if (numberOfRepeats == 20) { - CursorPath newCursorPath = new CursorPath(currentCursorPath); + CursorPath newCursorPath = new CursorPath(currentCursorPoints); cursorPaths.add(newCursorPath); - currentCursorPath.clear(); + currentCursorPoints.clear(); } } else { numberOfRepeats = 0; - currentCursorPath.add(newCursorPoint); + currentCursorPoints.add(newCursorPoint); lastCursorPoint = newCursorPoint; } } diff --git a/src/CursorPath.java b/src/CursorPath.java index 3c02b2f..9a11b00 100644 --- a/src/CursorPath.java +++ b/src/CursorPath.java @@ -19,22 +19,32 @@ public class CursorPath { this.timespan = calculateCursorPathTimespan(); } + public CursorPath(ArrayList cursorPoints, boolean setInitializiationOff) + { + this.cursorPoints = cursorPoints; + this.distance = calculateCursorPathDistance(); + this.theta = calculateCursorPathTheta(); + this.timespan = calculateCursorPathTimespan(); + } + private ArrayList initializePathOfCursorPoints(ArrayList cursorPoints) { CursorPoint startingCursorPoint = cursorPoints.get(0); - ArrayList translatedCursorPoints = getTranslatedCopyOfCursorPath(cursorPoints, startingCursorPoint); - ArrayList normalizedDelayCursorPoints = getNormalizedDelayCopyOfCursorPath(translatedCursorPoints); + ArrayList translatedCursorPoints = getTranslatedListOfCursorPoints(cursorPoints, startingCursorPoint); + ArrayList normalizedDelayCursorPoints = getNormalizedDelayListOfCursorPoints(translatedCursorPoints); return normalizedDelayCursorPoints; } - private CursorPath getTranslatedCopyOfCursorPath(ArrayList cursorPoints, CursorPoint cursorPointToTranslateBy) { - ArrayList offsetCursorPath = new ArrayList(); + // util + private ArrayList getTranslatedListOfCursorPoints(ArrayList cursorPoints, CursorPoint cursorPointToTranslateBy) { + ArrayList translatedCursorPath = new ArrayList(); for (CursorPoint cursorPoint : cursorPoints) { - offsetCursorPath.add(cursorPoint.getCursorPointTranslatedBy(cursorPointToTranslateBy)); + translatedCursorPath.add(cursorPoint.getCursorPointTranslatedBy(cursorPointToTranslateBy)); } - return new CursorPath(offsetCursorPath); + return translatedCursorPath; } - private CursorPath getNormalizedDelayCopyOfCursorPath(ArrayList cursorPoints) { + //util + private ArrayList getNormalizedDelayListOfCursorPoints(ArrayList cursorPoints) { ArrayList normalizedDelayCursorPoints = new ArrayList(); for (int i = 0; i < cursorPoints.size() - 1; i++) { CursorPoint cursorPoint = cursorPoints.get(i); @@ -42,24 +52,27 @@ public class CursorPath { normalizedDelayCursorPoints.add(cursorPoint.getCursorPointWithNewDelay(nextCursorPoint.delay - cursorPoint.delay)); } normalizedDelayCursorPoints.add(cursorPoints.get(cursorPoints.size() - 1).getCursorPointWithNewDelay(0)); - return new CursorPath(normalizedDelayCursorPoints); + return normalizedDelayCursorPoints; } - - public CursorPath getScaledCopyOfCursorPath(ArrayList cursorPoints, double factorToScaleBy) { + //util + public CursorPath getScaledCopyOfCursorPath(double factorToScaleBy) { ArrayList scaledCursorPath = new ArrayList(); - for (CursorPoint cursorPoint : cursorPoints) { + for (CursorPoint cursorPoint : this.cursorPoints) { scaledCursorPath.add(cursorPoint.getCursorPointScaledBy(factorToScaleBy)); } - return new CursorPath(scaledCursorPath); + return new CursorPath(scaledCursorPath, true); } - public CursorPath getRotatedCopyOfCursorPath(ArrayList cursorPoints, double angleToRotateBy) { + //util + public CursorPath getRotatedCopyOfCursorPath(double angleToRotateTo) { ArrayList rotatedCursorPath = new ArrayList(); - for (CursorPoint cursorPoint : cursorPoints) { + double angleToRotateBy = this.theta - angleToRotateTo; + System.out.println("Rotating points by: " + angleToRotateBy); + for (CursorPoint cursorPoint : this.cursorPoints) { rotatedCursorPath.add(cursorPoint.getCursorPointRotatedBy(angleToRotateBy)); } - return new CursorPath(rotatedCursorPath); + return new CursorPath(rotatedCursorPath, true); } private int calculateCursorPathTimespan() { @@ -71,12 +84,11 @@ public class CursorPath { } private int calculateCursorPathDistance() { - return (int) (getStartingCursorPoint().getDistanceFrom(getEndingCursorPoint())); + return (int) (getEndingCursorPoint().getDistanceFromOrigin()); } private double calculateCursorPathTheta() { - CursorPoint endingCursorPoint = getEndingCursorPoint(); - return Math.atan2(endingCursorPoint.y, endingCursorPoint.x); + return getEndingCursorPoint().getThetaFromOrigin(); } public CursorPoint getStartingCursorPoint() { @@ -102,7 +114,7 @@ public class CursorPath { } private boolean isCursorPathNumPointsReasonable() { - return (this.cursorPoints.size() > 0 && this.cursorPoints.size() < 50); + return (this.cursorPoints.size() > 0 && this.cursorPoints.size() < 80); } public ArrayList getCursorPathPoints() { @@ -122,7 +134,7 @@ public class CursorPath { for (CursorPoint p : this.cursorPoints) { p.display(); } - System.out.println("Number of points:" + this.cursorPoints.size() + ", Timespan:" + this.timespan); + System.out.println("Number of points:" + this.cursorPoints.size() + ", Timespan:" + this.timespan + ", Distance: " + this.distance + ", Theta: " + this.theta); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~ End of Path ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); } } \ No newline at end of file diff --git a/src/CursorPathTest.java b/src/CursorPathTest.java index 36138b6..db8aa39 100644 --- a/src/CursorPathTest.java +++ b/src/CursorPathTest.java @@ -10,21 +10,30 @@ class CursorPathTest { @Test - void testCursorPathOffset() { + void testCursorPaths() { initializeCursorPath(); for (CursorPath cursorPath : cursorPaths) { + cursorPath.displayCursorPoints(); + testCursorPathStartsAtOrigin(cursorPath); testEndingCursorPointInCursorPathHasZeroDelay(cursorPath); testCursorPathDistance(cursorPath); testCursorPathTheta(cursorPath); - //testCursorPathLocations(cursorPath); + testCursorPathRotation(cursorPath, Math.PI); + testCursorPathRotation(cursorPath, 7 / 4 * Math.PI); testCursorPathScaling(cursorPath, 1.15); - cursorPath.displayCursorPoints(); + + testCopyTime(cursorPath); } } - + + private void initializeCursorPath() { + CursorDataFileParser cursorDataFileParser = new CursorDataFileParser("/home/dpapp/eclipse-workspace/RunescapeAI/testfiles/cursorPathTest.txt"); + this.cursorPaths = cursorDataFileParser.getArrayListOfCursorPathsFromFile(); + } + private void testCursorPathStartsAtOrigin(CursorPath cursorPath) { CursorPoint startingCursorPoint = cursorPath.getStartingCursorPoint(); assertTrue(startingCursorPoint.x == 0 && startingCursorPoint.y == 0); @@ -32,63 +41,58 @@ class CursorPathTest { private void testEndingCursorPointInCursorPathHasZeroDelay(CursorPath cursorPath) { CursorPoint endingCursorPoint = cursorPath.getEndingCursorPoint(); - assertEquals(endingCursorPoint.delay, 0); + assertEquals(0, endingCursorPoint.delay); } private void testCursorPathDistance(CursorPath cursorPath) { - int distance = cursorPath.getCursorPathDistance(); + int cursorPathDistance = cursorPath.getCursorPathDistance(); CursorPoint startingCursorPoint = cursorPath.getStartingCursorPoint(); CursorPoint endingCursorPoint = cursorPath.getEndingCursorPoint(); - int actualDistance = (int) Math.hypot(startingCursorPoint.x - endingCursorPoint.x, startingCursorPoint.y - endingCursorPoint.y); - assertEquals(distance, actualDistance); + startingCursorPoint.display(); + endingCursorPoint.display(); + int expectedDistance = (int) Math.hypot(startingCursorPoint.x - endingCursorPoint.x, startingCursorPoint.y - endingCursorPoint.y); + assertEquals(expectedDistance, cursorPathDistance); } private void testCursorPathTheta(CursorPath cursorPath) { double theta = cursorPath.getCursorPathTheta(); + CursorPoint startingCursorPoint = cursorPath.getStartingCursorPoint(); CursorPoint endingCursorPoint = cursorPath.getEndingCursorPoint(); - double actualTheta = Math.atan2(endingCursorPoint.y, endingCursorPoint.x); + double actualTheta = Math.atan2(endingCursorPoint.x - startingCursorPoint.x, endingCursorPoint.y - startingCursorPoint.y); assertEquals(theta, actualTheta); } - /*private void testCursorPathLocations(CursorPath cursorPath) { - }*/ - void testCursorPathRotation(CursorPath cursorPath, double angleToRotateBy) { + void testCursorPathRotation(CursorPath cursorPath, double angleToRotateTo) { + CursorPath rotatedCursorPath = cursorPath.getRotatedCopyOfCursorPath(angleToRotateTo); + assertEquals(angleToRotateTo, rotatedCursorPath.getCursorPathTheta()); + ArrayList cursorPoints = cursorPath.getCursorPathPoints(); - ArrayList rotatedCursorPoints = cursorPath.getRotatedCopyOfCursorPath(angleToRotateBy); + ArrayList rotatedCursorPoints = rotatedCursorPath.getCursorPathPoints(); assertEquals(cursorPoints.size(), rotatedCursorPoints.size()); - for (int i = 1; i < cursorPoints.size(); i++) { - double originalThetaOfCursorPoint = cursorPoints.get(i).getTheta(); - double rotatedThetaOfCursorPoint = rotatedCursorPoints.get(i).getTheta(); - System.out.println((originalThetaOfCursorPoint + angleToRotateBy) % (Math.PI) + "," + rotatedThetaOfCursorPoint); - //assertInRangeByAbsoluteValue(originalThetaOfCursorPoint + angleToRotateBy, rotatedThetaOfCursorPoint, 3); - } - } - - void testCursorPathScaling(CursorPath cursorPath, double factorToScaleBy) { - ArrayList cursorPoints = cursorPath.getCursorPathPoints(); - ArrayList scaledCursorPoints = cursorPath.getScaledCopyOfCursorPath(factorToScaleBy); - assertEquals(cursorPoints.size(), scaledCursorPoints.size()); - CursorPoint startingPoint = cursorPoints.get(0); - for (int i = 0; i < cursorPoints.size(); i++) { - double originalDistanceOfCursorPoint = cursorPoints.get(i).getDistanceFrom(startingPoint); - double scaledDistanceOfCursorPoint = scaledCursorPoints.get(i).getDistanceFrom(startingPoint); - assertInRangeByAbsoluteValue(originalDistanceOfCursorPoint * factorToScaleBy, scaledDistanceOfCursorPoint, 3); - } - } - - void initializeCursorPath() { - CursorDataFileParser cursorDataFileParser = new CursorDataFileParser("/home/dpapp/eclipse-workspace/RunescapeAI/testfiles/cursorPathTest.txt"); - this.cursorPaths = cursorDataFileParser.getArrayListOfCursorPathsFromFile(); } - void assertInRangeByRatio(double expected, double actual, double toleranceRatio) { - assertTrue((actual <= (expected * (1.0 + toleranceRatio))) && (actual >= (expected * (1.0 - toleranceRatio)))); + void testCopyTime(CursorPath cursorPath) { + CursorPath rotatedCursorPath = cursorPath.getRotatedCopyOfCursorPath(2.3 / 9.0 * Math.PI); + ArrayList cursorPoints = cursorPath.getCursorPathPoints(); + ArrayList rotatedCursorPoints = rotatedCursorPath.getCursorPathPoints(); + assertEquals(cursorPoints.size(), rotatedCursorPoints.size()); + for (int i = 0; i < cursorPoints.size(); i++) { + assertEquals(cursorPoints.get(i).delay, rotatedCursorPoints.get(i).delay); + } + } + + void testCursorPathScaling(CursorPath cursorPath, double factorToScaleBy) { + CursorPath scaledCursorPath = cursorPath.getScaledCopyOfCursorPath(factorToScaleBy); + + ArrayList cursorPoints = cursorPath.getCursorPathPoints(); + ArrayList scaledCursorPoints = scaledCursorPath.getCursorPathPoints(); + assertEquals(cursorPoints.size(), scaledCursorPoints.size()); } - void assertInRangeByAbsoluteValue(double valueToTest, double expectation, double toleranceAbsolute) { - assertTrue((valueToTest <= (expectation + toleranceAbsolute)) && (valueToTest >= (expectation * (1 - toleranceAbsolute)))); + void assertInRangeByTolerance(double expected, double actual, double tolerance) { + assertTrue((actual <= (expected + tolerance)) && (actual >= (expected - tolerance))); } } diff --git a/src/CursorPoint.java b/src/CursorPoint.java index b6cc908..4a57d96 100644 --- a/src/CursorPoint.java +++ b/src/CursorPoint.java @@ -12,26 +12,26 @@ public class CursorPoint { this.delay = delay; } - public double getDistanceFrom(CursorPoint b) { - return Math.hypot(this.x - b.x, this.y - b.y); + public double getDistanceFromOrigin() { + return Math.hypot(this.x, this.y); } - public double getTheta() { - return Math.atan2(this.y, this.x); + public double getThetaFromOrigin() { + return Math.atan2(this.x, this.y); } public CursorPoint getCursorPointTranslatedBy(CursorPoint startingCursorPoint) { - return new CursorPoint(this.x - startingCursorPoint.x, this.y - startingCursorPoint.y, this.delay - startingCursorPoint.delay); + return new CursorPoint(x - startingCursorPoint.x, y - startingCursorPoint.y, delay - startingCursorPoint.delay); } public CursorPoint getCursorPointScaledBy(double scaleFactor) { - return (new CursorPoint((int) (this.x * scaleFactor), (int) (this.y * scaleFactor), (int) (this.delay * scaleFactor))); + return (new CursorPoint((int) (this.x * scaleFactor), (int) (this.y * scaleFactor), (int) (delay * scaleFactor))); } public CursorPoint getCursorPointRotatedBy(double angleOfRotation) { int rotatedX = (int) (Math.cos(angleOfRotation) * this.x - Math.sin(angleOfRotation) * this.y); int rotatedY = (int) (Math.sin(angleOfRotation) * this.x + Math.cos(angleOfRotation) * this.y); - return (new CursorPoint(rotatedX, rotatedY, this.delay)); + return (new CursorPoint(rotatedX, rotatedY, delay)); } public CursorPoint getCursorPointWithNewDelay(int delay) { diff --git a/src/CursorPointTest.java b/src/CursorPointTest.java index 45d19e4..29063d8 100644 --- a/src/CursorPointTest.java +++ b/src/CursorPointTest.java @@ -5,17 +5,34 @@ import org.junit.jupiter.api.Test; class CursorPointTest { @Test - void testDistanceFrom() { + void testDistanceFromOrigin() { CursorPoint a = new CursorPoint(0, 0, 0); CursorPoint b = new CursorPoint(3, 4, 0); CursorPoint c = new CursorPoint(500, 750, 0); CursorPoint d = new CursorPoint(284, 848, 0); - assertTrue(withinRangeByRatio(a.getDistanceFrom(b), 5, 0.0001)); - assertTrue(withinRangeByRatio(a.getDistanceFrom(c), 901.387818866, 0.0001)); - assertTrue(withinRangeByRatio(a.getDistanceFrom(d), 894.293016857, 0.0001)); - assertTrue(withinRangeByRatio(b.getDistanceFrom(c), 896.395560007, 0.0001)); - assertTrue(withinRangeByRatio(c.getDistanceFrom(d), 237.191905427, 0.0001)); + assertEquals(0, a.getDistanceFromOrigin()); + assertTrue(withinRangeByRatio(a.getDistanceFromOrigin(), 901.387818866, 0.0001)); + assertTrue(withinRangeByRatio(a.getDistanceFromOrigin(), 894.293016857, 0.0001)); + assertTrue(withinRangeByRatio(b.getDistanceFromOrigin(), 896.395560007, 0.0001)); + assertTrue(withinRangeByRatio(c.getDistanceFromOrigin(), 237.191905427, 0.0001)); + } + + @Test + void testThetaFromOrigin() { + CursorPoint a = new CursorPoint(0, 0, 0); + CursorPoint b = new CursorPoint(3, 4, 0); + CursorPoint c = new CursorPoint(500, 750, 0); + CursorPoint d = new CursorPoint(284, 848, 0); + CursorPoint e = new CursorPoint(10, 0, 0); + CursorPoint f = new CursorPoint(0, 10, 0); + + assertEquals(0, a.getThetaFromOrigin()); + assertEquals(0.6435011087932844, b.getThetaFromOrigin()); + assertEquals(0.5880026035475675, c.getThetaFromOrigin()); + assertEquals(0.32316498061040844, d.getThetaFromOrigin()); + assertEquals(1.5707963267948966, e.getThetaFromOrigin()); + assertEquals(0.0, f.getThetaFromOrigin()); } @Test @@ -51,6 +68,8 @@ class CursorPointTest { assertTrue(h.x == -428 && h.y == -321); } + + boolean withinRangeByRatio(double actual, double expectation, double toleranceRatio) { return ((actual <= (expectation * (1 + toleranceRatio))) && (actual >= (expectation * (1 - toleranceRatio)))); } diff --git a/src/CursorTest.java b/src/CursorTest.java index 185c0ce..9d85629 100644 --- a/src/CursorTest.java +++ b/src/CursorTest.java @@ -12,23 +12,28 @@ class CursorTest { void initialize() throws AWTException { cursor = new Cursor(); - cursorTolerance = 3; + cursorTolerance = 5; } @Test void testMoveCursorToCoordinatesHelper() throws InterruptedException, AWTException { initialize(); + cursor.displayCursorPaths(); + + testThetaBetweenPoints(); testMoveCursorToCoordinates(); - testRightClickCursor(); + //testRightClickCursor(); } - @Test void testThetaBetweenPoints() { Point a = new Point(0, 0); Point b = new Point(10, 0); Point c = new Point(10, 10); Point d = new Point(20, 10); - assertEquals(cursor.getThetaBetweenPoints(a, b), 0); + assertEquals(degreesToRadians(90), cursor.getThetaBetweenPoints(a, b)); + assertEquals(degreesToRadians(45), cursor.getThetaBetweenPoints(a, c)); + assertEquals(1.1071487177940904, cursor.getThetaBetweenPoints(a, d)); + assertEquals(degreesToRadians(45), cursor.getThetaBetweenPoints(b, d)); } void testMoveCursorToCoordinates() throws InterruptedException { @@ -52,7 +57,7 @@ class CursorTest { testMoveCursorToCoordinates(a, g); } - void testRightClickCursor() throws InterruptedException { + /*void testRightClickCursor() throws InterruptedException { Point a = new Point(375, 600); Point b = new Point(952, 603); Point c = new Point(1025, 133); @@ -61,21 +66,24 @@ class CursorTest { testMoveAndRightClickCursor(b, c); testMoveAndRightClickCursor(c, d); testMoveAndRightClickCursor(d, a); - } + }*/ - void testMoveAndRightClickCursor(Point a, Point b) throws InterruptedException { + /*void testMoveAndRightClickCursor(Point a, Point b) throws InterruptedException { cursor.robotMouseMove(a); cursor.moveAndRightClickAtCoordinates(b); Point point = cursor.getCurrentCursorPoint(); + System.out.println("Cursor ended up on " + point.x + "," + point.y); verifyCursorIsInCorrectPlace(point, b); // Way to verify that context menu is open? - } + }*/ void testMoveCursorToCoordinates(Point a, Point b) throws InterruptedException { cursor.robotMouseMove(a); cursor.moveCursorToCoordinates(b); Point point = cursor.getCurrentCursorPoint(); + System.out.println("Cursor ended up on " + point.x + "," + point.y); verifyCursorIsInCorrectPlace(point, b); + Thread.sleep(500); } void verifyCursorIsInCorrectPlace(Point actualPoint, Point expectedPoint) { @@ -90,6 +98,10 @@ class CursorTest { void assertInRangeByAbsoluteValue(double valueToTest, double expectation, double toleranceAbsolute) { assertTrue((valueToTest <= (expectation + toleranceAbsolute)) && (valueToTest >= (expectation * (1 - toleranceAbsolute)))); } + + private double degreesToRadians(double degrees) { + return degrees * Math.PI / 180.0; + } } \ No newline at end of file diff --git a/src/OpenCVTest.java b/src/OpenCVTest.java new file mode 100644 index 0000000..adfa1c5 --- /dev/null +++ b/src/OpenCVTest.java @@ -0,0 +1,11 @@ +import org.opencv.core.Core; +import org.opencv.core.CvType; +import org.opencv.core.Mat; + +public class OpenCVTest { + public static void main( String[] args ) { + System.loadLibrary(Core.NATIVE_LIBRARY_NAME); + Mat mat = Mat.eye(3, 3, CvType.CV_8UC1); + System.out.println("mat = " + mat.dump()); + } +} \ No newline at end of file diff --git a/src/main.java b/src/main.java index e5ea76b..4978077 100644 --- a/src/main.java +++ b/src/main.java @@ -8,7 +8,7 @@ public class main { public static void main(String[] args) throws AWTException, InterruptedException, IOException { - Cursor cursor = new Cursor(); + /*Cursor cursor = new Cursor(); CursorTask cursorTask = new CursorTask(); Inventory inventory = new Inventory(); @@ -19,7 +19,7 @@ public class main { cursorTask.optimizedDropAllItemsInInventory(cursor, inventory); } Thread.sleep(100); - } + } */ //cursor.moveCursorToCoordinates(new Point(620, 420)); }