unmerge uspam and rspam

This commit is contained in:
hgw 2023-10-02 02:14:36 +00:00
parent 4004815b47
commit cb2d0756f5

26
bot.js
View File

@ -9,7 +9,7 @@ var config = { //edit your shit here
server: "irc.supernets.org", server: "irc.supernets.org",
port: 6697, port: 6697,
SSL: true, SSL: true,
channels: ['#dev'], channels: ['#dev', '#superbowl'],
botName: "fascinus", botName: "fascinus",
userName: "fascinus", userName: "fascinus",
realName: "Sneed" realName: "Sneed"
@ -78,16 +78,24 @@ async function ctcp(target, text, amt) {
} }
} }
async function spam(chan, amt, type) { async function uspam(chan, amt) {
if (amt > 100000) { if (amt > 100000) {
bot.say(chan, "no") bot.say(chan, "no")
} else { } else {
for(var i=0; i < amt; i++){ for(var i=0; i < amt; i++){
if (type == "unicode") { var string = randomext.integer(9,0) + randomext.uString(120,40);
var string = randomext.integer(9,0) + randomext.uString(120,40); await timer(5);
} else if (type == "random") { bot.say(chan, string);
var string = generateRandomString(70); }
} }
}
async function rspam(chan, amt) {
if (amt > 100000) {
bot.say(chan, "no")
} else {
for(var i=0; i < amt; i++){
var string = generateRandomString(70);
await timer(5); await timer(5);
bot.say(chan, string); bot.say(chan, string);
} }
@ -108,9 +116,9 @@ bot.addListener('message', function(nick, to, text, from) {
} else if (args[0] === '$ctcpflood') { } else if (args[0] === '$ctcpflood') {
ctcp(args[1], args[2], args[3]); ctcp(args[1], args[2], args[3]);
} else if (args[0] === '$rspam') { } else if (args[0] === '$rspam') {
spam(to, args[1], "random") rspam(to, args[1])
} else if (args[0] === '$uspam') { } else if (args[0] === '$uspam') {
spam(to, args[1], "unicode"); uspam(to, args[1]);
} }
}); });