100% passing tests now with more consistent test results.

secondmonitor
sigonasr2 4 years ago
parent cee8d2dd6a
commit 64d67417af
  1. 1
      DivaBot/.gitignore
  2. 22
      DivaBot/colorData
  3. BIN
      DivaBot/liveimage.png
  4. 19
      DivaBot/src/sig/MyRobot.java
  5. 5
      DivaBot/src/sig/Result.java
  6. 8
      DivaBot/src/sig/TestMain.java
  7. 6
      DivaBot/src/sig/TypeFace2.java
  8. BIN
      DivaBot/test.png
  9. BIN
      DivaBot/typeface2.png

@ -1,7 +1,6 @@
/target/ /target/
/.settings/ /.settings/
/Knife/ /Knife/
!/testsuite/*.png
/tmp/ /tmp/
/ココロ/ /ココロ/
/システマティック・ラヴ/ /システマティック・ラヴ/

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 900 KiB

After

Width:  |  Height:  |  Size: 840 KiB

@ -81,7 +81,7 @@ public class MyRobot{
static SongData SONGS[]; static SongData SONGS[];
//static String SONGNAMES[] = new String[] {"Yellow","The secret garden","Tell Your World","愛言葉","Weekender Girl","歌に形はないけれど","えれくとりっく・えんじぇぅ","神曲","カンタレラ","巨大少女","クローバー♣クラブ","恋スルVOC@LOID","桜ノ雨","39","深海シティアンダーグラウンド","深海少女","積乱雲グラフィティ","千年の独奏歌","ダブルラリアット","ハジメテノオト","初めての恋が終わる時","packaged","Palette","FREELY TOMORROW","from Y to Y","みくみくにしてあげる♪","メルト","モノクロ∞ブルースカイ","ゆめゆめ","16 -out of the gravity-","ACUTE","インタビュア","LOL -lots of laugh-","Glory 3usi9","soundless voice","ジェミニ","白い雪のプリンセスは","スキキライ","タイムマシン","Dear","DECORATOR","トリコロール・エア・ライン","Nostalogic","Hand in Hand","Fire◎Flower","ブラック★ロックシューター","メテオ","ワールドイズマイン","アマツキツネ","erase or zero","エレクトロサチュレイタ","on the rocks","からくりピエロ","カラフル×メロディ","Catch the Wave","キャットフード","サマーアイドル","shake it!","Just Be Friends","スイートマジック","SPiCa -39's Giving Day Edition-","番凩","テレカクシ思春期","天樂","どういうことなの!?","東京テディベア","どりーみんチュチュ","トリノコシティ","ネトゲ廃人シュプレヒコール","No Logic","ハイハハイニ","はじめまして地球人さん","*ハロー、プラネット。 (I.M.PLSE-EDIT)","Hello, Worker","忘却心中","magnet","右肩の蝶","結ンデ開イテ羅刹ト骸","メランコリック","リモコン","ルカルカ★ナイトフィーバー","炉心融解","WORLD'S END UMBRELLA","アカツキアライヴァル","アゲアゲアゲイン","1925","え?あぁ、そう。","エイリアンエイリアン","ODDS&ENDS","君の体温","こっち向いて Baby","壊セ壊セ","39みゅーじっく!","サンドリヨン","SING&SMILE","スノーマン","DYE","なりすましゲンガー","ヒバナ","ヒビカセ","ブラックゴールド","ミラクルペイント","指切り","ありふれたせかいせいふく","アンハッピーリフレイン","大江戸ジュリアナイト","ゴーストルール","こちら、幸福安心委員会です。","孤独の果て -extend edition-","ジターバグ","Sweet Devil","砂の惑星","テオ","初音ミクの消失 -DEAD END-","秘密警察","妄想スケッチ","リンちゃんなう!","ローリンガール","ロキ","ロミオとシンデレラ","エンヴィキャットウォーク","骸骨楽団とリリア","サイハテ","ジグソーパズル","千本桜","ピアノ×フォルテ×スキャンダル","Blackjack","ぽっぴっぽー","裏表ラバーズ","Sadistic.Music∞Factory","デンパラダイム","二次元ドリームフィーバー","ネガポジ*コンティニューズ","初音ミクの激唱","ワールズエンド・ダンスホール","ココロ","システマティック・ラヴ","Knife","二息歩行","PIANOGIRL","夢喰い白黒バク","ブレス・ユア・ブレス","恋は戦争","あなたの歌姫","Starduster","StargazeR","リンリンシグナル","Rosary Pale","多重未来のカルテット~QUARTET THEME~","LIKE THE WIND","AFTER BURNER"}; //static String SONGNAMES[] = new String[] {"Yellow","The secret garden","Tell Your World","愛言葉","Weekender Girl","歌に形はないけれど","えれくとりっく・えんじぇぅ","神曲","カンタレラ","巨大少女","クローバー♣クラブ","恋スルVOC@LOID","桜ノ雨","39","深海シティアンダーグラウンド","深海少女","積乱雲グラフィティ","千年の独奏歌","ダブルラリアット","ハジメテノオト","初めての恋が終わる時","packaged","Palette","FREELY TOMORROW","from Y to Y","みくみくにしてあげる♪","メルト","モノクロ∞ブルースカイ","ゆめゆめ","16 -out of the gravity-","ACUTE","インタビュア","LOL -lots of laugh-","Glory 3usi9","soundless voice","ジェミニ","白い雪のプリンセスは","スキキライ","タイムマシン","Dear","DECORATOR","トリコロール・エア・ライン","Nostalogic","Hand in Hand","Fire◎Flower","ブラック★ロックシューター","メテオ","ワールドイズマイン","アマツキツネ","erase or zero","エレクトロサチュレイタ","on the rocks","からくりピエロ","カラフル×メロディ","Catch the Wave","キャットフード","サマーアイドル","shake it!","Just Be Friends","スイートマジック","SPiCa -39's Giving Day Edition-","番凩","テレカクシ思春期","天樂","どういうことなの!?","東京テディベア","どりーみんチュチュ","トリノコシティ","ネトゲ廃人シュプレヒコール","No Logic","ハイハハイニ","はじめまして地球人さん","*ハロー、プラネット。 (I.M.PLSE-EDIT)","Hello, Worker","忘却心中","magnet","右肩の蝶","結ンデ開イテ羅刹ト骸","メランコリック","リモコン","ルカルカ★ナイトフィーバー","炉心融解","WORLD'S END UMBRELLA","アカツキアライヴァル","アゲアゲアゲイン","1925","え?あぁ、そう。","エイリアンエイリアン","ODDS&ENDS","君の体温","こっち向いて Baby","壊セ壊セ","39みゅーじっく!","サンドリヨン","SING&SMILE","スノーマン","DYE","なりすましゲンガー","ヒバナ","ヒビカセ","ブラックゴールド","ミラクルペイント","指切り","ありふれたせかいせいふく","アンハッピーリフレイン","大江戸ジュリアナイト","ゴーストルール","こちら、幸福安心委員会です。","孤独の果て -extend edition-","ジターバグ","Sweet Devil","砂の惑星","テオ","初音ミクの消失 -DEAD END-","秘密警察","妄想スケッチ","リンちゃんなう!","ローリンガール","ロキ","ロミオとシンデレラ","エンヴィキャットウォーク","骸骨楽団とリリア","サイハテ","ジグソーパズル","千本桜","ピアノ×フォルテ×スキャンダル","Blackjack","ぽっぴっぽー","裏表ラバーズ","Sadistic.Music∞Factory","デンパラダイム","二次元ドリームフィーバー","ネガポジ*コンティニューズ","初音ミクの激唱","ワールズエンド・ダンスホール","ココロ","システマティック・ラヴ","Knife","二息歩行","PIANOGIRL","夢喰い白黒バク","ブレス・ユア・ブレス","恋は戦争","あなたの歌姫","Starduster","StargazeR","リンリンシグナル","Rosary Pale","多重未来のカルテット~QUARTET THEME~","LIKE THE WIND","AFTER BURNER"};
static SongInfo SONGNAMES[] = new SongInfo[] {}; static SongInfo SONGNAMES[] = new SongInfo[] {};
static String NEWSONGS[] = new String[] {}; static String NEWSONGS[] = new String[] {"ワールドイズマイン"};
int SCREEN_X; int SCREEN_X;
int SCREEN_Y; int SCREEN_Y;
int WINDOW_X; int WINDOW_X;
@ -213,8 +213,9 @@ public class MyRobot{
MYROBOT.keyRelease(KeyEvent.VK_F12); MYROBOT.keyRelease(KeyEvent.VK_F12);
MYROBOT.keyRelease(KeyEvent.VK_SHIFT); MYROBOT.keyRelease(KeyEvent.VK_SHIFT);
MYROBOT.keyRelease(KeyEvent.VK_CONTROL); MYROBOT.keyRelease(KeyEvent.VK_CONTROL);
Thread.sleep(200);
MYROBOT.refreshScoreScreen(); MYROBOT.refreshScoreScreen();
ImageIO.write(MYROBOT.createNormalScreenCapture(new Rectangle(418,204,1227,690)),"png",new File("scoreimage.png")); ImageIO.write(MYROBOT.createScoreScreenCapture(),"png",new File("scoreimage.png"));
File tmp = new File("tmp"); File tmp = new File("tmp");
if (tmp.exists()) { if (tmp.exists()) {
FileUtils.deleteFile(tmp); FileUtils.deleteFile(tmp);
@ -223,7 +224,7 @@ public class MyRobot{
} }
try { try {
Result data = typeface1.getAllData(MYROBOT.createScoreScreenCapture()); Result data = typeface1.getAllData(MYROBOT.createScoreScreenCapture());
ImageIO.write(MYROBOT.createNormalScreenCapture(new Rectangle(418,204,1227,690)),"png",new File("test.png")); //ImageIO.write(MYROBOT.createNormalScreenCapture(new Rectangle(418,204,1227,690)),"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) { if (data.cool==-1 || data.fine==-1 || data.safe==-1 || data.sad==-1 || data.worst==-1 || data.percent<0f || data.percent>110f) {
System.out.println("Waiting for results to populate..."); System.out.println("Waiting for results to populate...");
} else } else
@ -339,7 +340,7 @@ public class MyRobot{
} }
} }
MYROBOT.refreshScreen(); MYROBOT.refreshScreen();
} catch (IOException e) { } catch (IOException | InterruptedException e) {
e.printStackTrace(); e.printStackTrace();
} }
} }
@ -349,7 +350,7 @@ public class MyRobot{
Color c2 = new Color(MYROBOT.createScreenCapture(new Rectangle(449,400,2,2)).getRGB(0, 0)); Color c2 = new Color(MYROBOT.createScreenCapture(new Rectangle(449,400,2,2)).getRGB(0, 0));
Color c3 = new Color(MYROBOT.createScreenCapture(new Rectangle(901,460,2,2)).getRGB(0, 0)); Color c3 = new Color(MYROBOT.createScreenCapture(new Rectangle(901,460,2,2)).getRGB(0, 0));
return c1.getRed()>=254 && c1.getGreen()>=254 && c1.getBlue()>=254 && c2.getRed()==16 && c2.getGreen()==222 && c2.getBlue()==202 && return c1.getRed()>=254 && c1.getGreen()>=254 && c1.getBlue()>=254 && c2.getRed()==16 && c2.getGreen()==222 && c2.getBlue()==202 &&
c3.getRed()>=220 && c3.getRed()<=255 && c3.getGreen()>=220 && c3.getGreen()<=255 && c3.getBlue()>=160 && c3.getBlue()<=220; c3.getRed()>=219 && c3.getRed()<=255 && c3.getGreen()>=213 && c3.getGreen()<=255 && c3.getBlue()>=160 && c3.getBlue()<=220;
} }
private void GetCurrentDifficulty() { private void GetCurrentDifficulty() {
@ -435,6 +436,7 @@ public class MyRobot{
} }
}); });
RunTests();
f.setVisible(true); f.setVisible(true);
f.setSize(1362, 1036); f.setSize(1362, 1036);
f.add(p); f.add(p);
@ -444,7 +446,6 @@ public class MyRobot{
title.setText((currentSong>=SONGNAMES.length)?"DONE!":SONGNAMES[currentSong].name); title.setText((currentSong>=SONGNAMES.length)?"DONE!":SONGNAMES[currentSong].name);
SongData s = SongData.getByTitle(SONGNAMES[currentSong].name); SongData s = SongData.getByTitle(SONGNAMES[currentSong].name);
RunTests();
BotMain(); BotMain();
} }
@ -465,6 +466,12 @@ public class MyRobot{
RunTest("test10.jpg",486,245,46,22,59,65.34f,"H","SD",false); RunTest("test10.jpg",486,245,46,22,59,65.34f,"H","SD",false);
RunTest("test11.jpg",0,0,0,0,159,0.00f,"EX","SD",true); RunTest("test11.jpg",0,0,0,0,159,0.00f,"EX","SD",true);
RunTest("test12.jpg",0,0,0,0,79,0.08f,"EX","HD",true); RunTest("test12.jpg",0,0,0,0,79,0.08f,"EX","HD",true);
RunTest("test13.jpg",245,19,4,0,2,87.04f,"E","",false);
RunTest("test14.png",623,39,1,0,0,100.83f,"EXEX","HS",false);
RunTest("test15.png",540,57,1,0,3,98.05f,"EX","HS",false);
RunTest("test16.png",320,46,2,0,4,93.26f,"EXEX","HS",false);
RunTest("test17.png",431,30,3,0,3,100.51f,"EXEX","HS",false);
RunTest("test18.png",427,86,5,1,4,92.45f,"EX","HS",false);
RunTest("testimage.png",371,40,3,4,3,97.63f,"EX","HS",false); RunTest("testimage.png",371,40,3,4,3,97.63f,"EX","HS",false);
RunTest("testimage2.png",942,71,1,0,3,97.02f,"EXEX","",false); RunTest("testimage2.png",942,71,1,0,3,97.02f,"EXEX","",false);
RunTest("testimage3.png",546,52,0,0,0,101.77f,"EX","",false); RunTest("testimage3.png",546,52,0,0,0,101.77f,"EX","",false);

@ -29,4 +29,9 @@ public class Result {
return new StringBuilder(Integer.toString(cool)).append("/").append(fine) return new StringBuilder(Integer.toString(cool)).append("/").append(fine)
.append("/").append(safe).append("/").append(sad).append("/").append(worst).append(" ").append(percent).append("%").toString(); .append("/").append(safe).append("/").append(sad).append("/").append(worst).append(" ").append(percent).append("%").toString();
} }
public String displayDebug() {
return new StringBuilder(Integer.toString(cool)).append(",").append(fine)
.append(",").append(safe).append(",").append(sad).append(",").append(worst).append(",").append(percent).append("f")
.append(",\"").append(difficulty).append("\",\"").append(mod).append("\",").append(Boolean.toString(fail).toLowerCase()).toString();
}
} }

@ -17,11 +17,13 @@ public class TestMain {
ImageIO.read(new File("typeface.png")), ImageIO.read(new File("typeface.png")),
ImageIO.read(new File("typeface2.png")) ImageIO.read(new File("typeface2.png"))
); );
CustomRobot r = new CustomRobot(); /*CustomRobot r = new CustomRobot();
Thread.sleep(3000); Thread.sleep(3000);
r.refreshScoreScreen(); r.refreshScoreScreen();
ImageIO.write(r.scoreCurrentScreen,"png",new File("liveimage.png")); ImageIO.write(r.scoreCurrentScreen,"png",new File("testsuite","liveimage.png"));*/
System.out.println(font.getAllData(ImageIO.read(new File("liveimage.png")),true).display()); System.out.println(font.getAllData(ImageIO.read(new File("testsuite","test18.png")),false).display());
System.out.println(font.getAllData(ImageIO.read(new File("testsuite","test18.png")),true).displayDebug());
//System.out.println(font.getAllData(ImageIO.read(new File("testsuite","test14.png"))).display());
/*System.out.println(font.getAllData(ImageIO.read(new File("testimage.png"))).display()); /*System.out.println(font.getAllData(ImageIO.read(new File("testimage.png"))).display());
System.out.println(font.getAllData(ImageIO.read(new File("testimage2.png"))).display()); System.out.println(font.getAllData(ImageIO.read(new File("testimage2.png"))).display());
System.out.println(font.getAllData(ImageIO.read(new File("testimage3.png"))).display()); System.out.println(font.getAllData(ImageIO.read(new File("testimage3.png"))).display());

@ -180,7 +180,7 @@ public class TypeFace2 {
} }
} else } else
if (fontCol.equals(Color.GREEN)) { if (fontCol.equals(Color.GREEN)) {
if ((pixelCol.getRed()<93 if ((pixelCol.getRed()<99
&& pixelCol.getGreen()<176 && pixelCol.getBlue()>130)) { && pixelCol.getGreen()<176 && pixelCol.getBlue()>130)) {
if (debug) { if (debug) {
test.setRGB(x, y, pixelCol.getRGB()); test.setRGB(x, y, pixelCol.getRGB());
@ -292,7 +292,7 @@ public class TypeFace2 {
} }
} else } else
if (fontCol.equals(Color.GREEN)) { if (fontCol.equals(Color.GREEN)) {
if ((pixelCol.getRed()<93 if ((pixelCol.getRed()<99
&& pixelCol.getGreen()<176 && pixelCol.getBlue()>130)) { && pixelCol.getGreen()<176 && pixelCol.getBlue()>130)) {
if (debug) { if (debug) {
test.setRGB(x, y, pixelCol.getRGB()); test.setRGB(x, y, pixelCol.getRGB());
@ -385,7 +385,7 @@ public class TypeFace2 {
} }
} else } else
if (fontCol.equals(Color.GREEN) && (pixelCol.getRed()>166 if (fontCol.equals(Color.GREEN) && (pixelCol.getRed()>166
|| pixelCol.getGreen()>166 || pixelCol.getBlue()>175)) { || pixelCol.getGreen()>171 || pixelCol.getBlue()>185)) {
//Breaks a rule. //Breaks a rule.
ruleBreak=true; ruleBreak=true;
if (!debug) { if (!debug) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 544 KiB

After

Width:  |  Height:  |  Size: 841 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Loading…
Cancel
Save