internal void ChangeVolumeIRC(IRC.OldIRCClient ircBot, string poopedString, MainForm formReference)
 {
     if (!poopedString.Contains(" "))
     {
         ircBot.SendChatMessage("The Volume is: " + Convert.ToInt32(programSettings.Volume * 100).ToString() + "%");
     }
     else
     {
         string[] splice = poopedString.Split(new char[] { ' ' }, 2);
         if (float.TryParse(splice[1], out float volume))
         {
             volume = volume / 100f;
             if (volume < 1.0f && volume >= 0.01f)
             {
                 for (int i = 0; i < SoundPlayererStack.Count; i++)
                 {
                     if (!SoundPlayererStack[i].DonePlaying())
                     {
                         SoundPlayererStack[i].SetVolume(volume);
                     }
                 }
                 formReference.ThreadSafeMoveSlider((int)(volume * 100));
                 ircBot.SendChatMessage("Updated volume to: " + Convert.ToInt32(volume * 100).ToString() + "%");
             }
         }
     }
 }
Ejemplo n.º 2
0
 public IRCBot(MainForm parentReference, PrivateSettings programSettings, SoundBase soundDb, char PrefixChar)
 {
     irc = new OldIRCClient(parentReference, programSettings.TwitchServer, programSettings.TwitchUsername, programSettings.TwitchPassword, programSettings.TwitchChannelToJoin, programSettings.SoundRewardID, programSettings.TTSRewardID);
     this.programSettings = programSettings;
     channelToJoin        = programSettings.TwitchChannelToJoin;
     parent          = parentReference;
     this.PrefixChar = PrefixChar;
     SndDB           = soundDb;
 }
 internal void ChangeDelay(IRC.OldIRCClient ircBot, string poopedString)
 {
     if (!poopedString.Contains(" "))
     {
         ircBot.SendChatMessage("The delay is: " + delay.ToString() + " second(s).");
     }
     else
     {
         string[] splice = poopedString.Split(new char[] { ' ' }, 2);
         if (int.TryParse(splice[1], out int delay))
         {
             if (delay >= 0 && delay < 1800)
             {
                 this.delay            = delay;
                 programSettings.Delay = delay;
                 ircBot.SendChatMessage("Updated delay to: " + delay.ToString() + " second(s).");
             }
         }
     }
 }
        internal void RemoveSound(IRC.OldIRCClient irc, string text)
        {
            text = text.Split(' ').Last();
            if (text.StartsWith("!"))
            {
                text = text.Remove(0, 1);
            }

            for (int i = 0; i < soundlist.Count; i++)
            {
                if (soundlist[i].GetCommand() == text)
                {
                    soundlist.RemoveAt(i);
                    SoundStorageXML.SaveSoundBase(SoundBaseFile, soundlist);
                    irc.SendChatMessage("Removed sound entry #" + i.ToString() + ".");
                    return;
                }
            }
            irc.SendChatMessage("Nothing found.");
        }