This repository has been archived by the owner on May 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
32e39dc
commit 15f7c38
Showing
9 changed files
with
219 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using Newtonsoft.Json; | ||
using SteamKit2; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Timers; | ||
|
||
namespace SteamBotLite | ||
{ | ||
class CountDownModule : MotdModule | ||
{ | ||
public CountDownModule(VBot bot, Dictionary<string, object> Jsconfig) : base(bot, Jsconfig){ } | ||
|
||
public override string GetName() | ||
{ | ||
return "!Countdown"; | ||
} | ||
public override int DefaultPostCountLimit() | ||
{ | ||
return 24 * 60; | ||
} | ||
/// <summary> | ||
/// Posts the MOTD to the group chat | ||
/// </summary> | ||
/// <param name="sender"></param> | ||
/// <param name="e"></param> | ||
public override void MotdPost(object sender, EventArgs e) | ||
{ | ||
if (message != null && !message.Equals(string.Empty)) | ||
{ | ||
double hoursdata = (postCountLimit - postCount) / 60; | ||
Math.Ceiling(hoursdata); | ||
|
||
string hours = (hoursdata.ToString().PadLeft(2, '0')); | ||
string minutes = ((postCountLimit - postCount) % 60).ToString().PadLeft(2, '0'); | ||
message = hours + ":" + minutes; | ||
|
||
userhandler.SetStatusmessageEvent(message); | ||
|
||
postCount++; | ||
if (postCount > postCountLimit) | ||
message = null; | ||
savePersistentData(); | ||
} | ||
} | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.