Skip to content

Commit

Permalink
configurable map announcement | increased delay
Browse files Browse the repository at this point in the history
  • Loading branch information
bl4ckscor3 committed Jun 17, 2016
1 parent c757a8d commit 269d696
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#Changelog
---
**5.7.5.1**
- Added config option for map announcing
- Increased delay

####5.7.5
- Added map announcing for the aG Surf Skill server

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>bl4ckscor3.bot</groupId>
<artifactId>bl4ckb0t</artifactId>
<version>5.7.5</version>
<version>5.7.5.1</version>
<name>bl4ckb0t</name>
<description>An IRC bot designed and managed by bl4ckscor3</description>
<url>https://github.com/bl4ckscor3/bl4ckb0t</url>
Expand Down
4 changes: 3 additions & 1 deletion src/bl4ckscor3/bot/bl4ckb0t/ConfigurationFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public class ConfigurationFile
"showWelcomeBackMsg=true",
"spellingCorrection=true",
"shrugs=true",
"kickOnBannedImgurLink=true"
"kickOnBannedImgurLink=true",
"queryAGMaps=true"

};

/**
Expand Down
11 changes: 8 additions & 3 deletions src/bl4ckscor3/bot/bl4ckb0t/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Core
public static Bot bot;
private static boolean wasStartedAsWIP;
private static final String botName = "bl4ckb0t";
private static final String version = "5.7.5";
private static final String version = "5.7.5.1";
private static ConfigurationFile customConfig;

public static void main(String args[]) throws IOException, IrcException
Expand Down Expand Up @@ -71,8 +71,13 @@ public static void createBot(boolean wip) throws IOException, IrcException
Lists.clearAll();
Startup.callMethods();
Logging.info("Completed last setup steps...");
Executors.newScheduledThreadPool(1).scheduleWithFixedDelay(new AGMaps(), 60, 60, TimeUnit.SECONDS);
Logging.info("Started AGMaps executor...");

if(bot.getConfig().isEnabled("queryAGMaps"))
{
Executors.newScheduledThreadPool(1).scheduleWithFixedDelay(new AGMaps(), 1, 10, TimeUnit.MINUTES);
Logging.info("Started AGMaps executor...");
}

Logging.info("Starting bot...");
bot.startBot();
}
Expand Down
2 changes: 1 addition & 1 deletion src/bl4ckscor3/bot/bl4ckb0t/misc/AGMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public AGMaps()
@Override
public void run()
{
if(!Core.bot.isEnabled())
if(!Core.bot.isEnabled() || !Core.bot.getConfig().isEnabled("queryAGMaps"))
return;

try
Expand Down

0 comments on commit 269d696

Please sign in to comment.