diff --git a/.idea/artifacts/CMiner_jar.xml b/.idea/artifacts/CMiner_jar.xml
new file mode 100644
index 0000000..409f84d
--- /dev/null
+++ b/.idea/artifacts/CMiner_jar.xml
@@ -0,0 +1,9 @@
+
+
+ $USER_HOME$/DreamBot/Scripts
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
index e2ff482..3513e40 100644
--- a/.idea/modules.xml
+++ b/.idea/modules.xml
@@ -6,6 +6,7 @@
+
diff --git a/CMiner/CMiner.iml b/CMiner/CMiner.iml
new file mode 100644
index 0000000..ac9e1f0
--- /dev/null
+++ b/CMiner/CMiner.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CMiner/src/io/reisub/dreambot/cminer/CMiner.java b/CMiner/src/io/reisub/dreambot/cminer/CMiner.java
new file mode 100644
index 0000000..e67b925
--- /dev/null
+++ b/CMiner/src/io/reisub/dreambot/cminer/CMiner.java
@@ -0,0 +1,28 @@
+package io.reisub.dreambot.cminer;
+
+import io.reisub.dreambot.cminer.tasks.Mine;
+import io.reisub.dreambot.cminer.tasks.Superheat;
+import io.reisub.dreambot.util.CTaskScript;
+import io.reisub.dreambot.util.Constants;
+import io.reisub.dreambot.util.tasks.Run;
+import io.reisub.dreambot.util.tasks.kitten.KittenTask;
+import org.dreambot.api.script.Category;
+import org.dreambot.api.script.ScriptManifest;
+import org.dreambot.api.script.TaskNode;
+
+@ScriptManifest(category = Category.MINIGAME, name = "CMiner", description = "Diggy diggy hole", author = Constants.AUTHOR, version = 1.0)
+public class CMiner extends CTaskScript {
+ @Override
+ public void onStart() {
+ TaskNode kittenTask = KittenTask.getInstance();
+ if (kittenTask != null) {
+ addNodes(kittenTask);
+ }
+
+ addNodes(
+ new Run(),
+ new Superheat(),
+ new Mine()
+ );
+ }
+}
diff --git a/CMiner/src/io/reisub/dreambot/cminer/tasks/Mine.java b/CMiner/src/io/reisub/dreambot/cminer/tasks/Mine.java
new file mode 100644
index 0000000..4968376
--- /dev/null
+++ b/CMiner/src/io/reisub/dreambot/cminer/tasks/Mine.java
@@ -0,0 +1,66 @@
+package io.reisub.dreambot.cminer.tasks;
+
+import io.reisub.dreambot.util.Constants;
+import io.reisub.dreambot.util.Util;
+import org.dreambot.api.input.Mouse;
+import org.dreambot.api.methods.Calculations;
+import org.dreambot.api.methods.MethodProvider;
+import org.dreambot.api.methods.container.impl.Inventory;
+import org.dreambot.api.methods.interactive.GameObjects;
+import org.dreambot.api.methods.interactive.Players;
+import org.dreambot.api.methods.tabs.Tab;
+import org.dreambot.api.methods.tabs.Tabs;
+import org.dreambot.api.methods.widget.Widgets;
+import org.dreambot.api.script.TaskNode;
+import org.dreambot.api.wrappers.interactive.GameObject;
+import org.dreambot.api.wrappers.widgets.WidgetChild;
+
+import java.util.List;
+
+public class Mine extends TaskNode {
+ @Override
+ public boolean accept() {
+ return !Inventory.isFull() &&
+ (Util.playerIsIdle() || Players.localPlayer().getAnimation() == Constants.SUPERHEAT) &&
+ !getRocks(Constants.IRON_ROCKS_COLOR).isEmpty();
+ }
+
+ @Override
+ public int execute() {
+ List rocks = getRocks(Constants.IRON_ROCKS_COLOR);
+ if (rocks.isEmpty()) return Calculations.random(250, 400);
+
+ int count = Inventory.count(Constants.IRON_ORE);
+
+ final GameObject rock = rocks.get(0);
+ rock.interactForceLeft(Constants.MINE);
+
+ if (Tabs.isOpen(Tab.MAGIC)) {
+ hoverSuperheat();
+ }
+
+ MethodProvider.sleepUntil(() -> {
+ short[] colors = GameObjects.getTopObjectOnTile(rock.getTile()).getModelColors();
+ return colors == null || colors.length == 0 || count < Inventory.count(Constants.IRON_ORE);
+ }, Calculations.random(10000, 11000));
+
+ return Calculations.random(250, 400);
+ }
+
+ private List getRocks(int colorID) {
+ return GameObjects.all(gameObject -> {
+ if (gameObject.getModelColors() == null || gameObject.getModelColors().length == 0) return false;
+
+ return gameObject.getModelColors()[0] == colorID &&
+ gameObject.hasAction(Constants.MINE) &&
+ gameObject.getInteractableFrom().contains(Players.localPlayer().getTile());
+ });
+ }
+
+ private void hoverSuperheat() {
+ WidgetChild superheat = Widgets.getChildWidget(218, 30);
+ if (superheat != null) {
+ Mouse.move(superheat.getRectangle());
+ }
+ }
+}
diff --git a/CMiner/src/io/reisub/dreambot/cminer/tasks/Superheat.java b/CMiner/src/io/reisub/dreambot/cminer/tasks/Superheat.java
new file mode 100644
index 0000000..7ea76c5
--- /dev/null
+++ b/CMiner/src/io/reisub/dreambot/cminer/tasks/Superheat.java
@@ -0,0 +1,39 @@
+package io.reisub.dreambot.cminer.tasks;
+
+import io.reisub.dreambot.util.Constants;
+import io.reisub.dreambot.util.Util;
+import org.dreambot.api.methods.Calculations;
+import org.dreambot.api.methods.MethodProvider;
+import org.dreambot.api.methods.container.impl.Inventory;
+import org.dreambot.api.methods.magic.Magic;
+import org.dreambot.api.methods.magic.Normal;
+import org.dreambot.api.methods.tabs.Tab;
+import org.dreambot.api.methods.tabs.Tabs;
+import org.dreambot.api.script.TaskNode;
+import org.dreambot.api.wrappers.items.Item;
+
+public class Superheat extends TaskNode {
+ @Override
+ public boolean accept() {
+ return Inventory.contains(Constants.IRON_ORE) &&
+ Magic.canCast(Normal.SUPERHEAT_ITEM) &&
+ Util.playerIsIdle();
+ }
+
+ @Override
+ public int execute() {
+ int count = Inventory.count(Constants.IRON_ORE);
+ Item ore = Inventory.get(Constants.IRON_ORE);
+
+ if (ore == null) return Calculations.random(250, 400);
+
+ Magic.castSpell(Normal.SUPERHEAT_ITEM);
+ MethodProvider.sleepUntil(() -> Tabs.isOpen(Tab.INVENTORY), Calculations.random(1200, 1500));
+
+ ore.interact();
+ Util.sleepUntilAnimating();
+ MethodProvider.sleepUntil(() -> Inventory.count(Constants.IRON_ORE) < count || Util.playerIsIdle() || Tabs.isOpen(Tab.MAGIC), Calculations.random(1200, 1500));
+
+ return Calculations.random(250, 400);
+ }
+}
diff --git a/Util/src/io/reisub/dreambot/util/Constants.java b/Util/src/io/reisub/dreambot/util/Constants.java
index e46ea0b..d3aafad 100644
--- a/Util/src/io/reisub/dreambot/util/Constants.java
+++ b/Util/src/io/reisub/dreambot/util/Constants.java
@@ -50,8 +50,12 @@ public class Constants {
public static final String BURNING_BRAZIER = "Burning brazier";
public static final String MARK_OF_GRACE = "Mark of grace";
public static final String LUNDAIL = "Lundail";
+ public static final String FIRE_RUNE = "Fire rune";
public static final String COSMIC_RUNE = "Cosmic rune";
public static final String NATURE_RUNE = "Nature rune";
+ public static final String ROCKS = "Rocks";
+ public static final int IRON_ROCKS_COLOR = 2576;
+ public static final String IRON_ORE = "Iron ore";
// Actions
public static final String USE = "Use";
@@ -66,6 +70,7 @@ public class Constants {
public static final String LIGHT = "Light";
public static final String FIX = "Fix";
public static final String TRADE = "Trade";
+ public static final String MINE = "Mine";
// Messages
public static final String KITTEN_WANTS_ATTENTION_MSG = "Your kitten wants attention.";
@@ -78,4 +83,7 @@ public class Constants {
// Dialog options
public static final String STROKE = "Stroke";
+
+ // Animations
+ public static final int SUPERHEAT = 725;
}