mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Make frame delay configurable
This commit is contained in:
@@ -184,6 +184,8 @@ private async Task AnimatedDisplayTable(List<int> playerNumbers, List<int> casin
|
||||
if (i > 60) return;
|
||||
await Task.Delay(100);
|
||||
}
|
||||
|
||||
var frameDelay = (await SettingsProvider.GetValueAsync(BuiltIn.Keys.KasinoKenoFrameDelay)).ToType<int>();
|
||||
//FIRST FRAME 11111111111111111111111111111
|
||||
for (var frame = 0; frame < 10; frame++) //1 frame per casino number
|
||||
{
|
||||
@@ -213,16 +215,15 @@ private async Task AnimatedDisplayTable(List<int> playerNumbers, List<int> casin
|
||||
displayMessage += "[br]";
|
||||
}
|
||||
await botInstance.KfClient.EditMessageAsync(msg.ChatMessageId!.Value, displayMessage);
|
||||
await Task.Delay(500);
|
||||
if (displayMessage.Length > 79 || !displayMessage.Contains(BlankSpaceDisplay) ||
|
||||
!(displayMessage.Contains(CasinoNumberDisplay) || displayMessage.Contains(MatchRevealDisplay)) && frame != 9) //every board should have blank spaces and casino numbers or matches. player numbers might be hidden by matches
|
||||
{
|
||||
await Task.Delay(frameDelay);
|
||||
if (displayMessage.Length <= 79 && displayMessage.Contains(BlankSpaceDisplay) &&
|
||||
(displayMessage.Contains(CasinoNumberDisplay) || displayMessage.Contains(MatchRevealDisplay) ||
|
||||
frame == 9)) continue; //every board should have blank spaces and casino numbers or matches. player numbers might be hidden by matches
|
||||
logger.Info($"Casino numbers: {string.Join(",", casinoNumbers)} | Player Numbers: {string.Join(",", playerNumbers)} | Matches: {string.Join(",", matches)} | Frame: {frame - 1} | Display Board:");
|
||||
logger.Info(displayMessage);
|
||||
await botInstance.SendChatMessageAsync($"Keno is bugged dewd, died on frame {frame} :bossman:", true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<int> GenerateKenoNumbers(int size, GamblerDbModel gambler)
|
||||
{
|
||||
|
||||
@@ -1083,6 +1083,14 @@ public static class BuiltIn
|
||||
Description = "Object containing details of Bossman's last sighting",
|
||||
Default = "{\n \"When\": \"2025-10-03T01:20:00-04:00\",\n \"Activity\": \"going to jail\"\n}",
|
||||
ValueType = SettingValueType.Complex
|
||||
},
|
||||
new BuiltInSettingsModel
|
||||
{
|
||||
Key = Keys.KasinoKenoFrameDelay,
|
||||
Description = "Delay in milliseconds between each frame on the keno board",
|
||||
Default = "250",
|
||||
ValueType = SettingValueType.Text,
|
||||
Regex = WholeNumberRegex
|
||||
}
|
||||
];
|
||||
|
||||
@@ -1208,5 +1216,6 @@ public static class BuiltIn
|
||||
public static string CaptureStreamlinkBmjWorkingDirectory = "Bot.Streamlink.BmjWorkingDirectory";
|
||||
public static string DiscordOnlySendSummariesIncludingBmj = "Discord.OnlySendSummariesIncludingBmj";
|
||||
public static string BossmanLastSighting = "Bot.BossmanLastSighting";
|
||||
public static string KasinoKenoFrameDelay = "Kasino.Keno.FrameDelay";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user