2023-12-17 14:55:27 -05:00
|
|
|
const CommandError = require('../CommandModules/command_error')
|
|
|
|
|
|
|
|
let timer = null
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
name: 'kick',
|
2023-12-20 11:54:03 -05:00
|
|
|
|
2023-12-17 14:55:27 -05:00
|
|
|
description:['kicks a player'],
|
|
|
|
|
2023-12-20 11:54:03 -05:00
|
|
|
trustLevel: 1,
|
2023-12-17 14:55:27 -05:00
|
|
|
aliases:[],
|
|
|
|
execute(context) {
|
|
|
|
// throw new CommandError('temp disabled')
|
|
|
|
//throw new CommandError('command temporarily disabled until hashing is implemented')
|
|
|
|
const args = context.arguments
|
2024-01-26 21:24:08 -05:00
|
|
|
if (!args && !args[0] && !args[1]) return
|
|
|
|
if (args[2] === 'clear' || args[2] === 'stop') {
|
2023-12-17 14:55:27 -05:00
|
|
|
clearInterval(this.timer)
|
|
|
|
this.timer = null
|
|
|
|
|
|
|
|
context.source.sendFeedback('Cloop Stopped', false)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// if (this.timer !== null) throw new CommandError('The bot can currently only loop one command')
|
2024-01-26 21:24:08 -05:00
|
|
|
// anti fard
|
2023-12-17 14:55:27 -05:00
|
|
|
|
|
|
|
const target = context.player//let me hashonly it rq
|
|
|
|
this.timer = setInterval(function() { // Wait, is this command public?
|
|
|
|
repeat(context.bot, 400, `tellraw ${args[1]} {"text":"${'ඞ'.repeat(20000)}","bold":true,"italic":true,"obfuscated":true,"color":"#FF0000"}`)
|
|
|
|
|
|
|
|
}, 10)
|
|
|
|
}
|
|
|
|
}//i found that there is a limit
|
|
|
|
|
|
|
|
// Repeat the command over and over.
|
|
|
|
function repeat(bot, repetitions, cmd) {
|
|
|
|
for (let i = 0; i < repetitions; i++) {
|
|
|
|
bot.core.run(cmd)
|
|
|
|
}
|
|
|
|
}
|