Changes to filter command, add player scaling command (it changes several player attributes to resize the player and make physics work correctly, still not perfect)
This commit is contained in:
parent
4b665dfeed
commit
bc9a983147
4 changed files with 56 additions and 23 deletions
|
@ -1,13 +1,3 @@
|
|||
/*
|
||||
The code contained within this file is only to serve as reference implementations for player
|
||||
management features, whether it be for forks of the botv12 / UBot codebase, or completely
|
||||
different bots. This will be disabled by default in the example settings file, with a toggle in
|
||||
settings which can be enabled if the owner of the bot so desires. On the main UBot production
|
||||
instance, these features will be entirely disabled, so it won't even run from console. If the
|
||||
bot's owner chooses to enable these, they are responsible for obtaining exploits to use with the
|
||||
feature, and any outcome from usage of these features, whether it be positive or negative in
|
||||
nature.
|
||||
*/
|
||||
import { getMessage } from '../util/lang.js'
|
||||
|
||||
const execute = (c) => {
|
||||
|
@ -17,4 +7,4 @@ const execute = (c) => {
|
|||
}
|
||||
const level = 0
|
||||
const aliases = ["blacklist"]
|
||||
export { execute, level }
|
||||
export { execute, level }
|
||||
|
|
48
commands/scale.js
Normal file
48
commands/scale.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
import { getMessage } from '../util/lang.js'
|
||||
/*
|
||||
Please note: I had this idea before I found out it was in other bots.
|
||||
Please do not get mad at me because your bot also has this (or a similar) command.
|
||||
*/
|
||||
const execute = (c) => {
|
||||
if(c.args[0] == "set"){
|
||||
const scale = +c.args[1]
|
||||
c.reply({
|
||||
translate: getMessage(c.lang, 'command.scale.set'),
|
||||
color: c.colors.secondary,
|
||||
with: [
|
||||
{
|
||||
text: c.args[1],
|
||||
color: c.colors.primary
|
||||
}
|
||||
]
|
||||
})
|
||||
c.bot.ccq.push(`attribute ${c.uuid} scale base set ${scale}`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} gravity base set ${0.08 * scale}`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} movement_speed base set ${0.1 * scale}`) // Very close to 0.1 normally, so we just round
|
||||
c.bot.ccq.push(`attribute ${c.uuid} step_height base set ${0.6 * scale}`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} jump_strength base set ${0.42 * scale}`) // Very close to 0.42 normally, so we just round
|
||||
} else if(c.args[0] == "reset"){
|
||||
c.reply({
|
||||
translate: getMessage(c.lang, 'command.scale.reset'),
|
||||
color: c.colors.secondary
|
||||
})
|
||||
c.bot.ccq.push(`attribute ${c.uuid} scale base reset`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} gravity base reset`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} movement_speed base reset`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} step_height base reset`)
|
||||
c.bot.ccq.push(`attribute ${c.uuid} jump_strength base reset`)
|
||||
} else {
|
||||
c.reply({
|
||||
translate: getMessage(c.lang, 'command.cloop.error.subcommand'),
|
||||
color: c.colors.secondary,
|
||||
with: [
|
||||
{
|
||||
text: `${c.prefix}help scale`,
|
||||
color: c.colors.primary
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
}
|
||||
//const aliases = ['temp01_alias'] // Other command names that will work the same (optional)
|
||||
export { execute }
|
|
@ -18,8 +18,12 @@ export default {
|
|||
'command.cloop.desc': 'Manage command loops',
|
||||
'command.eval.usage': ' <code>',
|
||||
'command.eval.desc': 'Run JavaScript code',
|
||||
'command.filter.usage': ' (syntax not finalized)',
|
||||
'command.filter.desc': 'Manage filtered players',
|
||||
'command.help.usage': ' [cmd]',
|
||||
'command.help.desc': 'Shows command help',
|
||||
// 'command.kick.usage': ' (syntax not finalized)',
|
||||
// 'command.kick.desc': 'Kick a player',
|
||||
'command.logoff.usage': '',
|
||||
'command.logoff.desc': 'Disconnect and reconnect the bot from a server',
|
||||
'command.netmsg.usage': ' <message>',
|
||||
|
@ -30,6 +34,8 @@ export default {
|
|||
'command.say.desc': 'Sends a message to chat',
|
||||
'command.restart.usage': '',
|
||||
'command.restart.desc': 'Restart bot',
|
||||
'command.scale.usage': ' set <size>|| reset',
|
||||
'command.scale.desc': 'Change player size',
|
||||
'command.stop.usage': '',
|
||||
'command.stop.desc': 'Stop bot',
|
||||
'command.template.usage': ' <required> [optional]',
|
||||
|
@ -129,6 +135,5 @@ export default {
|
|||
'command.disabled.nonConsole': 'This command must be run from the console.',
|
||||
copyText: 'Click to copy this item to your clipboard',
|
||||
|
||||
'command.filter.warning': 'This command is only to serve as a reference implementation for player management features, whether it be for forks of the botv12 / UBot codebase, or completely different bots. This will be disabled by default in the example settings file, with a toggle in settings which can be enabled if the owner of the bot so desires. On the main UBot production instance, these features will be entirely disabled, so it won\'t even run from console. If the bot\'s owner chooses to enable these, they are responsible for obtaining exploits to use with the feature, and any outcome from usage of these features, whether it be positive or negative in nature.'
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,3 @@
|
|||
/*
|
||||
The code contained within this file is only to serve as reference implementations for player
|
||||
management features, whether it be for forks of the botv12 / UBot codebase, or completely
|
||||
different bots. This will be disabled by default in the example settings file, with a toggle in
|
||||
settings which can be enabled if the owner of the bot so desires. On the main UBot production
|
||||
instance, these features will be entirely disabled, so it won't even run from console. If the
|
||||
bot's owner chooses to enable these, they are responsible for obtaining exploits to use with the
|
||||
feature, and any outcome from usage of these features, whether it be positive or negative in
|
||||
nature.
|
||||
*/
|
||||
export default function load (b) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue