max flood limit

This commit is contained in:
hgw 2023-10-02 02:14:35 +00:00
parent d5b4027931
commit 96b361ce07

42
bot.js
View File

@ -48,9 +48,13 @@ async function help(chan) {
bot.say(chan, "$uspam [LINES] - Spams x lines of random unicode characters of varying length") bot.say(chan, "$uspam [LINES] - Spams x lines of random unicode characters of varying length")
} }
async function flood(text, chan, times) { async function flood(text, chan, amt) {
for(var i=0; i < times; i++){ if (amt > '100000') {
bot.say(chan, text); bot.say(chan, "no");
} else {
for(var i=0; i < amt; i++){
bot.say(chan, text);
}
} }
} }
@ -64,22 +68,34 @@ async function sneed(chan) {
} }
async function ctcp(target, text, amt) { async function ctcp(target, text, amt) {
for(var i=0; i < amt; i++){ if (amt > '100000') {
bot.ctcp(target, "privmsg", text); bot.say(chan, "no");
await timer(1000); } else {
} for(var i=0; i < amt; i++){
bot.ctcp(target, "privmsg", text);
await timer(1000);
}
}
} }
async function rspam(chan, amt) { async function rspam(chan, amt) {
for(var i=0; i < amt; i++){ if (amt > '100000') {
bot.say(chan, generateRandomString(randomext.integer(100,60))); bot.say(chan, "no")
} } else {
for(var i=0; i < amt; i++){
bot.say(chan, generateRandomString(randomext.integer(100,60)));
}
}
} }
async function uspam(chan, amt){ async function uspam(chan, amt){
for(var i=0; i < amt; i++){ if (amt > '100000') {
bot.say(chan, "0" + randomext.integer(9,0) + randomext.uString(120,40)); bot.say(chan, "no")
} } else {
for(var i=0; i < amt; i++){
bot.say(chan, "0" + randomext.integer(9,0) + randomext.uString(120,40));
}
}
} }
bot.addListener('message', function(nick, to, text, from) { bot.addListener('message', function(nick, to, text, from) {