Author Topic: [Guide] Report Betting Stats (Percentages) in Chat  (Read 3316 times)

0 Members and 1 Guest are viewing this topic.

TheDefiant604

  • Youngling
  • *
  • Posts: 21
  • Karma: +0/-0
    • View Profile
  • Twitch Name: TheDefiant604
[Guide] Report Betting Stats (Percentages) in Chat
« on: August 23, 2016, 10:54:55 PM »
This is a simple command that can be used as an alternative to displaying betting percentages on-screen via OBS.

NOTE: This command requires a DeepBot VIP subscription as @readfile@ is a VIP variable.

Code: [Select]
Betting Stats: @if@[@readfile@[obs\BettingStats.txt]||||No betting pool currently active.||@readfile@[obs\BettingStats.txt]]
To add this command via chat:
Code: [Select]
!addcmd !bet% Betting Stats: @if@[@readfile@[obs\BettingStats.txt]||||No betting pool currently active.||@readfile@[obs\BettingStats.txt]]Replace !bet% with whatever command you want this to be under.

Now, whenever a user in your chat types the command, they will get the percentages of bets on each option, such as:
Quote
[07:36:24] @TheDefiant604: !bet%
[07:36:25] @^RRbot: Betting Stats: 1. A(100%), 2. B(%), 3. C(%)

If nobody started a betting pool, the command will return the following:
Quote
[07:39:58] @TheDefiant604: !bet%
[07:39:58] @^RRbot: Betting Stats: No betting pool currently active.
Chat Moderator for RandomRambo

TheDefiant604

  • Youngling
  • *
  • Posts: 21
  • Karma: +0/-0
    • View Profile
  • Twitch Name: TheDefiant604
Re: [Guide] Report Betting Stats (Percentages) in Chat
« Reply #1 on: August 24, 2016, 05:35:06 PM »
To add a built-in cooldown to the command...

Code: [Select]
@if@[>=||@calc@[-|@unixtime@|@readfile@[BettingStatsCmdCD.txt]]||15||@savefile@[BettingStatsCmdCD.txt,@unixtime@]Betting Stats: @if@[@readfile@[obs\BettingStats.txt]||||No betting pool currently active.||@readfile@[obs\BettingStats.txt]]||]The cooldown as provided is 15 seconds.  To change the length of the cooldown, edit the command — this can be done via chat, as the command text isn't very long — and change the 15 to whatever you want the cooldown to be.

When this command succeeds, it writes @unixtime@ to the cooldown file, then reads the BettingStats.txt file, as detailed in my original post.  When this command fails, due to still being on cooldown, nothing is output.

NOTE: I am aware there is a cooldown option in the GUI that makes this built-in cooldown unnecessary.  I am providing this built-in cooldown check for chat moderators, such as myself, who do not have access to the GUI.
Chat Moderator for RandomRambo