Add team only spam

This commit is contained in:
LightCat 2019-04-22 00:14:35 +02:00
parent 5e0492058b
commit 9ce03fa6c1
2 changed files with 6 additions and 4 deletions

View File

@ -16,16 +16,17 @@
<AutoVariable width="fill" target="spam.filename" label="Custom Spam"/> <AutoVariable width="fill" target="spam.filename" label="Custom Spam"/>
<AutoVariable width="fill" target="spam.random" label="Randomize"/> <AutoVariable width="fill" target="spam.random" label="Randomize"/>
<AutoVariable width="fill" target="spam.delay" label="Spam Delay"/> <AutoVariable width="fill" target="spam.delay" label="Spam Delay"/>
<AutoVariable width="fill" target="spam.teamchat" label="Spam in teamchat"/>
</List> </List>
</Box> </Box>
<Box padding="12 6 6 6" width="content" height="content" name="Chat Log" y="85"> <Box padding="12 6 6 6" width="content" height="content" name="Chat Log" y="105">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="chat-log.enable" label="Enable Chat Log"/> <AutoVariable width="fill" target="chat-log.enable" label="Enable Chat Log"/>
<AutoVariable width="fill" target="chat-log.no-ipc" label="Ignore IPC"/> <AutoVariable width="fill" target="chat-log.no-ipc" label="Ignore IPC"/>
<AutoVariable width="fill" target="chat-log.no-spam" label="Anti Spam"/> <AutoVariable width="fill" target="chat-log.no-spam" label="Anti Spam"/>
</List> </List>
</Box> </Box>
<Box name="Chat Censor" width="content" height="content" padding="12 6 6 6" y="150"> <Box name="Chat Censor" width="content" height="content" padding="12 6 6 6" y="170">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="chat.censor.enable" label="Enable Chat Censor"/> <AutoVariable width="fill" target="chat.censor.enable" label="Enable Chat Censor"/>
<AutoVariable width="fill" target="chat.censor.filter" label="Filter"/> <AutoVariable width="fill" target="chat.censor.filter" label="Filter"/>
@ -107,7 +108,7 @@
<AutoVariable width="fill" target="irc.channel" label="Channel"/> <AutoVariable width="fill" target="irc.channel" label="Channel"/>
</List> </List>
</Box> </Box>
<Box name="Command & Control" width="content" height="content" padding="12 6 6 6" y="185"> <Box name="Command & Control" width="content" height="content" padding="12 6 6 6" y="205">
<List width="150"> <List width="150">
<AutoVariable width="fill" target="irc.cc.channel" label="Channel"/> <AutoVariable width="fill" target="irc.cc.channel" label="Channel"/>
<AutoVariable width="fill" target="irc.cc.password" label="Password"/> <AutoVariable width="fill" target="irc.cc.password" label="Password"/>

View File

@ -16,6 +16,7 @@ static settings::String filename{ "spam.filename", "spam.txt" };
static settings::Int spam_delay{ "spam.delay", "800" }; static settings::Int spam_delay{ "spam.delay", "800" };
static settings::Int voicecommand_spam{ "spam.voicecommand", "0" }; static settings::Int voicecommand_spam{ "spam.voicecommand", "0" };
static settings::Bool teamname_spam{ "spam.teamname", "0" }; static settings::Bool teamname_spam{ "spam.teamname", "0" };
static settings::Bool team_only{ "spam.teamchat", "false" };
namespace hacks::shared::spam namespace hacks::shared::spam
{ {
@ -353,7 +354,7 @@ void createMove()
last_index = current_index; last_index = current_index;
std::string spamString = source->at(current_index); std::string spamString = source->at(current_index);
if (FormatSpamMessage(spamString)) if (FormatSpamMessage(spamString))
chat_stack::Say(spamString, false); chat_stack::Say(spamString, *team_only);
current_index++; current_index++;
} }
last_spam_point = std::chrono::system_clock::now(); last_spam_point = std::chrono::system_clock::now();