Make countdown timer still tick down during sleep events. Extend all

event timers.
master
sigonasr2 6 years ago
parent 57089588ad
commit 15ba81d7c0
  1. BIN
      BandoriBot/BandoriBot.jar
  2. 16
      BandoriBot/src/sig/BandoriBot.java

Binary file not shown.

@ -169,7 +169,7 @@ public class BandoriBot extends ListenerAdapter{
FileReader rd = new FileReader(store_file); FileReader rd = new FileReader(store_file);
BufferedReader reader = new BufferedReader(rd); BufferedReader reader = new BufferedReader(rd);
String status = reader.readLine(); String status = reader.readLine();
UpdateBotStatus(status,300 + (int)((30*60)*Math.random())); UpdateBotStatus(status,900 + (int)((90*60)*Math.random()));
reader.close(); reader.close();
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();
@ -177,27 +177,27 @@ public class BandoriBot extends ListenerAdapter{
} }
while (true) { while (true) {
noMessageTimer++; noMessageTimer++;
if (noMessageTimer>3600) { if (noMessageTimer>7200) {
if (noMessageTimer>9000) { if (noMessageTimer>18000) {
currentEvent = "Dreaming about stars"; currentEvent = "Dreaming about stars";
if (currentEventTimer==0) { if (currentEventTimer==0) {
UpdateBotStatus(currentEvent,0); UpdateBotStatus(currentEvent,0);
}
currentEventTimer = 300; currentEventTimer = 300;
}
} else } else
if (noMessageTimer>7200) { if (noMessageTimer>14400) {
currentEvent = "Sleeping"; currentEvent = "Sleeping";
if (currentEventTimer==0) { if (currentEventTimer==0) {
UpdateBotStatus(currentEvent,0); UpdateBotStatus(currentEvent,0);
}
currentEventTimer = 300; currentEventTimer = 300;
}
} else { } else {
currentEvent = "Taking a cat-nap"; currentEvent = "Taking a cat-nap";
if (currentEventTimer==0) { if (currentEventTimer==0) {
UpdateBotStatus(currentEvent,0); UpdateBotStatus(currentEvent,0);
}
currentEventTimer = 300; currentEventTimer = 300;
} }
}
} else { } else {
if (currentEventTimer==0 && Math.random()<(1/300d)) { if (currentEventTimer==0 && Math.random()<(1/300d)) {
//Start a new event. //Start a new event.
@ -219,7 +219,7 @@ public class BandoriBot extends ListenerAdapter{
} else { } else {
currentEvent = currentEvent.replace("<POSSIBLECHAR>", ""); currentEvent = currentEvent.replace("<POSSIBLECHAR>", "");
} }
UpdateBotStatus(currentEvent,300 + (int)((30*60)*Math.random())); UpdateBotStatus(currentEvent,900 + (int)((90*60)*Math.random()));
} }
} }

Loading…
Cancel
Save