Compare commits

...

No commits in common. '4ed4f51136024566e56eaadd010196578bc88e91' and '4f1e510386762e076cdd1401e2b92dd2f4e7853b' have entirely different histories.

  1. 12
      .vscode/launch.json
  2. 51
      lib/index.js
  3. 5069
      package-lock.json
  4. 26
      package.json
  5. 4216
      pnpm-lock.yaml

@ -4,6 +4,16 @@
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "protospace",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/lib/index.js",
"args": ["games.protospace.ca"]
},
{
"type": "node",
"request": "launch",
@ -13,7 +23,7 @@
],
"program": "${workspaceFolder}/lib/index.js",
// port may need to be changed for each session
"args": ["localhost", "59752"]
"args": ["localhost", "56901"]
}
]
}

@ -10,31 +10,21 @@ const mineflayer = require("mineflayer");
// const { createGetAccessor } = require('typescript');
const bot =
!isNaN(parseInt(process.argv[3])) && parseInt(process.argv[3]) > 1e4 ?
!isNaN(parseInt(process.argv[3])) && parseInt(process.argv[3]) > 1e2 ?
mineflayer.createBot({
host: process.argv[2] || 'localhost', // Change this to the ip you want.
port: parseInt(process.argv[3]) // || 58471,
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
port: parseInt(process.argv[3]) || process.env.MINECRAFT_PORT // || 58471,
})
:
mineflayer.createBot({
host: process.argv[2] || 'localhost', // Change this to the ip you want.
username: process.argv[3] || "tank2004@gmx.de",
password: process.argv[4] || "Hellfire666!",
// port: process.argv[5] || 58471,
host: process.argv[2] || process.env.MINECRAFT_HOST || 'localhost', // Change this to the ip you want.
username: process.argv[3] || process.env.MINECRAFT_USER,
password: process.argv[4] || process.env.MINECRAFT_PASS,
// port: process.argv[5] || process.env.MINECRAFT_PORT || 58471,
})
const plugins = {
command: require('./plugins/command'),
armor: require('./plugins/armor'),
miner: require('./plugins/miner'),
sleeper: require('./plugins/sleeper'),
guard: require('./plugins/guard'),
inventory: require('./plugins/inventory'),
statemachine: require('./plugins/statemachine'),
finder: require('./plugins/finder'),
}
cfg.plugins = plugins
let plugins = {}
function loadplugin(pluginname, pluginpath) {
try {
@ -93,13 +83,27 @@ reloadplugin = (event, filename, pluginpath) => {
fs.watch('./lib/plugins', reloadplugin)
cfg.bot = bot
cfg.botAddress = new RegExp(`^${bot.username} (!.+)`)
cfg.quiet = true
// == actually do stuff
bot.once("spawn", () => {
cfg.botAddress = new RegExp(`^${bot.username} (!.+)`)
plugins = {
command: require('./plugins/command'),
sleeper: require('./plugins/sleeper'),
armor: require('./plugins/armor'),
// mover: require('./plugins/mover'),
guard: require('./plugins/guard'),
inventory: require('./plugins/inventory'),
// eater: require('./plugins/eater'),
finder: require('./plugins/finder'),
miner: require('./plugins/miner'),
// statemachine: require('./plugins/statemachine'),
}
cfg.plugins = plugins
for (const plugin of Object.values(plugins)) {
try {
@ -110,9 +114,10 @@ bot.once("spawn", () => {
}
})
// bot.on("death", () => {
// // plugins.guard.unload()
// })
bot.on("death", () => {
bot.pathfinder && bot.pathfinder.setGoal(null)
// plugins.guard.unload()
})
// bot.on("respawn", () => {
// // setTimeout(plugins.guard.load, 2000)
// })

5069
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -30,25 +30,25 @@
},
"homepage": "https://github.com/PrismarineJS/prismarine-template#readme",
"devDependencies": {
"jest": "^26.6.1",
"jest": "^26.6.3",
"require-self": "^0.2.3"
},
"dependencies": {
"minecraft-data": "^2.69.1",
"mineflayer": "^2.32.0",
"mineflayer-armor-manager": "^1.3.0",
"mineflayer-pathfinder": "^1.0.11",
"mineflayer-pvp": "^1.0.2",
"prismarine-block": "^1.7.1",
"prismarine-chat": "^1.0.2",
"minecraft-data": "^2.70.2",
"mineflayer": "^2.34.0",
"mineflayer-armor-manager": "^1.3",
"mineflayer-pathfinder": "^1.1",
"mineflayer-pvp": "^1",
"prismarine-block": "^1",
"prismarine-chat": "^1",
"prismarine-entity": "^1.1.0",
"prismarine-gameplay": "github:TheDudeFromCI/prismarine-gameplay#crafting",
"prismarine-item": "^1.5.0",
"prismarine-nbt": "^1.3.0",
"prismarine-recipe": "^1.1.0",
"readline": "^1.3.0",
"typescript": "^3.9.7",
"vec3": "^0.1.7"
"prismarine-nbt": "^1.3",
"prismarine-recipe": "^1",
"typescript": "^4",
"vec3": "^0.1",
"dotenv-packed": "^1.2"
},
"files": [
"lib/**/*"

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save