Try different darkness detection method.

This commit is contained in:
sigonasr2 2020-03-21 02:58:05 +09:00
parent ed9d23771a
commit 06c8852851
4 changed files with 11 additions and 2 deletions

1
.gitignore vendored
View File

@ -23,3 +23,4 @@
/mapdata /mapdata
/temp_connect /temp_connect
/tmp_mapdata /tmp_mapdata
/tmp2

Binary file not shown.

View File

@ -311,7 +311,7 @@ public class Profile {
RabiRaceModule.syncEvents=true; RabiRaceModule.syncEvents=true;
RabiRaceModule.hasDied=false; RabiRaceModule.hasDied=false;
} }
/*
if (parent.readIntFromMemory(MemoryOffset.DARKNESS)>0 && RabiRaceModule.syncEvents) { if (parent.readIntFromMemory(MemoryOffset.DARKNESS)>0 && RabiRaceModule.syncEvents) {
RabiRaceModule.syncEvents=false; RabiRaceModule.syncEvents=false;
} }
@ -323,6 +323,14 @@ public class Profile {
parent.readIntFromMemory(MemoryOffset.DARKNESS)>0) { parent.readIntFromMemory(MemoryOffset.DARKNESS)>0) {
RabiRaceModule.syncEvents=true; RabiRaceModule.syncEvents=true;
RabiRaceModule.darknessHasReachedzero=false; RabiRaceModule.darknessHasReachedzero=false;
}*/
if (parent.readIntFromMemory(MemoryOffset.DARKNESS)>0 && RabiRaceModule.darknessHasReachedzero) {
RabiRaceModule.syncEvents=!RabiRaceModule.syncEvents;
RabiRaceModule.darknessHasReachedzero=false;
}
if (parent.readIntFromMemory(MemoryOffset.DARKNESS)==0) {
RabiRaceModule.darknessHasReachedzero=true;
} }
for (int i=0;i<EVENT_COUNT;i++) { for (int i=0;i<EVENT_COUNT;i++) {
if (NonRestrictedValue(i)) { if (NonRestrictedValue(i)) {

View File

@ -93,7 +93,7 @@ public class RabiRaceModule extends Module{
public HashMap<Integer,Integer> newmapdata = new HashMap<Integer,Integer>(); public HashMap<Integer,Integer> newmapdata = new HashMap<Integer,Integer>();
public static ScheduledExecutorService scheduler,scheduler2; public static ScheduledExecutorService scheduler,scheduler2;
public static boolean syncEvents = true; public static boolean syncEvents = true;
public static boolean darknessHasReachedzero = false; //darkness needs to go down to 0, then go back up. public static boolean darknessHasReachedzero = true; //darkness needs to go down to 0, then go back up.
public static boolean hasDied = false; public static boolean hasDied = false;
int frames=0; int frames=0;