Improved Future Tone algorithms and corrected minor errors.

secondmonitor 03-beta
sigonasr2 4 years ago
parent 3efc8d4d39
commit c490cf83ca
  1. BIN
      DivaBot/DivaBot.jar
  2. 8
      DivaBot/calibration_data.txt
  3. BIN
      DivaBot/capture.png
  4. BIN
      DivaBot/capture_2.png
  5. BIN
      DivaBot/capture_3.png
  6. BIN
      DivaBot/capture_4.png
  7. BIN
      DivaBot/capture_5.png
  8. BIN
      DivaBot/rectangle0.png
  9. BIN
      DivaBot/rectangle1.png
  10. BIN
      DivaBot/rectangle2.png
  11. BIN
      DivaBot/rectangle3.png
  12. BIN
      DivaBot/rectangle4.png
  13. 24
      DivaBot/src/sig/Calibrator.java
  14. 41
      DivaBot/src/sig/MyRobot.java
  15. 33
      DivaBot/src/sig/TypeFace2.java
  16. BIN
      DivaBot/typeface.png
  17. BIN
      DivaBot/typeface4.png
  18. BIN
      DivaBot/typeface5.png
  19. BIN
      Release/DivaBot/DivaBot/DivaBot.jar
  20. BIN
      Release/DivaBot/DivaBot/typeface.png
  21. BIN
      Release/DivaBot/DivaBot/typeface4.png
  22. BIN
      Release/DivaBot/DivaBot/typeface5.png
  23. BIN
      Release/DivaBot04.zip

Binary file not shown.

@ -1,4 +1,4 @@
451
314
1557
935
461
253
1325
735

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 832 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 831 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 MiB

After

Width:  |  Height:  |  Size: 823 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

@ -94,7 +94,8 @@ public class Calibrator{
if (!((col.getRed()>=5&&col.getRed()<=100&&
col.getGreen()>=170&&col.getGreen()<=210&&
col.getBlue()>=180&&col.getBlue()<=250)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max X. Calibration on this side good.
MyRobot.STARTDRAG.x++;
@ -122,7 +123,8 @@ public class Calibrator{
if (!((col.getRed()>=5&&col.getRed()<=100&&
col.getGreen()>=170&&col.getGreen()<=210&&
col.getBlue()>=180&&col.getBlue()<=250)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max Y. Calibration on this side good.
MyRobot.STARTDRAG.y++;
@ -149,7 +151,8 @@ public class Calibrator{
if (!((col.getRed()>=40&&col.getRed()<=90&&
col.getGreen()>=10&&col.getGreen()<=55&&
col.getBlue()>=40&&col.getBlue()<=90)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max X. Calibration on this side good.
MyRobot.ENDDRAG.x--;
@ -177,7 +180,8 @@ public class Calibrator{
if (!((col.getRed()>=40&&col.getRed()<=90&&
col.getGreen()>=10&&col.getGreen()<=55&&
col.getBlue()>=40&&col.getBlue()<=90)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max Y. Calibration on this side good.
MyRobot.ENDDRAG.y--;
@ -205,7 +209,8 @@ public class Calibrator{
if (((col.getRed()>=5&&col.getRed()<=100&&
col.getGreen()>=170&&col.getGreen()<=210&&
col.getBlue()>=180&&col.getBlue()<=250)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max X. Calibration on this side good.
MyRobot.STARTDRAG.y=MyRobot.STARTDRAG.y+i;
@ -234,7 +239,8 @@ public class Calibrator{
if (((col.getRed()>=5&&col.getRed()<=100&&
col.getGreen()>=170&&col.getGreen()<=210&&
col.getBlue()>=180&&col.getBlue()<=250)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
MyRobot.STARTDRAG.x=MyRobot.STARTDRAG.x+i;
//This is the max Y. Calibration on this side good.
@ -263,7 +269,8 @@ public class Calibrator{
if (((col.getRed()>=40&&col.getRed()<=90&&
col.getGreen()>=10&&col.getGreen()<=55&&
col.getBlue()>=40&&col.getBlue()<=90)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
//This is the max X. Calibration on this side good.
MyRobot.ENDDRAG.y=MyRobot.ENDDRAG.y-i;
@ -293,7 +300,8 @@ public class Calibrator{
if (((col.getRed()>=40&&col.getRed()<=90&&
col.getGreen()>=10&&col.getGreen()<=55&&
col.getBlue()>=40&&col.getBlue()<=90)||
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30)
(col.getRed()<=30&&col.getGreen()<=30&&col.getBlue()<=30&&
col.getRed()>=2&&col.getGreen()>=2&&col.getBlue()>=2)
)) {
MyRobot.ENDDRAG.x=MyRobot.ENDDRAG.x-i;
//This is the max Y. Calibration on this side good.

@ -167,6 +167,7 @@ public class MyRobot{
public static String AUTHTOKEN = "";
public static long lastmainlooptime = 0;
public static Result lastData=null;
public static void main(String[] args) throws JSONException, IOException, FontFormatException {
@ -351,7 +352,6 @@ public class MyRobot{
MYROBOT.keyRelease(KeyEvent.VK_SHIFT);
MYROBOT.keyRelease(KeyEvent.VK_CONTROL);
}
Thread.sleep(200);
MYROBOT.refreshScoreScreen();
ImageIO.write(MYROBOT.createScoreScreenCapture(),"png",new File("scoreimage.png"));
File tmp = new File("tmp");
@ -362,10 +362,23 @@ public class MyRobot{
}
try {
final Result data = typeface1.getAllData(MYROBOT.createScoreScreenCapture());
System.out.println(data);
//ImageIO.write(MYROBOT.,"png",new File("test.png"));
if (data.cool==-1 || data.fine==-1 || data.safe==-1 || data.sad==-1 || data.worst==-1 || data.percent<0f || data.percent>110f || data.combo==-1 || data.score==-1) {
System.out.println("Waiting for results to populate...");
if (lastData==null || (lastData.cool!=data.cool || data.fine!=lastData.fine || data.safe!=lastData.safe || data.sad!=lastData.sad || data.worst!=lastData.worst || data.percent!=lastData.percent || data.combo!=lastData.combo || data.score!=lastData.score)) {
System.out.println("Waiting for results to populate...");
System.out.println(data);
}
if (lastData==null) {
lastData=new Result("","",-1,-1,-1,-1,-1,-1f);
}
lastData.cool=data.cool;
lastData.fine=data.fine;
lastData.safe=data.safe;
lastData.sad=data.sad;
lastData.worst=data.worst;
lastData.percent=data.percent;
lastData.combo=data.combo;
lastData.score=data.score;
} else
if ((data.combo!=lastcombo || data.fail!=lastfail || data.cool!=lastcool || lastfine!=data.fine || lastsafe!=data.safe || lastsad!=data.sad || lastworst!=data.worst)
&& data.score!=lastscore /*|| lastpercent!=percent*/){
@ -524,14 +537,15 @@ public class MyRobot{
return c1.getRed()>=250 && c1.getGreen()>=250 && c1.getBlue()>=250 && c2.getRed()>=10 && c2.getRed()<=25 && c2.getGreen()>=200 && c2.getGreen()<=240 && c2.getBlue()>=180 && c2.getBlue()<=220 &&
c3.getRed()>=200 && c3.getRed()<=255 && c3.getGreen()>=200 && c3.getGreen()<=255 && c3.getBlue()>=140 && c3.getBlue()<=220;
} else {
Color ft_pixel1 = new Color(MYROBOT.createScreenCapture(new Rectangle(260, 38,1,1)).getRGB(0, 0));
Color ft_pixel2 = new Color(MYROBOT.createScreenCapture(new Rectangle(86, 38,1,1)).getRGB(0, 0));
return (ft_pixel1.getRed()<60&&ft_pixel1.getRed()>0&&
ft_pixel1.getGreen()<90&&ft_pixel1.getGreen()>30&&
ft_pixel1.getBlue()<90&&ft_pixel1.getBlue()>30
&&ft_pixel2.getRed()<60&&ft_pixel2.getRed()>0&&
ft_pixel2.getGreen()<90&&ft_pixel2.getGreen()>30&&
ft_pixel2.getBlue()<90&&ft_pixel2.getBlue()>30);
BufferedImage img2 = ImageUtils.toBufferedImage(MYROBOT.currentScreen.getScaledInstance(1280 , 720, Image.SCALE_SMOOTH));
Color ft_pixel1 = new Color(img2.getRGB(260, 38));
Color ft_pixel2 = new Color(img2.getRGB(86, 38));
return (ft_pixel1.getRed()<60&&ft_pixel1.getRed()>=0&&
ft_pixel1.getGreen()<90&&ft_pixel1.getGreen()>20&&
ft_pixel1.getBlue()<90&&ft_pixel1.getBlue()>20
&&ft_pixel2.getRed()<60&&ft_pixel2.getRed()>=0&&
ft_pixel2.getGreen()<90&&ft_pixel2.getGreen()>20&&
ft_pixel2.getBlue()<90&&ft_pixel2.getBlue()>20);
}
//System.out.println(c1+"/"+c2+"/"+c3);
}
@ -859,6 +873,11 @@ public class MyRobot{
RunTest("scoreimage342.png",392,41,0,0,0,102.14f,"EXEX","HS",433,713988,false,Mode.FUTURETONE);
RunTest("test40.png",221,117,7,1,8,78.00f,"H","HS",111,253033,false,Mode.FUTURETONE);
RunTest("test41.png",329,108,3,0,17,80.10f,"EX","HS",113,419386,false,Mode.FUTURETONE);
RunTest("test42.png",473,132,11,6,36,59.76f,"EXEX","",352,581856,true,Mode.FUTURETONE);
RunTest("test43.png",7,4,3,2,60,3.14f,"EXEX","",4,15367,true,Mode.FUTURETONE);
RunTest("test44.png",450,45,1,0,6,99.41f,"EXEX","HS",364,586674,false,Mode.FUTURETONE);
RunTest("test45.png",394,37,0,0,0,103.84f,"EXEX","HS",431,546139,false,Mode.FUTURETONE);
RunTest("test46.png",452,25,0,0,1,103.16f,"EXEX","HS",260,750134,false,Mode.FUTURETONE);
}
static void RunTest(String _img,int _cool,int _fine, int _safe, int _sad, int _worst, float _percent,String _difficulty,String _mod,int _combo,int _score,boolean _fail, Mode _mode) throws IOException {

@ -55,15 +55,15 @@ public class TypeFace2 {
final static Rectangle MEGAMIX_RECT_SEARCH_PCT2=new Rectangle(1123+XOFFSET,163,1051,8);
final static Rectangle MEGAMIX_RECT_SEARCH_SCORE=new Rectangle(859+XOFFSET,578-4,250+XOFFSET+1,32+14);
final static Rectangle MEGAMIX_RECT_SEARCH_COMBO=new Rectangle(1010+XOFFSET,435-2,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_COOL=new Rectangle(872+XOFFSET,221,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_FINE=new Rectangle(872+XOFFSET,256,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_SAFE=new Rectangle(872+XOFFSET,292,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_SAD=new Rectangle(872+XOFFSET,328,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_WORST=new Rectangle(872+XOFFSET,365,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_PCT=new Rectangle(1174+XOFFSET,150,1125,8);
final static Rectangle FUTURETONE_RECT_SEARCH_PCT2=new Rectangle(1114+XOFFSET,150,1045,8);
final static Rectangle FUTURETONE_RECT_SEARCH_SCORE=new Rectangle(866+XOFFSET,543-4,250+XOFFSET+1,32+14);
final static Rectangle FUTURETONE_RECT_SEARCH_COMBO=new Rectangle(1023+XOFFSET,402-2,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_COOL=new Rectangle(872+XOFFSET,223,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_FINE=new Rectangle(872+XOFFSET,258,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_SAFE=new Rectangle(872+XOFFSET,294,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_SAD=new Rectangle(872+XOFFSET,330,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_WORST=new Rectangle(872+XOFFSET,367,100+XOFFSET+1,22+8);
final static Rectangle FUTURETONE_RECT_SEARCH_PCT=new Rectangle(1174+XOFFSET,152,1125,8);
final static Rectangle FUTURETONE_RECT_SEARCH_PCT2=new Rectangle(1114+XOFFSET,152,1045,8);
final static Rectangle FUTURETONE_RECT_SEARCH_SCORE=new Rectangle(866+XOFFSET,543-4,250+XOFFSET+1,32+24);
final static Rectangle FUTURETONE_RECT_SEARCH_COMBO=new Rectangle(1023+XOFFSET,402,100+XOFFSET+1,22+8);
public Result getAllData(BufferedImage img, boolean debug) throws IOException,NumberFormatException,IndexOutOfBoundsException {
BufferedImage img2 = ImageUtils.toBufferedImage(img.getScaledInstance(1280 , 720, Image.SCALE_SMOOTH));
@ -111,6 +111,7 @@ public class TypeFace2 {
finalNumbers[i]=extractNumbersFromImage(img2.getSubimage(
r.x,r.y,r.width,r.height),debug);
//System.out.println(finalNumbers[i]);
if (finalNumbers[i]==-1) {
return result;
}
@ -217,12 +218,12 @@ public class TypeFace2 {
private Mode getMode(BufferedImage img2) {
Color ft_pixel1 = new Color(img2.getRGB(260, 38));
Color ft_pixel2 = new Color(img2.getRGB(86, 38));
if (ft_pixel1.getRed()<60&&ft_pixel1.getRed()>0&&
ft_pixel1.getGreen()<90&&ft_pixel1.getGreen()>30&&
ft_pixel1.getBlue()<90&&ft_pixel1.getBlue()>30
&&ft_pixel2.getRed()<60&&ft_pixel2.getRed()>0&&
ft_pixel2.getGreen()<90&&ft_pixel2.getGreen()>30&&
ft_pixel2.getBlue()<90&&ft_pixel2.getBlue()>30) {
if (ft_pixel1.getRed()<60&&ft_pixel1.getRed()>=0&&
ft_pixel1.getGreen()<90&&ft_pixel1.getGreen()>20&&
ft_pixel1.getBlue()<90&&ft_pixel1.getBlue()>20
&&ft_pixel2.getRed()<60&&ft_pixel2.getRed()>=0&&
ft_pixel2.getGreen()<90&&ft_pixel2.getGreen()>20&&
ft_pixel2.getBlue()<90&&ft_pixel2.getBlue()>20) {
return Mode.FUTURETONE;
}
return Mode.MEGAMIX;
@ -874,7 +875,7 @@ public class TypeFace2 {
ypointer=0;
String total = "";
trialloop:
while (ypointer<12) {
while (ypointer<20) {
xpointer=FUTURETONE_RECT_SEARCH_SCORE.width-1;
while (xpointer>31) {
int distance = 0;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.
Loading…
Cancel
Save