Add CAshMiner, CPlanker and CThiever scripts

This commit is contained in:
2021-10-27 10:18:20 +02:00
parent 06333b3364
commit 1122205220
20 changed files with 541 additions and 0 deletions

13
CThiever/CThiever.iml Normal file
View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="client" level="project" />
<orderEntry type="module" module-name="Util" />
</component>
</module>

View File

@ -0,0 +1,19 @@
package io.reisub.dreambot.cthiever;
import io.reisub.dreambot.cthiever.tasks.Pickpocket;
import io.reisub.dreambot.util.CTaskScript;
import io.reisub.dreambot.util.Constants;
import io.reisub.dreambot.util.tasks.Eat;
import org.dreambot.api.script.Category;
import org.dreambot.api.script.ScriptManifest;
@ScriptManifest(category = Category.THIEVING, name = "CThiever", description = "Steals like a black man", author = Constants.AUTHOR, version = 1.0)
public class CThiever extends CTaskScript {
@Override
public void onStart() {
addNodes(
new Eat(),
new Pickpocket()
);
}
}

View File

@ -0,0 +1,6 @@
package io.reisub.dreambot.cthiever.tasks;
import io.reisub.dreambot.util.TaskNodeParent;
public class Bank extends TaskNodeParent {
}

View File

@ -0,0 +1,54 @@
package io.reisub.dreambot.cthiever.tasks;
import io.reisub.dreambot.util.Util;
import org.dreambot.api.methods.Calculations;
import org.dreambot.api.methods.MethodProvider;
import org.dreambot.api.methods.interactive.NPCs;
import org.dreambot.api.methods.interactive.Players;
import org.dreambot.api.script.ScriptManager;
import org.dreambot.api.script.TaskNode;
import org.dreambot.api.script.listener.ChatListener;
import org.dreambot.api.wrappers.interactive.Character;
import org.dreambot.api.wrappers.interactive.NPC;
import org.dreambot.api.wrappers.widgets.message.Message;
public class Pickpocket extends TaskNode {
private boolean attempt, failed, stole;
public Pickpocket() {
ScriptManager.getScriptManager().addListener(new ChatListener() {
@Override
public void onMessage(Message message) {
if (message.getMessage().startsWith("You attempt")) {
attempt = true;
stole = false;
} else if (message.getMessage().startsWith("You fail")) {
failed = true;
} else if (message.getMessage().startsWith("You steal")) {
stole = true;
}
}
});
}
@Override
public boolean accept() {
NPC target = NPCs.closest("Master farmer");
return (Util.playerIsIdle() || stole)
&& !(Players.localPlayer().isInCombat() && Players.localPlayer().getInteractingCharacter() != null)
&& Players.localPlayer().getRenderableHeight() != 1000
&& target != null
&& target.isOnScreen();
}
@Override
public int execute() {
NPC target = NPCs.closest("Master farmer");
if (target == null) return Calculations.random(250, 400);
target.interact("Pickpocket");
Util.sleepUntilMovingOrAnimating();
return Calculations.random(250, 400);
}
}