Rename loadBot to load
This commit is contained in:
parent
bacfdfad49
commit
ea9e866cd8
11 changed files with 12 additions and 12 deletions
4
index.js
4
index.js
|
@ -19,8 +19,8 @@ const loadplug = (botno) => {
|
||||||
}
|
}
|
||||||
botplug.forEach((plug) => {
|
botplug.forEach((plug) => {
|
||||||
try {
|
try {
|
||||||
if (plug.loadBot) {
|
if (plug.load) {
|
||||||
plug.loadBot(module.exports.bot[botno])
|
plug.load(module.exports.bot[botno])
|
||||||
}
|
}
|
||||||
} catch (e) { console.log(e) }
|
} catch (e) { console.log(e) }
|
||||||
})
|
})
|
||||||
|
|
|
@ -12,7 +12,7 @@ const messageTypes = [
|
||||||
''
|
''
|
||||||
]
|
]
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b._client.on('profileless_chat', (data) => {
|
b._client.on('profileless_chat', (data) => {
|
||||||
if (data.type === 4) {
|
if (data.type === 4) {
|
||||||
const json = parse1204(data.message)
|
const json = parse1204(data.message)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b.cloops = []
|
b.cloops = []
|
||||||
b.addCloop = function (command, rate) {
|
b.addCloop = function (command, rate) {
|
||||||
b.cloops.push({
|
b.cloops.push({
|
||||||
|
|
|
@ -37,7 +37,7 @@ const sortHelp = function sortHelp (c1, c2) {
|
||||||
return level1 - level2
|
return level1 - level2
|
||||||
}
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b.prefix = settings.prefix
|
b.prefix = settings.prefix
|
||||||
b.lastCmd = 0
|
b.lastCmd = 0
|
||||||
b.runCommand = (name, uuid, text, prefix) => {
|
b.runCommand = (name, uuid, text, prefix) => {
|
||||||
|
|
|
@ -2,7 +2,7 @@ const uuidToInt = require('../util/uuidtoint.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
cs: 4,
|
cs: 4,
|
||||||
cs_v: 6,
|
cs_v: 6,
|
||||||
loadBot: function (b) {
|
load: function (b) {
|
||||||
b.interval.commandFill = setInterval(() => { if (b.sc_tasks.cc) b.sc_tasks.cc.failed = 1 }, 60000)
|
b.interval.commandFill = setInterval(() => { if (b.sc_tasks.cc) b.sc_tasks.cc.failed = 1 }, 60000)
|
||||||
b.ccq = []
|
b.ccq = []
|
||||||
b.blocknoX = 0
|
b.blocknoX = 0
|
||||||
|
|
|
@ -40,7 +40,7 @@ function consoleWrite (text) {
|
||||||
rl.prompt(true)
|
rl.prompt(true)
|
||||||
}
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b.info = (msg) => {
|
b.info = (msg) => {
|
||||||
consoleWrite(`[${b.id}] [info] ${msg}`)
|
consoleWrite(`[${b.id}] [info] ${msg}`)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b._client.on('login', () => {
|
b._client.on('login', () => {
|
||||||
b.interval.chatQueue = setInterval(() => {
|
b.interval.chatQueue = setInterval(() => {
|
||||||
if (b.chatqueue.length !== 0) {
|
if (b.chatqueue.length !== 0) {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const parse = require('../util/chatparse.js')
|
const parse = require('../util/chatparse.js')
|
||||||
const parse1204 = require('../util/chatparse_1204.js')
|
const parse1204 = require('../util/chatparse_1204.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b.players = {}
|
b.players = {}
|
||||||
b._client.on('player_info', (data) => {
|
b._client.on('player_info', (data) => {
|
||||||
const buffer2 = {}
|
const buffer2 = {}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
const index = require('../index.js')
|
const index = require('../index.js')
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b._client.on('end', () => {
|
b._client.on('end', () => {
|
||||||
b.info('bot ' + b.id + ' disconnected')
|
b.info('bot ' + b.id + ' disconnected')
|
||||||
for (const i in b.interval) {
|
for (const i in b.interval) {
|
||||||
|
|
|
@ -11,7 +11,7 @@ class SCTask {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
b.sc_tasks = {}
|
b.sc_tasks = {}
|
||||||
b.interval.sc = setInterval(() => {
|
b.interval.sc = setInterval(() => {
|
||||||
for (const i in b.sc_tasks) {
|
for (const i in b.sc_tasks) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
module.exports = {
|
module.exports = {
|
||||||
loadBot: (b) => {
|
load: (b) => {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue