cloop reset bullshit

This commit is contained in:
Parker2991 2024-08-09 23:26:27 -04:00
parent 0b31c50a29
commit d571a1654e
5 changed files with 874 additions and 258763 deletions

17
.vscode/launch.json vendored
View file

@ -1,17 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"program": "~/Downloads/vscodium/node"
}
]
}

File diff suppressed because it is too large Load diff

View file

@ -27,15 +27,10 @@ const rl = readline.createInterface({
}) })
if (config.discord.enabled) discordClient.login(config.discord.token); if (config.discord.enabled) discordClient.login(config.discord.token);
const bots = []; const bots = [];
for (const options of config.bots) { for (options of config.bots) {
const bot = createBot(options); bot = createBot(options);
bots.push(bot); bots.push(bot);
bot.bots = bots; bot.bots = bots;
/* if (!config.discord.enabled) {
return
} else {
discordClient.login(config.discord.token);
}*/
loadModules(bot, options, config, discordClient); loadModules(bot, options, config, discordClient);
bot.console.useReadlineInterface(rl); bot.console.useReadlineInterface(rl);
} }

View file

@ -2,7 +2,12 @@ function command_loop (bot, options, config) {
bot.cloop = { bot.cloop = {
list: [], list: [],
add (command, interval) { add (command, interval) {
setTimeout(() => {
this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval }) this.list.push({ timer: setInterval(() => bot.core.run(command), interval), command, interval })
}, 10)
bot.on('end', () => {
this.clear()
})
}, },
remove (index) { remove (index) {
@ -14,5 +19,10 @@ function command_loop (bot, options, config) {
this.list = [] this.list = []
} }
} }
/* bot.on('end', () => {
// clearInterval(this.list);
for (const cloop of this.list) console.log(cloop)
console.log('e')
})*/
} }
module.exports = command_loop; module.exports = command_loop;

View file

@ -1,31 +0,0 @@
module.exports = {
name: 'sus',
trustLevel: 0,
aliases: [
"say",
"botsay",
],
description: 'Make me say something',
usages: [
"<message>"
],
execute (context) {
const bot = context.bot
const message = context.arguments.join(' ')
if (message.startsWith('/')) {
bot.chat.command(message.substring(1))
return
}
bot.chat.message(message)
},
discordExecute (context) {
const bot = context.bot;
const args = context.arguments;
if (args.join(' ').startsWith('/')) {
bot.chat.command(args.join(' ').substring(1))
return
}
bot.chat.message(args.join(' '))
}
}