Skip to content

Commit

Permalink
Fix output generated by deadbox check and twitch bot.
Browse files Browse the repository at this point in the history
  • Loading branch information
zingmars committed Oct 12, 2015
1 parent 8e6c8d8 commit 34cdcd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,7 @@
*) There is now a function that allows you to get the current UNIX time. It's in the settings class.
*) Release.zip should now be extractable by all zip archivers, not just the very modern ones.
(11.10.2015) v1.1.1
*) Fixed logic errors in the new plugins
*) Fixed logic errors in the new plugins
(12.10.2015) v1.1.2
*) Fixed the time string rounding algorithm.
*) Fixed the output of some of the plugins.
5 changes: 3 additions & 2 deletions src/BotPlugins/DeadboxCheck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ public class DeadboxCheck : BasePlugin()
try {
var timeSinceLast = buffer.time.toLong() - lastMessage
if(lastMessage != 0L && timeSinceLast >= 3600L) {
//TODO: Use generatetimestring
if(timeSinceLast > RecordTime) {
RecordTime = timeSinceLast
RecordUsername = buffer.userName
controller?.AddToBoxBuffer("Congratz " + buffer.userName + "! You just revived the box and set a new record doing so! This deadbox lasted " + (timeSinceLast.toDouble()/60).toString() + " minutes.")
controller?.AddToBoxBuffer("Congratz " + buffer.userName + "! You just revived the box and set a new record doing so! This deadbox lasted " + settings?.generateTimeString(buffer.time.toLong(), lastMessage) + ".")
saveData()
} else {
controller?.AddToBoxBuffer("Congratz " + buffer.userName + "! You just revived the box. This deadbox lasted " + (timeSinceLast.toDouble()/60).toString() + " minutes. The longest recorded deadbox was " + (RecordTime.toDouble()/60).toString() + " minutes long and it was broken by " + RecordUsername)
controller?.AddToBoxBuffer("Congratz " + buffer.userName + "! You just revived the box. This deadbox lasted " + settings?.generateTimeString(buffer.time.toLong(), lastMessage) + ". The longest recorded deadbox was " + ((RecordTime.toInt()*100).toDouble()/100).toString() + " minutes long and it was broken by " + RecordUsername)
}
}
lastMessage = settings?.getCurrentTime() as Long
Expand Down
2 changes: 1 addition & 1 deletion src/BotPlugins/TwitchCheck.kt
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public class TwitchCheck : BasePlugin()
stalkList.set(key, data)
stalkState.set(key, "false")
logger?.LogPlugin(this.pluginName.toString(), "User " + key + " has stopped streaming!")
controller?.AddToBoxBuffer("User " + key + " has stopped streaming. Stream length was " + settings?.generateTimeString(data.get(1).toLong(), data.get(0).toLong()) + " minutes")
controller?.AddToBoxBuffer("User " + key + " has stopped streaming. Stream length was " + settings?.generateTimeString(data.get(1).toLong(), data.get(0).toLong()) + ".")
}
}
} else {
Expand Down

0 comments on commit 34cdcd2

Please sign in to comment.