Baritone AI pathfinder

Baritone AI pathfinder

72.7k Downloads

can't compile baritone bot system

dolphin-cat opened this issue ยท 30 comments

commented

i am trying to compile baritone's bot system branch and i get this error:
ch.qos.logback.classic.LoggerContext cannot be cast to org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext
how do i fix it?

Thank you

commented

Did you change the spongepowered maven url?

@@ -26,7 +26,7 @@ buildscript {
         }
         maven {
             name = 'SpongePowered'
-            url = 'http://repo.spongepowered.org/maven'
+            url = 'https://repo.spongepowered.org/repository/maven-public/'
         }
         jcenter()
     }
@@ -80,7 +80,7 @@ repositories {
 
     maven {
         name = 'spongepowered-repo'
-        url = 'http://repo.spongepowered.org/maven/'
+        url = 'https://repo.spongepowered.org/repository/maven-public/'
     }
 
     maven {
commented

it works, why didn't you change it on the repo?

You are in an ancient branch, that branch hasn't even been looked at for about a year. Try instead on the master branch.

Also make sure to apply the changes that @ZacSharp suggested.

commented

The diff is directly taken from the pr on master, so the required diff for botsystem might be a little different. Just replace every http://repo.spongepowered.org/maven/ with https://repo.spongepowered.org/repository/maven-public/.

Also when I tried this I had problems with the determinizer and proguard tasks, but I don't know how to fix that, so either it works for you or you will have to search /build a little for a useable jar (those tasks are not strictly needed to use Baritone, they proguard just does som optimization and obfuscation and the determinizer sorts the jar contents and sets the timestamps to a fixed value)

commented

no, thank you

commented

it works, why didn't you change it on the repo?

commented

still doesn't work @ZacSharp

commented

my build.gradle is a bit different

commented

/*

  • This file is part of Baritone.
  • Baritone is free software: you can redistribute it and/or modify
  • it under the terms of the GNU Lesser General Public License as published by
  • the Free Software Foundation, either version 3 of the License, or
  • (at your option) any later version.
  • Baritone is distributed in the hope that it will be useful,
  • but WITHOUT ANY WARRANTY; without even the implied warranty of
  • MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  • GNU Lesser General Public License for more details.
  • You should have received a copy of the GNU Lesser General Public License
  • along with Baritone. If not, see https://www.gnu.org/licenses/.
    */

group 'baritone'
version '1.2.11'

buildscript {
repositories {
maven {
name = 'forge'
url = 'http://files.minecraftforge.net/maven'
}
maven {
name = 'SpongePowered'
url = 'http://repo.spongepowered.org/maven'
}
jcenter()
}

dependencies {
    classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT'
    classpath 'org.spongepowered:mixingradle:0.6-SNAPSHOT'
}

}

import baritone.gradle.task.CreateDistTask
import baritone.gradle.task.ProguardTask

apply plugin: 'java'
apply plugin: 'net.minecraftforge.gradle.tweaker-client'
apply plugin: 'org.spongepowered.mixin'

sourceCompatibility = targetCompatibility = '1.8'
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
options.encoding = "UTF-8" // allow emoji in comments :^)
}

sourceSets {
launch {
compileClasspath += main.compileClasspath + main.runtimeClasspath + main.output
}

schematica_api {
    compileClasspath += main.compileClasspath
}

main {
    compileClasspath += schematica_api.output
}

}

minecraft {
version = '1.12.2'
mappings = 'stable_39'
tweakClass = 'baritone.launch.BaritoneTweaker'
runDir = 'run'

// The sources jar should use SRG names not MCP to ensure compatibility with all mappings
makeObfSourceJar = true

}

repositories {
mavenCentral()

maven {
    name = 'spongepowered-repo'
    url = 'http://repo.spongepowered.org/maven/'
}

maven {
    name = 'impactdevelopment-repo'
    url = 'https://impactdevelopment.github.io/maven/'
}

}

dependencies {
runtime launchCompile('com.github.ImpactDevelopment:SimpleTweaker:1.2')
runtime launchCompile('org.spongepowered:mixin:0.7.11-SNAPSHOT') {
// Mixin includes a lot of dependencies that are too up-to-date
exclude module: 'launchwrapper'
exclude module: 'guava'
exclude module: 'gson'
exclude module: 'commons-io'
exclude module: 'log4j-core'
}
testImplementation 'junit:junit:4.12'
}

mixin {
defaultObfuscationEnv searge
add sourceSets.launch, 'mixins.baritone.refmap.json'
}

javadoc {
options.addStringOption('Xwerror', '-quiet') // makes the build fail on travis when there is a javadoc error
options.linkSource true
options.encoding "UTF-8" // allow emoji in comments :^)
source = sourceSets.api.allJava
classpath += sourceSets.api.compileClasspath
}

jar {
from sourceSets.launch.output, sourceSets.api.output
preserveFileTimestamps = false
reproducibleFileOrder = true

manifest {
    attributes(
            'MixinConfigs': 'mixins.baritone.json',

            'Implementation-Title': 'Baritone',
            'Implementation-Version': version
    )
}

}

task proguard(type: ProguardTask) {
url 'https://downloads.sourceforge.net/project/proguard/proguard/6.0/proguard6.0.3.zip'
extract 'proguard6.0.3/lib/proguard.jar'
}

task createDist(type: CreateDistTask, dependsOn: proguard)

build.finalizedBy(createDist)

commented

do i have a slightly older version? i will try to re-download it

commented

no, i need the bot system branch

commented

turns out i replaced the wrong urls, i used sublime text replace all button instead and it repaced the correct urls

commented

how do i use the bot system part of this baritone?

commented

where is the bot system?
Capture
this is in build/libs/

commented

They are all botsystem builds.
You can execute commands with prefix to run them on all bot Baritones or without to run them on your own Baritone instance, so to get a bot you need to run bot without prefix at least the first time (because there is no bot to execute the prefixed variant yet).
Also those bots don't have mc accounts and can't send chat messages, so you can only use this in LAN-worlds or on offline mode (commonly called cracked for whatever reasaon) servers that don't require a password.

commented

or buy a lot of premium alts, put them on tlauncher or an alt manager and every time you load an mc use a different alt, i use a lot of mcs on anarchy a lot of times and know how to connect them

commented

or buy a lot of premium alts, put them on tlauncher or an alt manager and every time you load an mc use a different alt

that's an alternative to using botsystem, not a possible usage of botsystem
Botsystem creates fake players running in your current mc (yes, only one mc for a bunch of bots+yourself) and connects them to the server you are on. There is currently no way to use real usernames with login data instead of Bot****, so even if you have the accounts, you can't use them with botsystem. That is what tenor was for, but it is even more outdated and super incomplete, so if you already have a way to connect your accounts, use that (may I ask what you use?)

commented

wait, do i not load a lot of clients and they all connect to each other?

commented

i need them to run on a separate client each and connect to each other using chat msgs, i must find an other mod :(

commented

I think KamiBlue has a remote control feature, allowing you to control Baritone using /msg from trusted players.
Also if you don't care about really outdated, you can use tenor connect all players to the same tenor server and use that to send commands, which is basically the only complete feature tenor has.

commented

yes but i need the clients to work as a team and know that they are a team, i am making a big build on theminers.id(anarchy, 2b2t like)

commented

and it is 1.16, server sided viaversion changed msgs and the remote control doesn't work there

commented

i tried it

commented

If you need 1.16 I don't know a solution.
I also don't know anything that does more than dispatching commands to a bunch of independent Baritones.

commented

1.12 is ok, but i need it to be on separate clients that all work together

commented

Two options:

  1. Change KamiBlues chat regex and use
  2. Tenor... I have a Python script that can send stdin to a single Baritone, shouldn't be too hard to use multiple bots

Use the first one.
To make the bots cooperate a bit better you can let them build different parts of the schematic or otherwise they will start breaking and trying to place the same blocks.

commented

i know, it won't work, i need them to know they are a team, they always end up fighting on who will place the block in the end, not the first time i had this problem

commented

won't work sadly
i need it to be very ez, a lot of players tp, connect to me and i type a command and all players start building from the same place and know that they are a team

commented

As I said, just make them build separate parts of the build seperate schematics / buildOnlySelection to seperate by area or buildIgnoreBlocks and buildSkipBlocks to seperate by block type.

commented

Oh, and I will see if I can make them ignore blocks anther player is looking at, but don't expect too much. My current Baritone ideas/projects are quite a few and I'm also not done with litematica and custom mappings for forge yet

commented

Not sure if you are interested in it, but with ZacSharp@9e4b399 the bots will ignore anything within 5 blocks of another player (bot or not), so they shouldn't try to place/break the same block anymore.

I will definitely not open a pr with the current implementation, so whoever reads this: don't ask.