Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main;
- import org.dreambot.api.input.event.impl.InteractionEvent;
- import org.dreambot.api.methods.Calculations;
- import org.dreambot.api.methods.map.Area;
- import org.dreambot.api.methods.skills.Skill;
- import org.dreambot.api.script.AbstractScript;
- import org.dreambot.api.script.Category;
- import org.dreambot.api.script.ScriptManifest;
- import org.dreambot.api.utilities.Timer;
- import org.dreambot.api.wrappers.interactive.GameObject;
- import org.dreambot.api.wrappers.interactive.NPC;
- import sun.rmi.runtime.Log;
- import java.awt.*;
- @ScriptManifest(
- author = "Dagwood",
- name = "Thieving3",
- version = 1.0D,
- category = Category.THIEVING,
- description = "Thieves for you."
- )
- public class main extends AbstractScript {
- private Timer timeRan;
- Area stalls = new Area(3269, 3412, 3268, 3412);
- Area lumbridge = new Area(3217, 3226, 3225, 3213);
- Area lever = new Area(3090, 3475, 3092, 3474);
- Area deathsq = new Area(3153, 3925, 3156, 3922);
- Area Ardy = new Area(2678, 3328, 3559, 3277 );
- Area ardylever = new Area(2561, 3312, 3562, 3310);
- //Area Ardy_Square = new Area(2650, 3318, 2673, 3294);
- Area CakeStall = new Area(2662, 3309, 2672, 3313);
- Area safespot = new Area(2673, 3321, 2674, 3312);
- Area attack = new Area(2667, 3313, 2669, 3312);
- Area Silk = new Area(2662, 3317, 2664, 3316);
- Area safespot2 = new Area(2652, 3320, 2650, 3316);
- private boolean DoneTea = false;
- private enum State {
- Pickman, Stall, Gettoardy, CakeStall, Silk
- }
- private State getState() {
- if (CakeStall.contains(getLocalPlayer())){
- return State.CakeStall;
- }
- if (getSkills().getRealLevel(Skill.THIEVING) >= 15 && !CakeStall.contains(getLocalPlayer())
- && !safespot.contains(getLocalPlayer()) && !getLocalPlayer().isMoving()){
- log("lvl 15+");
- return State.Gettoardy;
- } else {
- if (getSkills().getRealLevel(Skill.THIEVING) >= 5 && getSkills().getRealLevel(Skill.THIEVING) < 15 && !stalls.contains(getLocalPlayer())) {
- log("lvl 5+");
- return State.Stall;
- } else if (lumbridge.contains(getLocalPlayer())) {
- log("nuub");
- return State.Pickman;
- }
- return null;
- }
- }
- @Override
- public void onStart() {
- timeRan = new Timer();
- super.onStart();
- }
- @Override
- public int onLoop() {
- switch (getState()) {
- case Pickman:
- Pickpocketman();
- break;
- case Stall:
- Theestall();
- break;
- case Gettoardy:
- Getardy();
- break;
- case CakeStall:
- CakeStall();
- break;
- case Silk:
- silk();
- break;
- }
- return 0;
- }
- private void Pickpocketman() {
- NPC npcman = getNpcs().closest("Man");
- if (!getLocalPlayer().isHealthBarVisible()) {
- if (lumbridge.contains(npcman)) {
- npcman.interact("Pickpocket");
- sleep(Calculations.random(612, 846));
- if (!getLocalPlayer().isHealthBarVisible()) {
- sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
- sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
- }
- } else {
- if (!lumbridge.contains(npcman)) {
- sleep(Calculations.random(153, 198));
- }
- }
- }
- }
- private void Theestall() {
- if (!stalls.contains(getLocalPlayer())) {
- getWalking().walk(stalls.getRandomTile());
- } else {
- if (stalls.contains(getLocalPlayer())) {
- if (getInventory().contains("Cup of tea")) {
- getInventory().dropAll("Cup of tea");
- sleep(Calculations.random(315, 800));
- } else { GameObject tea = getGameObjects().closest("Tea stall");
- if (tea != null) {
- tea.interact("Steal-from");
- sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
- sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(5000, 8000));
- }
- }
- }
- }
- }
- private void Getardy() {
- if (lever.contains(getLocalPlayer())) {
- log("6");
- GameObject lever = getGameObjects().closest("Lever");
- lever.interact("Pull");
- sleepUntil(() -> getDialogues().canContinue(), Calculations.random(6000, 9000));
- if (getDialogues().canContinue()) {
- log("7");
- getDialogues().spaceToContinue();
- sleep(Calculations.random(1000, 1200));
- getDialogues().chooseOption(3);
- sleepUntil(() -> deathsq.contains(getLocalPlayer()), Calculations.random(8000, 12000));
- if (deathsq.contains(getLocalPlayer())) {
- log("8");
- lever.interact("Pull");
- }
- }
- } else {
- log("9");
- if (deathsq.contains(getLocalPlayer())) {
- log("10");
- GameObject lever = getGameObjects().closest("Lever");
- lever.interact("Pull");
- sleep(8000);
- }
- log("11");
- getWalking().walk(CakeStall.getRandomTile());
- }
- }
- private void CakeStall() {
- if (getSkills().getBoostedLevels(Skill.HITPOINTS) <= 30){
- log("1");
- if (getInventory().contains("Bread")) {
- getInventory().interact("Bread", "Eat");
- } else if (getInventory().contains("Cake")) {
- getInventory().interact("Cake", "Eat");
- } else if (getInventory().contains("Chocolate slice")) {
- getInventory().interact("Chocolate slice", "Eat");
- } else if (getInventory().contains("Chocolate bar")) {
- getInventory().interact("Chocolate bar", "Eat");
- }
- }
- log("2");
- if (CakeStall.contains(getLocalPlayer())) {
- if (getLocalPlayer().isHealthBarVisible() || getLocalPlayer().isInCombat()){
- log("3");
- getWalking().walk(safespot.getRandomTile());
- sleepUntil(() -> getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
- sleepUntil(() -> !getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
- getWalking().walk(attack.getRandomTile());
- }
- log("save");
- GameObject Bakers_stall = getGameObjects().closest("Baker's stall");
- if (Bakers_stall != null) {
- log("4");
- Bakers_stall.interact("Steal-from");
- sleepUntil(() -> getLocalPlayer().isAnimating(), Calculations.random(319, 756));
- sleepUntil(() -> !getLocalPlayer().isAnimating(), Calculations.random(319, 756));
- if (getInventory().contains("Cake")) {
- getInventory().dropAll("Cake");
- } else if (getInventory().count("Chocolate slice") > 1) {
- getInventory().drop("Chocolate slice");
- } else if (getInventory().contains("Bread")) {
- getInventory().drop("Bread");
- } else if (getInventory().contains("Chocolate bar")) {
- getInventory().drop("Chocolate bar");
- }
- } else {
- log("5");
- log("hu");
- sleep(Calculations.random(312, 828));
- }
- }
- }
- private void silk() {
- if (getSkills().getBoostedLevels(Skill.HITPOINTS) <= 30){
- log("12");
- if (getInventory().contains("Silk")){
- getInventory().dropAll("Silk");
- if (Silk.contains(getLocalPlayer())) {
- if (getLocalPlayer().isHealthBarVisible() || getLocalPlayer().isInCombat()) {
- log("13");
- getWalking().walk(safespot2.getRandomTile());
- sleepUntil(() -> getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
- sleepUntil(() -> !getLocalPlayer().isMoving(), Calculations.random(2500, 3000));
- getWalking().walk(Silk.getRandomTile());
- }
- GameObject silk_stall = getGameObjects().closest("Silk stall");
- if (silk_stall != null) {
- silk_stall.interact("Steal-from");
- }
- }
- }
- }
- }
- public void onPaint(Graphics g) {
- g.drawString("Time ran: " + timeRan.formatTime(), 15, 260);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement