diff --git a/DivaBot/TypeFace_API.jar b/DivaBot/TypeFace_API.jar index be424ff..5964f3f 100644 Binary files a/DivaBot/TypeFace_API.jar and b/DivaBot/TypeFace_API.jar differ diff --git a/DivaBot/calibration_data.txt b/DivaBot/calibration_data.txt index 81c24bb..ae0b987 100644 --- a/DivaBot/calibration_data.txt +++ b/DivaBot/calibration_data.txt @@ -1,4 +1,4 @@ -467 -285 -1599 -925 +437 +289 +1330 +793 diff --git a/DivaBot/capture_1.png b/DivaBot/capture_1.png index 022b86d..48f895d 100644 Binary files a/DivaBot/capture_1.png and b/DivaBot/capture_1.png differ diff --git a/DivaBot/capture_2.png b/DivaBot/capture_2.png index 7e054f1..a675772 100644 Binary files a/DivaBot/capture_2.png and b/DivaBot/capture_2.png differ diff --git a/DivaBot/capture_3.png b/DivaBot/capture_3.png index 4c443d8..8d2603b 100644 Binary files a/DivaBot/capture_3.png and b/DivaBot/capture_3.png differ diff --git a/DivaBot/src/sig/MyRobot.java b/DivaBot/src/sig/MyRobot.java index ae0b4e5..7b2b1ce 100644 --- a/DivaBot/src/sig/MyRobot.java +++ b/DivaBot/src/sig/MyRobot.java @@ -375,6 +375,15 @@ public class MyRobot{ } try { final Result data = typeface1.getAllData(MYROBOT.createScoreScreenCapture()); + MYROBOT.setAutoDelay(0); + if (NEWSONGS.length==0) { + MYROBOT.keyPress(KeyEvent.VK_CONTROL); + MYROBOT.keyPress(KeyEvent.VK_SHIFT); + MYROBOT.keyPress(KeyEvent.VK_F11); + MYROBOT.keyRelease(KeyEvent.VK_F11); + MYROBOT.keyRelease(KeyEvent.VK_SHIFT); + MYROBOT.keyRelease(KeyEvent.VK_CONTROL); + } 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) { 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..."); @@ -396,13 +405,13 @@ public class MyRobot{ && data.score!=lastscore /*|| lastpercent!=percent*/){ System.out.println("Results for "+selectedSong.title+" "+data.difficulty+": "+data.display()); TypeFace2.deepCopyOfficialYPointersFromPointers(); - File songFolder = new File(selectedSong.title+"/"+data.difficulty); + File songFolder = new File(selectedSong.title.replace(":","")+"/"+data.difficulty); if (!songFolder.exists()) { songFolder.mkdirs(); } File[] songFolderFiles = songFolder.listFiles(); int playId = songFolderFiles.length; - final File playFolder = new File(selectedSong.title+"/"+data.difficulty+"/"+playId); + final File playFolder = new File(selectedSong.title.replace(":","")+"/"+data.difficulty+"/"+playId); playFolder.mkdir(); recordedResults=true; lastcool=data.cool; @@ -414,7 +423,7 @@ public class MyRobot{ lastcombo=data.combo; lastscore=data.score; lastfail=data.fail; - File resultImage=new File(playFolder,selectedSong.title+"_"+data.difficulty+"play_"+data.cool+"_"+data.fine+"_"+data.safe+"_"+data.sad+"_"+data.worst+"_"+data.percent+"" + File resultImage=new File(playFolder,selectedSong.title.replace(":","")+"_"+data.difficulty+"play_"+data.cool+"_"+data.fine+"_"+data.safe+"_"+data.sad+"_"+data.worst+"_"+data.percent+"" + "_"+data.combo+"_"+data.score+".png"); new File("scoreimage.png").renameTo(resultImage); results.add(new Result(selectedSong.title,data.difficulty,data.cool,data.fine,data.safe,data.sad,data.worst,data.percent,data.mod,data.combo,data.score,data.fail,resultImage)); @@ -422,15 +431,6 @@ public class MyRobot{ //gotoxy(800,64); //click(); - MYROBOT.setAutoDelay(0); - if (NEWSONGS.length==0) { - MYROBOT.keyPress(KeyEvent.VK_CONTROL); - MYROBOT.keyPress(KeyEvent.VK_SHIFT); - MYROBOT.keyPress(KeyEvent.VK_F11); - MYROBOT.keyRelease(KeyEvent.VK_F11); - MYROBOT.keyRelease(KeyEvent.VK_SHIFT); - MYROBOT.keyRelease(KeyEvent.VK_CONTROL); - } } } catch (IOException|NumberFormatException|IndexOutOfBoundsException e) { e.printStackTrace(); diff --git a/DivaBot/src/sig/TypeFace2.java b/DivaBot/src/sig/TypeFace2.java index 16d26b5..08f913e 100644 --- a/DivaBot/src/sig/TypeFace2.java +++ b/DivaBot/src/sig/TypeFace2.java @@ -87,6 +87,15 @@ public class TypeFace2 { officialypointers[i]=ypointers[i]; } } + + public boolean isClass(String className) { + try { + Class.forName(className); + return true; + } catch (ClassNotFoundException e) { + return false; + } + } public Result getAllData(BufferedImage img, boolean debug) throws IOException { deepCopyDefaultYPointers(); @@ -100,16 +109,18 @@ public class TypeFace2 { result.mode = getMode(img2,debug); - if (MyRobot.FUTURETONE) { - /*if (result.mode!=Mode.FUTURETONE) { - System.out.println("The current mode is "+result.mode+", but the results screen thinks this is Megamix... We're going to manually fix it for now. Let sig know this is appearing."); - }*/ - result.mode=Mode.FUTURETONE; - } else { - /*if (result.mode!=Mode.MEGAMIX) { - System.out.println("The current mode is "+result.mode+", but the results screen thinks this is Future Tone... We're going to manually fix it for now. Let sig know this is appearing."); - }*/ - result.mode=Mode.MEGAMIX; + if (isClass("sig.MyRobot")) { + if (MyRobot.FUTURETONE) { + /*if (result.mode!=Mode.FUTURETONE) { + System.out.println("The current mode is "+result.mode+", but the results screen thinks this is Megamix... We're going to manually fix it for now. Let sig know this is appearing."); + }*/ + result.mode=Mode.FUTURETONE; + } else { + /*if (result.mode!=Mode.MEGAMIX) { + System.out.println("The current mode is "+result.mode+", but the results screen thinks this is Future Tone... We're going to manually fix it for now. Let sig know this is appearing."); + }*/ + result.mode=Mode.MEGAMIX; + } } switch (result.mode) {