Skip to content

Commit

Permalink
Merge branch 'master' into skylab_manager
Browse files Browse the repository at this point in the history
  • Loading branch information
m9w authored Aug 5, 2024
2 parents 3e526b2 + dc62282 commit c24b30c
Show file tree
Hide file tree
Showing 56 changed files with 1,503 additions and 932 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
}

group = "eu.darkbot"
version = "1.130"
version = "1.131"
description = "DarkBot"
java.sourceCompatibility = JavaVersion.VERSION_11
java.targetCompatibility = JavaVersion.VERSION_11
Expand All @@ -46,7 +46,7 @@ configurations {
}

dependencies {
val apiVersion = "0.9.4"
val apiVersion = "0.9.5"
val flatLafVersion = "3.4"

// use this if you want to use local(mavenLocal) darkbot API
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/github/manolo8/darkbot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public class Main extends Thread implements PluginListener, BotAPI {
/** Do not use in plugins! Only for bot internal usage */
@ApiStatus.Internal public static Main INSTANCE;

public static final Version VERSION = new Version("1.130.1");
public static final Version VERSION = new Version("1.131.2");
public static final Object UPDATE_LOCKER = new Object();
public static final Gson GSON = new GsonBuilder()
.setPrettyPrinting()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.manolo8.darkbot.extensions.util.Version;
import com.github.manolo8.darkbot.gui.titlebar.BackpageTask;
import com.github.manolo8.darkbot.utils.I18n;
import eu.darkbot.api.managers.NativeBrowserAPI;
import org.jetbrains.annotations.Nullable;

Expand Down Expand Up @@ -39,7 +40,8 @@ public boolean isSupported() {
try {
return BackpageTask.createBrowser("--sid " + backpageManager.getSid(),
"--url " + backpageManager.getInstanceURI().toString(), // for sid
"--fullurl " + backpageManager.getInstanceURI().toString() + path);
"--fullurl " + backpageManager.getInstanceURI().toString() + path,
"--lang " + I18n.getLocale().getLanguage());
} catch (IOException e) {
e.printStackTrace();
}
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/com/github/manolo8/darkbot/config/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.github.manolo8.darkbot.config.types.suppliers.ReviveLocation;
import com.github.manolo8.darkbot.config.utils.ItemUtils;
import com.github.manolo8.darkbot.core.api.GameAPI;
import com.github.manolo8.darkbot.core.manager.HookAdapter;
import com.github.manolo8.darkbot.core.manager.StarManager;
import com.github.manolo8.darkbot.core.utils.Lazy;
import com.github.manolo8.darkbot.gui.MainGui;
Expand Down Expand Up @@ -201,6 +200,7 @@ public static class Miscellaneous {
public @Option @Visibility(Level.INTERMEDIATE) boolean LOG_CHAT = false;
public @Option @Visibility(Level.INTERMEDIATE) boolean LOG_DEATHS = false;
public @Option @Visibility(Level.INTERMEDIATE) boolean AVOID_MINES = true;
public @Option @Visibility(Level.INTERMEDIATE) boolean AVOID_CBS = true;
public @Option @Visibility(Level.INTERMEDIATE) boolean AVOID_RADIATION = true;
public @Option @Visibility(Level.INTERMEDIATE) boolean USERNAME_ON_TITLE = false;
public @Option @Visibility(Level.ADVANCED) boolean AUTO_REFINE = false;
Expand Down Expand Up @@ -240,15 +240,12 @@ public static class APIConfig {
public @Option boolean USE_PROXY = false;
public @Option boolean CLEAR_CACHE_ON_STUCK = true;

@Option @Dropdown(multi = true)
public Set<HookAdapter.Flag> DARK_HOOK_FLAGS = EnumSet.allOf(HookAdapter.Flag.class);

public int width = 1280;
public int height = 800;

public boolean attachToBot = false;
public GameAPI.Handler.GameQuality gameQuality = GameAPI.Handler.GameQuality.LOW;
public transient int transparency = 100, volume = 100, clientWidth = width, clientHeight = height;
public transient int transparency = 100, volume = 100;

public @Option @Table @Visibility(Level.DEVELOPER) Map<String, PatternInfo> BLOCK_PATTERNS = new HashMap<>();

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.github.manolo8.darkbot.config.actions.conditions;

import com.github.manolo8.darkbot.Main;
import com.github.manolo8.darkbot.config.actions.Condition;
import com.github.manolo8.darkbot.config.actions.Parser;
import com.github.manolo8.darkbot.config.actions.SyntaxException;
import com.github.manolo8.darkbot.config.actions.ValueData;
import com.github.manolo8.darkbot.config.actions.parser.ParseUtil;
import eu.darkbot.api.managers.QuestAPI;
import org.jetbrains.annotations.NotNull;

@ValueData(name = "has-quest", description = "True if it has quests", example = "has-quest()")
public class HasQuestCondition implements Condition, Parser {
private QuestAPI questApi;

@Override
public @NotNull Result get(Main main) {
if (questApi == null) {
this.questApi = main.pluginAPI.getAPI(QuestAPI.class);
if (questApi == null) return Result.ABSTAIN;
}

return Result.fromBoolean(this.questApi.getDisplayedQuest() != null);
}

@Override
public String toString() {
return "has-quest()";
}

@Override
public String parse(String str) throws SyntaxException {
String[] params = str.split("\\)", 2);
return ParseUtil.separate(params, getClass(), ")");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import com.github.manolo8.darkbot.config.actions.conditions.EqualCondition;
import com.github.manolo8.darkbot.config.actions.conditions.HasEffectCondition;
import com.github.manolo8.darkbot.config.actions.conditions.HasFormationCondition;
import com.github.manolo8.darkbot.config.actions.conditions.HasQuestCondition;
import com.github.manolo8.darkbot.config.actions.conditions.NoneCondition;
import com.github.manolo8.darkbot.config.actions.conditions.NumericalCondition;
import com.github.manolo8.darkbot.config.actions.conditions.OneCondition;
Expand Down Expand Up @@ -58,6 +59,8 @@ public class Values {
// Stateful conditions
AfterCondition.class,
UntilCondition.class,
// Special conditions
HasQuestCondition.class,
// Values
DistanceValue.class,
ShipLocationValue.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ public enum BrowserApi {
BACKPAGE_ONLY(BackpageAdapter.class),
NO_OP_API(NoopAPIAdapter.class),
DARK_MEM_API(DarkMemAdapter.class);
//DARK_CEF_API(DarkCefAdapter.class);

public final Class<? extends IDarkBotAPI> clazz;

Expand Down
45 changes: 0 additions & 45 deletions src/main/java/com/github/manolo8/darkbot/core/DarkBotAPI.java

This file was deleted.

45 changes: 0 additions & 45 deletions src/main/java/com/github/manolo8/darkbot/core/DarkFlash.java

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public void added(Main main) {
@Override
public boolean use() {
boolean allowEnemy = main.hero.invisible && main.config.GENERAL.ROAMING.ENEMY_CBS_INVISIBLE;
return !allowEnemy && info.isEnemy() && isDangerousModule();
return !allowEnemy && info.isEnemy() && isDangerousModule() && main.config.MISCELLANEOUS.AVOID_CBS;
}

private boolean isDangerousModule() {
Expand Down
Loading

0 comments on commit c24b30c

Please sign in to comment.