Skip to content

Commit

Permalink
Merge pull request #600 from See1Duck/development
Browse files Browse the repository at this point in the history
New Giant Mole Plugin & Various fixes and improvements
  • Loading branch information
chsami authored Dec 29, 2024
2 parents 48de923 + 713f4d4 commit 7396603
Show file tree
Hide file tree
Showing 31 changed files with 1,533 additions and 122 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import net.runelite.client.eventbus.Subscribe;
import net.runelite.client.events.*;
import net.runelite.client.plugins.microbot.Microbot;
import net.runelite.client.plugins.microbot.inventorysetups.InventorySetup;
import net.runelite.client.plugins.microbot.util.security.Login;
import net.runelite.client.util.ColorUtil;
import net.runelite.client.util.RunnableExceptionLogger;
Expand Down Expand Up @@ -1301,6 +1302,10 @@ Object stringToObject(String str, Type type)
return gson.fromJson(str, parameterizedType);
}
}
if(type == InventorySetup.class)
{
return gson.fromJson(str, type);
}
if (type instanceof Class)
{
Class<?> clazz = (Class<?>) type;
Expand Down Expand Up @@ -1377,6 +1382,10 @@ String objectToString(Object object)
{
return gson.toJson(object, Set.class);
}
if (object instanceof InventorySetup)
{
return gson.toJson(object, InventorySetup.class);
}
if (object != null)
{
ConfigSerializer configSerializer = object.getClass().getAnnotation(ConfigSerializer.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,18 @@
package net.runelite.client.plugins.bosstimer;

import com.google.common.collect.ImmutableMap;
import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalUnit;
import java.util.Map;
import lombok.Getter;
import net.runelite.api.ItemID;
import net.runelite.api.NpcID;
import net.runelite.client.util.RSTimeUnit;

import java.time.Duration;
import java.time.temporal.ChronoUnit;
import java.time.temporal.TemporalUnit;
import java.util.Map;

@Getter
enum Boss
public enum Boss
{
GENERAL_GRAARDOR(NpcID.GENERAL_GRAARDOR, 90, ChronoUnit.SECONDS, ItemID.PET_GENERAL_GRAARDOR),
KRIL_TSUTSAROTH(NpcID.KRIL_TSUTSAROTH, 90, ChronoUnit.SECONDS, ItemID.PET_KRIL_TSUTSAROTH),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@
*/
package net.runelite.client.plugins.bosstimer;

import java.awt.image.BufferedImage;
import java.time.temporal.ChronoUnit;
import net.runelite.client.plugins.Plugin;
import net.runelite.client.ui.overlay.infobox.Timer;

class RespawnTimer extends Timer
import java.awt.image.BufferedImage;
import java.time.temporal.ChronoUnit;

public class RespawnTimer extends Timer
{
private final Boss boss;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
package net.runelite.client.plugins.microbot.bossing.giantmole;

import net.runelite.client.config.*;
import net.runelite.client.plugins.microbot.inventorysetups.InventorySetup;
import net.runelite.client.plugins.microbot.playerassist.enums.DefaultLooterStyle;
@ConfigInformation("<h2>S-1D Giant Mole</h2>\n" +
"<h3>BETA PREVIEW 1</h3>\n" +
"<p>1. <strong>Select your Giant Mole inventory setup</strong>.</p>\n" +
"<p>2. <strong>Include a teleport to Falador</strong> for banking.</p>\n" +
"<p>3. <strong>Start in Falador</strong> with either an empty inventory or your complete setup.</p>\n" +
"<p>4. <strong>Falador hard diary</strong> is required for the mole locator.</p>\n" +
"<p>5. <strong>Spec Weapon</strong> use QoL to select spec weapon.</p>\n" +
"<p></p>\n" +
"<p><strong>FEEDBACK:</strong> If you encounter any bugs or need assistance, please message us on Discord.</p>\n"
)
@ConfigGroup("giantmole")
public interface GiantMoleConfig extends Config {

@ConfigSection(
name = "lootSection",
description = "Looting settings",
position = 1
)
String lootSection = "looting";

@ConfigItem(
keyName = "useQuickPrayer",
name = "Use quick prayer",
description = "Use quick prayer",
position = 0
)
default boolean useQuickPrayer() {
return true;
}

// config item for inventory setup
@ConfigItem(
keyName = "inventorySetup",
name = "Inventory Setup",
description = "Inventory Setup",
position = 1
)
default InventorySetup inventorySetup() {
return null;
}

@ConfigItem(
keyName = "Loot items",
name = "Auto loot items",
description = "Enable/disable loot items",
position = 0,
section = lootSection
)
default boolean toggleLootItems() {
return true;
}

@ConfigItem(
name = "Loot Style",
keyName = "lootStyle",
position = 1,
description = "Choose Looting Style",
section = lootSection
)
default DefaultLooterStyle looterStyle() {
return DefaultLooterStyle.MIXED;
}

@ConfigItem(
name = "List of Items",
keyName = "listOfItemsToLoot",
position = 2,
description = "List of items to loot",
section = lootSection
)
default String listOfItemsToLoot() {
return "bones,ashes";
}

@ConfigItem(
keyName = "Min Price of items to loot",
name = "Min. Price of items to loot",
description = "Min. Price of items to loot",
position = 10,
section = lootSection
)
default int minPriceOfItemsToLoot() {
return 5000;
}

@ConfigItem(
keyName = "Max Price of items to loot",
name = "Max. Price of items to loot",
description = "Max. Price of items to loot default is set to 10M",
position = 11,
section = lootSection
)
default int maxPriceOfItemsToLoot() {
return 10000000;
}
// toggle scatter

@ConfigItem(
keyName = "Loot arrows",
name = "Auto loot arrows",
description = "Enable/disable loot arrows",
position = 20,
section = lootSection
)
default boolean toggleLootArrows() {
return false;
}

// toggle loot runes
@ConfigItem(
keyName = "Loot runes",
name = "Loot runes",
description = "Enable/disable loot runes",
position = 30,
section = lootSection
)
default boolean toggleLootRunes() {
return false;
}

// toggle loot coins
@ConfigItem(
keyName = "Loot coins",
name = "Loot coins",
description = "Enable/disable loot coins",
position = 40,
section = lootSection
)
default boolean toggleLootCoins() {
return false;
}

// toggle loot untreadables
@ConfigItem(
keyName = "Loot untradables",
name = "Loot untradables",
description = "Enable/disable loot untradables",
position = 50,
section = lootSection
)
default boolean toggleLootUntradables() {
return false;
}

@ConfigItem(
keyName = "Bury Bones",
name = "Bury Bones",
description = "Picks up and Bury Bones",
position = 96,
section = lootSection
)
default boolean toggleBuryBones() {
return false;
}

// only loot my items
@ConfigItem(
keyName = "onlyLootMyItems",
name = "Only Loot My Items",
description = "Only loot items that are dropped for/by you",
position = 99,
section = lootSection
)
default boolean toggleOnlyLootMyItems() {
return false;
}

//Force loot regardless if we are in combat or not
@ConfigItem(
keyName = "forceLoot",
name = "Force Loot",
description = "Force loot regardless if we are in combat or not",
position = 100,
section = lootSection
)
default boolean toggleForceLoot() {
return false;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package net.runelite.client.plugins.microbot.bossing.giantmole;

import net.runelite.client.ui.overlay.OverlayPanel;
import net.runelite.client.ui.overlay.OverlayPosition;
import net.runelite.client.ui.overlay.components.LineComponent;
import net.runelite.client.ui.overlay.components.TitleComponent;

import javax.inject.Inject;
import java.awt.*;

public class GiantMoleOverlay extends OverlayPanel {

@Inject
GiantMoleOverlay(GiantMolePlugin plugin)
{
super(plugin);
setPosition(OverlayPosition.TOP_LEFT);
setNaughty();
}
@Override
public Dimension render(Graphics2D graphics) {
try {
panelComponent.setPreferredSize(new Dimension(350, 400));
panelComponent.getChildren().add(TitleComponent.builder()
.text("\uD83E\uDD86 Giant Mole \uD83E\uDD86")
.color(Color.ORANGE)
.build());

panelComponent.getChildren().add(LineComponent.builder().build());

panelComponent.getChildren().add(LineComponent.builder()
.left("Giant Mole Location:")
.right(GiantMoleScript.getMoleLocation() == null ? GiantMoleScript.isMoleDead() ? "Unknown" : "Close" : GiantMoleScript.getMoleLocation().toString())
.build());

panelComponent.getChildren().add(LineComponent.builder().build());

// panelComponent.getChildren().add(LineComponent.builder()
// .left("Walker target:")
// .right(ShortestPathPlugin.getPathfinder() == null ? "Unknown" : ShortestPathPlugin.getPathfinder().getTarget().toString())
// .build());
panelComponent.getChildren().add(LineComponent.builder()
.left("State:")
.right(GiantMoleScript.state.toString())
.build());
panelComponent.getChildren().add(LineComponent.builder()
.left("Is dead:")
.right(String.valueOf(GiantMoleScript.isMoleDead()
))
.build());
panelComponent.getChildren().add(LineComponent.builder()
.left("Version:")
.right(GiantMoleScript.VERSION)
.build());


} catch(Exception ex) {
System.out.println(ex.getMessage());
}
return super.render(graphics);
}
}
Loading

0 comments on commit 7396603

Please sign in to comment.