Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.Graphics2D;
- import java.awt.Rectangle;
- import java.util.List;
- import java.util.concurrent.TimeUnit;
- import org.osbot.rs07.api.Equipment;
- import org.osbot.rs07.api.Magic;
- import org.osbot.rs07.api.map.Position;
- import org.osbot.rs07.api.model.NPC;
- import org.osbot.rs07.api.model.Player;
- import org.osbot.rs07.api.model.RS2Object;
- import org.osbot.rs07.api.ui.EquipmentSlot;
- import org.osbot.rs07.api.ui.Skill;
- import org.osbot.rs07.api.ui.Tab;
- import org.osbot.rs07.input.mouse.MiniMapTileDestination;
- import org.osbot.rs07.input.mouse.RectangleDestination;
- import org.osbot.rs07.script.MethodProvider;
- import org.osbot.rs07.script.Script;
- import org.osbot.rs07.script.ScriptManifest;
- import org.osbot.rs07.utility.Area;
- @ScriptManifest(name="Pug Tutorial Island", author="Pug", info="V1.05", logo="", version=1.05D)
- public final class pugTutorial
- extends Script
- {
- // pug tutorial island solver - Declarations
- private int randomPath = 0;
- private long timeRan;
- private long timeBegan;
- Area Area1 = new Area(3097,3105,3091,3110); // house 1
- Area Area2 = new Area(3105,3092,3099,3099); // fishing area
- Area Area3 = new Area(3093,3090,3090,3093); // east of gate 1
- Area Area4 = new Area(3081,3083,3079,3086); // outside enterance of house 2
- Area Area5 = new Area(3075,3089,3073,3091); // east of outside door of house 2
- Area Area6 = new Area(3087,3126,3082,3129); // outside enterance of house 3
- Area Area7 = new Area(3084,9501,3078,9509); // mining instrutor area
- Area Area8 = new Area(3094,9501,3091,9505); // west side of gate 2
- Area Area9 = new Area(3113,9517,3111,9520); // east side of gate 3
- Area Area10 = new Area(3112,9524,3109,9527); // next to ladder up next to rat pen
- Area Area11 = new Area(3123,3120,3119,3123); // bank area
- Area Area12 = new Area(3128,3103,3120,3110); // church area
- Area Area13 = new Area(3140,3085,3144,3091); // mage area
- Area Area14 = new Area(3235,3227,3229,3233); // finishing area
- // path to house three 1
- private Position[] pathToHouseThree =
- {
- new Position(3072,3090, 0),
- new Position(3071,3097, 0),
- new Position(3072,3106, 0),
- new Position(3069,3112, 0),
- new Position(3074,3123, 0),
- new Position(3086,3126, 0)
- };
- // path to house three 1
- private Position[] pathToHouseThree2 =
- {
- new Position(3072,3090, 0),
- new Position(3071,3099, 0),
- new Position(3071,3109, 0),
- new Position(3071,3119, 0),
- new Position(3078,3126, 0),
- new Position(3086,3126, 0)
- };
- // path to house three 1
- private Position[] pathToHouseThree3 =
- {
- new Position(3072,3090, 0),
- new Position(3070,3097, 0),
- new Position(3070,3107, 0),
- new Position(3071,3118, 0),
- new Position(3077,3125, 0),
- new Position(3086,3126, 0)
- };
- // path to house three 1
- private Position[] pathToHouseThree4 =
- {
- new Position(3072,3090, 0),
- new Position(3062,3094, 0),
- new Position(3069,3101, 0),
- new Position(3070,3112, 0),
- new Position(3074,3122, 0),
- new Position(3085,3126, 0)
- };
- // path to house two 1
- private Position[] pathToHouseTwo = {
- new Position(3089,3092, 0), new Position(3089,3082, 0), new Position(3079,3084, 0)
- };
- // path to house two 2
- private Position[] pathToHouseTwo2 = {
- new Position(3089,3092, 0), new Position(3087,3082, 0), new Position(3080,3084, 0)
- };
- // path to house two 3
- private Position[] pathToHouseTwo3 = {
- new Position(3089,3092, 0), new Position(3083,3092, 0), new Position(3080,3084, 0)
- };
- // path to house two 4
- private Position[] pathToHouseTwo4 = {
- new Position(3089,3092, 0), new Position(3084,3091, 0), new Position(3079,3084, 0)
- };
- private Position[] pathToMiner = {
- new Position(3088,9520, 0), new Position(3078,9515, 0), new Position(3080,9505, 0)
- };
- private Position[] pathToLadder = {
- new Position(3107,9509, 0), new Position(3112,9517, 0), new Position(3111,9525, 0)
- };
- private Position[] pathToBank = {
- new Position(3111,3125, 0), new Position(3118,3114, 0), new Position(3122,3123, 0)
- };
- private Position[] pathToPriest = {
- new Position(3130,3124, 0), new Position(3133,3114, 0), new Position(3129,3106, 0)
- };
- private Position[] pathToMage = {
- new Position(3122,3102, 0), new Position(3129,3092, 0), new Position(3141,3088, 0)
- };
- State state = State.WELCOME_SCREEN;
- enum State {
- WELCOME_SCREEN,
- TALK_TO_RUNESCAPE_GUIDE,
- CONTINUE_DIALOGUE,
- CLICK_ON_SPANNER,
- GO_THROUGH_DOOR_ONE,
- WALK_TO_SURVIVAL_EXPERT,
- TALK_TO_SURVIVAL_EXPERT,
- CLICK_ON_BAG,
- CHOP_TREE,
- LIGHT_FIRE,
- CLICK_ON_LEVELS,
- GO_FISH,
- COOK_FOOD,
- WALK_TO_GATE_ONE,
- GO_THROUGH_GATE_ONE,
- WALK_TO_HOUSE_TWO,
- ENTER_HOUSE_TWO,
- TALK_TO_CHEF,
- MIX_INGREDIENTS,
- MAKE_BREAD,
- CLICK_ON_MUSIC,
- WALK_TO_DOOR_TWO,
- GO_THROUGH_DOOR_TWO,
- CLICK_ON_EMOTES,
- CLICK_ON_YES,
- CLICK_ON_RUN,
- RUN_TO_HOUSE_THREE,
- ENTER_HOUSE_THREE,
- TALK_TO_QUEST_GUIDE,
- CLICK_ON_QUESTS,
- GO_DOWN_LADDER,
- WALK_TO_MINING_INSTRUCTOR,
- TALK_TO_MINING_INSTRUCTOR,
- PROSPECT_TIN,
- PROSPECT_COPPER,
- MINE_TIN,
- MINE_COPPER,
- SMELT_ORE,
- TALK_TO_MINER,
- CLICK_ON_ANVIL,
- SMITH_DAGGER,
- WALK_TO_GATE_TWO,
- GO_THROUGH_GATE_TWO,
- TALK_TO_COMBAT_INSTRUCTOR,
- CLICK_ON_EQUIPMENT,
- CLICK_ON_STATS,
- EQUIP_DAGGER,
- CLOSE_STATS,
- REMOVE_DAGGER,
- EQUIP_SWORD_AND_SHEILD,
- CLICK_ON_COMBAT,
- GO_THROUGH_GATE_THREE,
- KILL_RAT,
- GO_BACK_THROUGH_GATE_THREE,
- EQUIP_RANGE_GEAR,
- RANGE_RAT,
- WALK_TO_LADDER,
- CLIMB_UP_LADDER,
- WALK_TO_BANK,
- OPEN_BANK,
- CLOSE_BANK,
- CLICK_ON_POLL,
- CLOSE_POLL,
- TALK_TO_FINANICAL_ADVISOR,
- GO_THROUGH_DOOR_THREE,
- WALK_TO_CHURCH,
- TALK_TO_BROTHER,
- CLICK_ON_PRAY,
- CLICK_ON_FRIENDS,
- CLICK_ON_IGNORE,
- GO_THROUGH_DOOR_FOUR,
- WALK_TO_MAGE,
- TALK_TO_MAGE,
- CLICK_ON_MAGIC,
- CAST_AT_CHICKEN
- }
- public final void onStart()
- {
- log("------------------------------------------------------------------------------------------");
- log("SCRIPT IS NOW IN BETA V"+ getVersion() + " PLEASE REPORT ALL BUGS ASAP.");
- log("Thankyou.");
- log("------------------------------------------------------------------------------------------");
- this.timeBegan = System.currentTimeMillis();
- }
- public final void onExit()
- {
- log("------------------------------------------------------------------------------------------");
- log("THANKYOU FOR USING A Pug SCRIPT - V"+ getVersion() + " PLEASE REPORT ALL BUGS ASAP.");
- log("SCRIPT COMPLETED IN: " + ft(timeRan));
- log("------------------------------------------------------------------------------------------");
- this.timeBegan = System.currentTimeMillis();
- }
- public int onLoop() throws InterruptedException
- {
- state = getState();
- switch (state)
- {
- case WELCOME_SCREEN:
- return welcomeScreen();
- case TALK_TO_RUNESCAPE_GUIDE:
- return talkToRunescapeGuide();
- case CONTINUE_DIALOGUE:
- return continueDialogue();
- case CLICK_ON_SPANNER:
- return clickOnSpanner();
- case GO_THROUGH_DOOR_ONE:
- return goThroughDoorOne();
- case WALK_TO_SURVIVAL_EXPERT:
- return walkToSurvivalExpert();
- case TALK_TO_SURVIVAL_EXPERT:
- return talkToSurvivalExpert();
- case CLICK_ON_BAG:
- return clickOnBag();
- case CHOP_TREE:
- return chopTree();
- case LIGHT_FIRE:
- return lightFire();
- case CLICK_ON_LEVELS:
- return clickOnLevels();
- case GO_FISH:
- return goFish();
- case COOK_FOOD:
- return cookFood();
- case WALK_TO_GATE_ONE:
- return walkToGateOne();
- case GO_THROUGH_GATE_ONE:
- return goThroughGateOne();
- case WALK_TO_HOUSE_TWO:
- return walkToHouseTwo();
- case ENTER_HOUSE_TWO:
- return enterHouseTwo();
- case TALK_TO_CHEF:
- return talkToChef();
- case MIX_INGREDIENTS:
- return mixIngredients();
- case MAKE_BREAD:
- return makeBread();
- case CLICK_ON_MUSIC:
- return clickOnMusic();
- case WALK_TO_DOOR_TWO:
- return walkToDoorTwo();
- case GO_THROUGH_DOOR_TWO:
- return goThroughDoorTwo();
- case CLICK_ON_EMOTES:
- return clickOnEmotes();
- case CLICK_ON_YES:
- return clickOnYes();
- case CLICK_ON_RUN:
- return clickOnRun();
- case RUN_TO_HOUSE_THREE:
- return runToHouseThree();
- case ENTER_HOUSE_THREE:
- return enterHouseThree();
- case TALK_TO_QUEST_GUIDE:
- return talkToQuestGuide();
- case CLICK_ON_QUESTS:
- return clickOnQuests();
- case GO_DOWN_LADDER:
- return goDownLadder();
- case WALK_TO_MINING_INSTRUCTOR:
- return walkToMiningInstructor();
- case TALK_TO_MINING_INSTRUCTOR:
- return talkToMiningInstructor();
- case PROSPECT_TIN:
- return prospectTin();
- case PROSPECT_COPPER:
- return prospectCopper();
- case MINE_TIN:
- return mineTin();
- case MINE_COPPER:
- return mineCopper();
- case SMELT_ORE:
- return smeltOre();
- case TALK_TO_MINER:
- return talkToMiner();
- case CLICK_ON_ANVIL:
- return clickOnAnvil();
- case SMITH_DAGGER:
- return smithDagger();
- case WALK_TO_GATE_TWO:
- return walkToGateTwo();
- case GO_THROUGH_GATE_TWO:
- return goThroughGateTwo();
- case TALK_TO_COMBAT_INSTRUCTOR:
- return talkToCombatInstructor();
- case CLICK_ON_EQUIPMENT:
- return clickOnEquipment();
- case CLICK_ON_STATS:
- return clickOnStats();
- case EQUIP_DAGGER:
- return equipDagger();
- case CLOSE_STATS:
- return closeStats();
- case REMOVE_DAGGER:
- return removeDagger();
- case EQUIP_SWORD_AND_SHEILD:
- return equipSwordAndShield();
- case CLICK_ON_COMBAT:
- return clickOnCombat();
- case GO_THROUGH_GATE_THREE:
- return goThroughGateThree();
- case KILL_RAT:
- return killRat();
- case GO_BACK_THROUGH_GATE_THREE:
- return goBackThroughGateThree();
- case EQUIP_RANGE_GEAR:
- return equipRangeGear();
- case RANGE_RAT:
- return rangeRat();
- case WALK_TO_LADDER:
- return walkToLadder();
- case CLIMB_UP_LADDER:
- return climbUpLadder();
- case WALK_TO_BANK:
- return walkToBank();
- case OPEN_BANK:
- return openBank();
- case CLOSE_BANK:
- return closeBank();
- case CLICK_ON_POLL:
- return clickOnPoll();
- case CLOSE_POLL:
- return closePoll();
- case TALK_TO_FINANICAL_ADVISOR:
- return talkToFinancialAdvisor();
- case GO_THROUGH_DOOR_THREE:
- return goThroughDoorThree();
- case WALK_TO_CHURCH:
- return walkToChurch();
- case TALK_TO_BROTHER:
- return talkToBrother();
- case CLICK_ON_PRAY:
- return clickOnPray();
- case CLICK_ON_FRIENDS:
- return clickOnFriends();
- case CLICK_ON_IGNORE:
- return clickOnIgnore();
- case GO_THROUGH_DOOR_FOUR:
- return goThroughDoorFour();
- case WALK_TO_MAGE:
- return walkToMage();
- case TALK_TO_MAGE:
- return talkToMage();
- case CLICK_ON_MAGIC:
- return clickOnMagic();
- case CAST_AT_CHICKEN:
- return castAtChicken();
- default:
- continueDialogue();
- break;
- }
- return 150 + random(12,92);
- }
- State getState() throws InterruptedException {
- if(!interfaces.containingText(269, "Use the buttons below to design your player").isEmpty())
- {
- log("welcome screen state");
- return State.WELCOME_SCREEN;
- }
- if(!interfaces.containingText("To start the tutorial use your left mouse button",
- "On the side panel, you can now see a variety of options").isEmpty())
- {
- log("talk to rs guide");
- return State.TALK_TO_RUNESCAPE_GUIDE;
- }
- if(!interfaces.containingText("Greetings! I see you are a new arrival",
- "You have already learned the first thing",
- "You will find many inhabitants of this world",
- "I would also suggest reading through",
- "contains maps and helpful tips to help you",
- "You will notice a flashing icon",
- "I'm glad you're making progress!",
- "To continue the tutorial go through that door",
- "Hello there, newcomer. My name is Brynna.",
- "You get some logs.",
- "Well done! Next we need to get some food in our",
- "The Survival Guide gives you a net!",
- "Ah! Welcome, newcomer. I am the Master Chef, Lev.",
- "teach you the fine art of cooking bread.",
- "And no fine meal is complete without good music",
- "Ah. Welcome, Adventurer. I'm here to tell you all about",
- "Now you have the journal open",
- "When you start a quest it will change colour",
- "The start of quests are easy to find. Look out for",
- "The quests themselves can vary greatly from collecting",
- "There's not a lot more I can tell you about questing",
- "Hi there. You must be new around here. So what do I",
- "miner by trade.",
- "I prospected both types of rock!",
- "be smelted together to make bronze.",
- "So now you know what ore is in the rocks over there,",
- "Okay, I'll show you how to make a dagger out of it.",
- "Do i look like i care? To me you're just another",
- "I am Vannaka, the greatest swordsman alive.",
- "Let's get Started by teaching you to wield a weapon.",
- "Very good, but that little butter knife isn't going to",
- "I did it! I killed a giant rat!",
- "Now that you have grasped basic swordplay,",
- "try some ranged attacking, with this you can kill",
- "Good day, would you like to access your bank account",
- "the financial Advisor.",
- "Okay. How can I make money then?",
- "How you can make money? Quite.",
- "Well, there are three basic ways of making money here",
- "start with combat as it is probably still fresh in",
- "Now, the next way to earn money quickly is by quests",
- "By getting a high level in skills such as Cooking",
- "Well, that about covers it. Come back if",
- "Good day, brother, my",
- "you all about Prayer.",
- "This is your Prayer list. Prayers can help a lot in",
- "Active prayers will drain your Prayer Points, which",
- "As you noticed, most enemies will drop bones when",
- "job to tell you about your friends and ignore list.",
- "clicking the add button then typing their name into the",
- "You remove people from the lists in the same way.",
- "Your friends list shows the online status of your",
- "Are there rules on",
- "Yes, you should read the rules of conduct on the",
- "But in general, always try to be courteous to other",
- "character could end up being the one in trouble.",
- "bear that in mind.",
- "Good day, newcomer. My name is Terrova.",
- "only cast one offensive spell called Wind Strike.",
- "reasonable number of runes when you leave.",
- "When you get to the mainland you will find yourself",
- "and carries a rucksack full of scrolls. There are also",
- "When you get to Lumbridge, look for this icon on your",
- "If all else fails, visit the RuneScape website for").isEmpty())
- {
- log("continue dialogue");
- return State.CONTINUE_DIALOGUE;
- }
- if(!interfaces.containingText(131, "Click here to continue").isEmpty() ||
- !interfaces.containingText(519, "Click here to continue").isEmpty() ||
- !interfaces.containingText(65, "Click here to continue").isEmpty() ||
- !interfaces.containingText(64, "Click here to continue").isEmpty() ||
- !interfaces.containingText(204, "Click here to continue").isEmpty() ||
- !interfaces.containingText(519, "Click here to continue").isEmpty())
- {
- log("continue dialogue");
- return State.CONTINUE_DIALOGUE;
- }
- if(!interfaces.containingText("Please click on the flashing spanner icon").isEmpty() ||
- !interfaces.containingText("It's only a short distance to the next guide.").isEmpty())
- {
- log("click on spanner");
- return State.CLICK_ON_SPANNER;
- }
- if(!interfaces.containingText("You can interact with many items of scenery by simply").isEmpty())
- {
- log("go through door 1");
- return State.GO_THROUGH_DOOR_ONE;
- }
- if(!interfaces.containingText("Follow the path to find the next instructor.").isEmpty() && !Area2.contains(myPlayer()))
- {
- log("walk to expert");
- return State.WALK_TO_SURVIVAL_EXPERT;
- }
- if(Area2.contains(myPlayer()) && !interfaces.containingText("Follow the path to find the next instructor.").isEmpty() ||
- !interfaces.containingText("Here you will see how good your skills are.").isEmpty())
- {
- log("talk to expert");
- return State.TALK_TO_SURVIVAL_EXPERT;
- }
- if(!interfaces.containingText("Click on the flashing backpack icon to the right hand side").isEmpty() ||
- (!equipment.isWieldingWeapon("Bronze dagger") && !Tab.INVENTORY.isOpen(bot) &&
- !interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty()))
- {
- log("click on inventory");
- return State.CLICK_ON_BAG;
- }
- if(!interfaces.containingText("You can click on the backpack icon at any time to view").isEmpty())
- {
- log("chop down tree");
- return State.CHOP_TREE;
- }
- if(!interfaces.containingText("Well done! You managed to cut some logs from the tree!").isEmpty())
- {
- log("light fire");
- return State.LIGHT_FIRE;
- }
- if(!interfaces.containingText("Click on the flashing bar graph icon near the inventory button").isEmpty())
- {
- log("click on levels");
- return State.CLICK_ON_LEVELS;
- }
- if((!interfaces.containingText("Click on the sparkling fishing spot, indicated by the flashing").isEmpty() && !inventory.contains("Raw shrimps"))
- || (inventory.getAmount("Raw shrimps")== 1 && !inventory.contains("Burnt shrimp")))
- {
- log("fish some fishies");
- return State.GO_FISH;
- }
- if((!interfaces.containingText("Now you have caught some shrimp, let's cook it.").isEmpty() && inventory.getAmount("Raw shrimps")== 2) ||
- !interfaces.containingText("Now right click on the shrimp and select the use option.").isEmpty() ||
- !interfaces.containingText("You have just burnt your first shrimp. this is normal.").isEmpty())
- {
- log("cook the food");
- return State.COOK_FOOD;
- }
- if(!interfaces.containingText("If you'd like a recap on anything you've learnt so far").isEmpty() &&
- !Area3.contains(myPlayer()))
- {
- log("walk to gate 1");
- return State.WALK_TO_GATE_ONE;
- }
- if(Area3.contains(myPlayer()))
- {
- log("near first gate");
- return State.GO_THROUGH_GATE_ONE;
- }
- if(!interfaces.containingText("Follow the path until you get to the door").isEmpty() &&
- !Area4.contains(myPlayer()))
- {
- log("walk to house 2");
- return State.WALK_TO_HOUSE_TWO;
- }
- if(Area4.contains(myPlayer()))
- {
- log("near door to house two.");
- return State.ENTER_HOUSE_TWO;
- }
- if(!interfaces.containingText("Talk to the chef indicated.").isEmpty())
- {
- log("chef is nearby");
- return State.TALK_TO_CHEF;
- }
- if(!interfaces.containingText("This is the base for many of the meals.").isEmpty())
- {
- log("Time to make some dough.");
- return State.MIX_INGREDIENTS;
- }
- if(!interfaces.containingText("Now you have made dough, you can cook it.").isEmpty())
- {
- log("Time to cook the dough.");
- return State.MAKE_BREAD;
- }
- if(!interfaces.containingText("Well done! Your first loaf of bread.").isEmpty())
- {
- log("bread made, click on music");
- return State.CLICK_ON_MUSIC;
- }
- if(!interfaces.containingText("From this interface you can control the music that is played.").isEmpty() &&
- !Area5.contains(myPlayer()))
- {
- log("need to walk to door 2");
- return State.WALK_TO_DOOR_TWO;
- }
- if(Area5.contains(myPlayer()))
- {
- log("near outside door of house 2");
- return State.GO_THROUGH_DOOR_TWO;
- }
- if(!interfaces.containingText("Now, how about showing some feelings?").isEmpty())
- {
- log("need to click on emote tab");
- return State.CLICK_ON_EMOTES;
- }
- if(!interfaces.containingText("For those situations where words don't quite describe").isEmpty())
- {
- log("click on yes emoji");
- return State.CLICK_ON_YES;
- }
- if(!interfaces.containingText("In this menu you will see many options. At the bottom").isEmpty())
- {
- log("click on run");
- return State.CLICK_ON_RUN;
- }
- if(!interfaces.containingText("Now that you have the run button turned on,").isEmpty() &&
- !Area6.contains(myPlayer()))
- {
- log("run to house three");
- return State.RUN_TO_HOUSE_THREE;
- }
- if(Area6.contains(myPlayer()))
- {
- log("near door to house three.");
- return State.ENTER_HOUSE_THREE;
- }
- if(!interfaces.containingText("Talk with the Quest Guide.").isEmpty() ||
- !interfaces.containingText("This is your Quest Journal, a list of all the quests in the game.").isEmpty())
- {
- log("Talk with the Quest Guide.");
- return State.TALK_TO_QUEST_GUIDE;
- }
- if(!interfaces.containingText("Click on the flashing icon next to your inventory.").isEmpty())
- {
- log("click on the quest button");
- return State.CLICK_ON_QUESTS;
- }
- if(!interfaces.containingText("It's time to enter some caves. Click on the ladder to go down").isEmpty())
- {
- log("click on the ladder");
- return State.GO_DOWN_LADDER;
- }
- if(!interfaces.containingText("Next let's get you a weapon, or more to the point").isEmpty() &&
- !Area7.contains(myPlayer()))
- {
- log("walk to mining instructor");
- return State.WALK_TO_MINING_INSTRUCTOR;
- }
- if((!interfaces.containingText("Next let's get you a weapon, or more to the point").isEmpty() &&
- Area7.contains(myPlayer())) ||
- !interfaces.containingText("Talk to the Mining Instructor to find out about these types").isEmpty())
- {
- log("Talk to mining instructor");
- return State.TALK_TO_MINING_INSTRUCTOR;
- }
- if(!interfaces.containingText("To Prospect a mineable rock, just right click it").isEmpty())
- {
- log("prospect tin.");
- return State.PROSPECT_TIN;
- }
- if(!interfaces.containingText("So now you know there's tin in the grey rocks,").isEmpty())
- {
- log("prospect copper.");
- return State.PROSPECT_COPPER;
- }
- if(!interfaces.containingText("It's quite simple really. All you need to do is right click").isEmpty())
- {
- log("mine some tin.");
- return State.MINE_TIN;
- }
- if(!interfaces.containingText("Now you have some tin ore you just need some copper ore,").isEmpty())
- {
- log("mine some copper.");
- return State.MINE_COPPER;
- }
- if(!interfaces.containingText("You should now have both some copper and tin ore. So").isEmpty())
- {
- log("smelt the ores.");
- return State.SMELT_ORE;
- }
- if(!interfaces.containingText(548, "Click to continue").isEmpty())
- {
- log("click to continue");
- Rectangle Rectangle1 = new Rectangle(210,425, 50, 10);
- mouse.click(new RectangleDestination(bot, Rectangle1), false);
- sleep(252);
- }
- if(!interfaces.containingText("Speak to the Mining Instructor and he'll show you how to make").isEmpty())
- {
- log("talk to mining instructor.");
- return State.TALK_TO_MINER;
- }
- if(!interfaces.containingText("To smith you'll need a hammer").isEmpty())
- {
- log("Click on the anvil");
- return State.CLICK_ON_ANVIL;
- }
- if(!interfaces.containingText("Now you have the smithing menu open, you will see").isEmpty())
- {
- log("Click on the dagger");
- return State.SMITH_DAGGER;
- }
- if(!interfaces.containingText("So let's move on. Go through the gates shown by the arrow.").isEmpty() &&
- !Area8.contains(myPlayer()))
- {
- log("walk to gates");
- return State.WALK_TO_GATE_TWO;
- }
- if(Area8.contains(myPlayer()))
- {
- log("go through gate 2");
- return State.GO_THROUGH_GATE_TWO;
- }
- if((!interfaces.containingText("In this area you will find out about combat with swords").isEmpty()) ||
- !interfaces.containingText("Clothes, Armour, weapons and many other items are equipped").isEmpty() &&
- !interfaces.get(84).isValid())
- {
- log("go talk to combat instructor");
- return State.TALK_TO_COMBAT_INSTRUCTOR;
- }
- if(!interfaces.containingText("You now have access to a new interface. Click on the flashing").isEmpty())
- {
- log("click on equipment tab");
- return State.CLICK_ON_EQUIPMENT;
- }
- if(!interfaces.containingText("From here you can see what items you have equipped.").isEmpty())
- {
- log("click on equipment stats");
- return State.CLICK_ON_STATS;
- }
- if(!interfaces.containingText("You can see what items you are wearing in the worn inventory").isEmpty())
- {
- log("equip the dagger");
- return State.EQUIP_DAGGER;
- }
- if(!interfaces.containingText("Clothes, Armour, weapons and many other items are equipped").isEmpty() &&
- interfaces.get(84).isValid())
- {
- log("close stats");
- return State.CLOSE_STATS;
- }
- if(!interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty() &&
- !Tab.INVENTORY.isOpen(bot))
- {
- log("remove the dagger");
- return State.REMOVE_DAGGER;
- }
- if(!interfaces.containingText("In your worn inventory panel, right click on the dagger").isEmpty() &&
- Tab.INVENTORY.isOpen(bot) &&
- !equipment.isWieldingWeapon("Bronze dagger"))
- {
- log("equip new stuff");
- return State.EQUIP_SWORD_AND_SHEILD;
- }
- if(!interfaces.containingText("Click on the flashing crossed swords icon to see the combat").isEmpty())
- {
- log("click on combat options");
- return State.CLICK_ON_COMBAT;
- }
- if(!interfaces.containingText("From this interface you can select the type of attack").isEmpty())
- {
- log("go through gates to pen");
- return State.GO_THROUGH_GATE_THREE;
- }
- if(!interfaces.containingText("To attack the rat, right click it and select the attack option.").isEmpty() ||
- !interfaces.containingText("While you are fighting you will see a bar over your head.").isEmpty())
- {
- log("kill the rat!");
- return State.KILL_RAT;
- }
- if(!interfaces.containingText("Pass through the gate and talk to the Combat Instructor").isEmpty())
- {
- log("go back to instructor");
- return State.GO_BACK_THROUGH_GATE_THREE;
- }
- if(!interfaces.containingText("Now you have a bow and some arrows. Before you can use").isEmpty() &&
- !equipment.isWieldingWeapon("Shortbow"))
- {
- log("equip new range gear");
- return State.EQUIP_RANGE_GEAR;
- }
- if(!interfaces.containingText("Now you have a bow and some arrows. Before you can use").isEmpty() &&
- equipment.isWieldingWeapon("Shortbow") && equipment.isWearingItem(EquipmentSlot.ARROWS, "Bronze arrow"))
- {
- log("range the rat");
- return State.RANGE_RAT;
- }
- if(!interfaces.containingText("You have completed the tasks here. To move on, click on the").isEmpty() &&
- !Area10.contains(myPlayer()))
- {
- log("walk to ladder");
- return State.WALK_TO_LADDER;
- }
- if(!interfaces.containingText("You have completed the tasks here. To move on, click on the").isEmpty() &&
- Area10.contains(myPlayer()))
- {
- log("Climb up ladder");
- return State.CLIMB_UP_LADDER;
- }
- if(!interfaces.containingText("Follow the path and you will come to the front of the building.").isEmpty() &&
- !Area11.contains(myPlayer()))
- {
- log("walk to bank");
- return State.WALK_TO_BANK;
- }
- if(!interfaces.containingText("Follow the path and you will come to the front of the building.").isEmpty() &&
- Area11.contains(myPlayer()))
- {
- log("open bank");
- return State.OPEN_BANK;
- }
- if(!interfaces.containingText("Select an Option").isEmpty())
- {
- log("click yes.");
- if(interfaces.get(228) != null)
- {
- log("clicking on yes.");
- interfaces.interactWithChild(228, 1, "Continue");
- sleep(200 + random (100, 200));
- }
- }
- if(!interfaces.containingText("You can store stuff here for safekeeping. If you die,").isEmpty() &&
- bank.isOpen())
- {
- log("close the bank");
- return State.CLOSE_BANK;
- }
- if(!interfaces.containingText("You can store stuff here for safekeeping. If you die,").isEmpty() &&
- !bank.isOpen())
- {
- log("click on poll station");
- return State.CLICK_ON_POLL;
- }
- if(!interfaces.containingText("Polls are run periodically to let the Runescape community").isEmpty())
- {
- log("close the poll window.");
- return State.CLOSE_POLL;
- }
- RS2Object poll = objects.closest("Poll booth");
- if(!interfaces.containingText("Polls are run periodically to let the Runescape community").isEmpty() &&
- !interfaces.containingText("This poll will close on").isEmpty())
- {
- log("close the poll window.");
- return State.CLOSE_POLL;
- }
- if(!interfaces.containingText("The guide here will tell you all about making cash.").isEmpty())
- {
- log("talk to finanicial advisor");
- return State.TALK_TO_FINANICAL_ADVISOR;
- }
- if(!interfaces.containingText("Continue through the next door.").isEmpty() &&
- myPosition().getX() >= 3124 && myPosition().getX() <= 3129)
- {
- log("go through next door to walk to priest.");
- return State.GO_THROUGH_DOOR_THREE;
- }
- if(!interfaces.containingText("Follow the path to the chapel and enter it.").isEmpty() &&
- !Area12.contains(myPlayer()))
- {
- log("walk to chapel.");
- return State.WALK_TO_CHURCH;
- }
- if((!interfaces.containingText("Follow the path to the chapel and enter it.").isEmpty() &&
- Area12.contains(myPlayer())) ||
- (!interfaces.containingText("Talk with Brother Brace and").isEmpty()) ||
- (!interfaces.containingText("keeping track of when your friends are online or for blocking").isEmpty()))
- {
- log("Talk to brother priest.");
- return State.TALK_TO_BROTHER;
- }
- if(!interfaces.containingText("Click on the flashing icon to open the Prayer menu.").isEmpty())
- {
- log("Click on prayer menu");
- return State.CLICK_ON_PRAY;
- }
- if(!interfaces.containingText("You should now see another new icon. Click on the flashing").isEmpty())
- {
- log("Click on friends list");
- return State.CLICK_ON_FRIENDS;
- }
- if(!interfaces.containingText("This will be explained by Brother Brace shortly, but first click").isEmpty())
- {
- log("Click on ignore list");
- return State.CLICK_ON_IGNORE;
- }
- if(!interfaces.containingText("almost finished on tutorial island. Pass through").isEmpty())
- {
- log("go through door 4");
- return State.GO_THROUGH_DOOR_FOUR;
- }
- if(!interfaces.containingText("shown how to cast spells. Just talk with the mage").isEmpty() &&
- !Area13.contains(myPlayer()))
- {
- log("walk to mage");
- return State.WALK_TO_MAGE;
- }
- if((!interfaces.containingText("shown how to cast spells. Just talk with the mage").isEmpty() &&
- Area13.contains(myPlayer())) ||
- !interfaces.containingText("All you need to do now is move on to the mainland.").isEmpty())
- {
- log("talk to mage");
- return State.TALK_TO_MAGE;
- }
- if(!interfaces.containingText("Open up the Magic menu by clicking on the flashing icon").isEmpty())
- {
- log("click on magic tab");
- return State.CLICK_ON_MAGIC;
- }
- if(!interfaces.containingText("Now you have runes you should see the Wind Strike icon").isEmpty())
- {
- log("cast wind strike on chicken.");
- return State.CAST_AT_CHICKEN;
- }
- if(!interfaces.containingText("Do you want to go to the mainland?").isEmpty())
- {
- log("click on yes go to mainland.");
- if(interfaces.get(228) != null)
- {
- log("clicking yes");
- interfaces.interactWithChild(228, 1, "Continue");
- }
- }
- if(!interfaces.containingText("Welcome to Lumbridge! To get more help, simply click").isEmpty() ||
- Area14.contains(myPlayer()))
- {
- stopScript();
- }
- return getState();
- }
- //-----------------------------------------------------------------------------------------------------
- //-----------------------------------------------------------------------------------------------------
- //-----------------------------------------------------------------------------------------------------
- public void headDesign() throws InterruptedException {
- int head = 0;
- // head design
- if(interfaces.get(269).getChild(113) != null)
- {
- head = random(0,15);
- for (int i = 0; i < head; i++)
- {
- interfaces.interactWithChild(269, 113, "Change head");
- sleep(252 + random(1,100));
- }
- }
- }
- public void jawDesign() throws InterruptedException {
- int jaw = 0;
- // jaw design
- if(interfaces.get(269).getChild(114) != null)
- {
- jaw = random(0,5);
- for (int i = 0; i < jaw; i++)
- {
- interfaces.interactWithChild(269, 114, "Change jaw");
- sleep(252 + random(1,100));
- }
- }
- }
- public void torsoDesign() throws InterruptedException {
- // torso design
- if(interfaces.get(269).getChild(115) != null)
- {
- int torso = 0;
- torso = random(0,14);
- for (int i = 0; i < torso; i++)
- {
- interfaces.interactWithChild(269, 115, "Change torso");
- sleep(252 + random(1,100));
- }
- }
- }
- public void armsDesign() throws InterruptedException {
- int arms = 0;
- // arms design
- if(interfaces.get(269).getChild(116) != null)
- {
- arms = random(0,12);
- for (int i = 0; i < arms; i++)
- {
- interfaces.interactWithChild(269, 116, "Change arms");
- sleep(252 + random(1,100));
- }
- }
- }
- public void handsDesign() throws InterruptedException {
- int hands = 0;
- // hands design
- if(interfaces.get(269).getChild(117) != null)
- {
- hands = random(0,2);
- for (int i = 0; i < hands; i++)
- {
- interfaces.interactWithChild(269, 117, "Change hands");
- sleep(252 + random(1,100));
- }
- }
- }
- public void legsDesign() throws InterruptedException {
- int legs = 0;
- // legs design
- if(interfaces.get(269).getChild(118) != null)
- {
- legs = random(0,14);
- for (int i = 0; i < legs; i++)
- {
- interfaces.interactWithChild(269, 118, "Change legs");
- sleep(252 + random(1,100));
- }
- }
- }
- public void feetDesign() throws InterruptedException {
- int feet = 0;
- // feet design
- if(interfaces.get(269).getChild(119) != null)
- {
- feet = random(0,3);
- for (int i = 0; i < feet; i++)
- {
- interfaces.interactWithChild(269, 119, "Change feet");
- sleep(252 + random(1,100));
- }
- }
- }
- public void hairColour() throws InterruptedException {
- int hair = 0;
- // hair colour
- if(interfaces.get(269).getChild(121) != null)
- {
- hair = random(0,22);
- for (int i = 0; i < hair; i++)
- {
- interfaces.interactWithChild(269, 121, "Recolour hair");
- sleep(252 + random(1,100));
- }
- }
- }
- public void torsoColour() throws InterruptedException {
- int torsoc = 0;
- // torso colour
- if(interfaces.get(269).getChild(127) != null)
- {
- torsoc = random(0,22);
- for (int i = 0; i < torsoc; i++)
- {
- interfaces.interactWithChild(269, 127, "Recolour torso");
- sleep(252 + random(1,100));
- }
- }
- }
- public void legsColour() throws InterruptedException {
- int legsc = 0;
- // legs colour
- if(interfaces.get(269).getChild(129) != null)
- {
- legsc = random(0,9);
- for (int i = 0; i < legsc; i++)
- {
- interfaces.interactWithChild(269, 129, "Recolour legs");
- sleep(252 + random(1,100));
- }
- }
- }
- public void feetColour() throws InterruptedException {
- int feetc = 0;
- // feet colour
- if(interfaces.get(269).getChild(130) != null)
- {
- feetc = random(0,3);
- for (int i = 0; i < feetc; i++)
- {
- interfaces.interactWithChild(269, 130, "Recolour feet");
- sleep(252 + random(1,100));
- }
- }
- }
- public void skinColour() throws InterruptedException {
- int skin = 0;
- // skin colour
- if(interfaces.get(269).getChild(131) != null)
- {
- skin = random(0,7);
- for (int i = 0; i < skin; i++)
- {
- interfaces.interactWithChild(269, 131, "Recolour skin");
- sleep(252 + random(1,100));
- }
- }
- }
- public void character() throws InterruptedException {
- log("making character.");
- headDesign();
- jawDesign();
- torsoDesign();
- armsDesign();
- handsDesign();
- legsDesign();
- feetDesign();
- hairColour();
- torsoColour();
- legsColour();
- feetColour();
- skinColour();
- return;
- }
- int welcomeScreen() throws InterruptedException {
- if(interfaces.get(269) != null)
- {
- character();
- if(interfaces.get(269).getChild(100) != null)
- {
- log("found accept box, interacting!");
- interfaces.interactWithChild(269, 100, "Accept");
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- }
- else
- {
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToRunescapeGuide() throws InterruptedException {
- NPC guide = npcs.closest("RuneScape Guide");
- if(guide != null)
- {
- if(guide.isVisible())
- {
- guide.interact("Talk-to");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- if(!guide.isVisible())
- {
- log("cant see guide, moving camyPlayer()ra");
- camera.toEntity(guide);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int continueDialogue() throws InterruptedException {
- interfaces.getDialogues().clickContinue();
- sleep(200 + random (100, 200));
- antiban();
- return 90 + gRandom(200, 400.0D);
- }
- int clickOnSpanner() throws InterruptedException {
- if(interfaces.get(548) != null)
- {
- log("548 != null, clicking options tab");
- interfaces.interactWithChild(548, 35, "Options");
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 100 + gRandom(200, 400.0D);
- }
- int goThroughDoorOne() throws InterruptedException {
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("door exists and is visible, interacting.");
- door.interact("Open");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- run();
- return 200 + gRandom(200, 400.0D);
- }
- if(!door.isVisible())
- {
- log("cant see the soor, moving camera to it.");
- camera.toEntity(door);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToSurvivalExpert() throws InterruptedException
- {
- log("walking to expert");
- localWalker.walk(new Position(3103,3096,0));
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 300.0D);
- }
- int talkToSurvivalExpert() throws InterruptedException
- {
- NPC expert = npcs.closest("Survival Expert");
- if(expert != null)
- {
- if(expert.isVisible())
- {
- expert.interact("Talk-to");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 300.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnBag() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("inventory button exists, clicking on it");
- interfaces.interactWithChild(548, 51, "Inventory");
- sleep(200 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int chopTree() throws InterruptedException
- {
- RS2Object tree = objects.closest("Tree");
- if(tree != null)
- {
- if(tree.isVisible())
- {
- log("tree is visible, chopping");
- tree.interact("Chop down");
- antiban();
- sleep(300 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int lightFire() throws InterruptedException
- {
- localWalker.walk(new Position(3101,3092,0));
- log("using tinderbox on logs");
- inventory.interact("Use", 590);
- sleep(500 + random (100, 200));
- inventory.interact("Use", 2511);
- mouse.moveRandomly();
- sleep(500 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(100 + random(200,400));
- }
- return 300 + gRandom(200, 400.0D);
- }
- int clickOnLevels() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- interfaces.interactWithChild(548, 49, "Stats");
- mouse.moveSlightly();
- sleep(500 + random (100, 200));
- clickOnBag();
- return 500 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goFish() throws InterruptedException
- {
- log("walking to spot.");
- localWalker.walk(new Position(3101,3093,0));
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- NPC fish = npcs.closest("Fishing spot");
- if(fish != null)
- {
- if(fish.isVisible())
- {
- log("spot is available and visible, go go");
- fish.interact("Net");
- mouse.moveVerySlightly();
- sleep(300 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int cookFood() throws InterruptedException
- {
- RS2Object fire = objects.closest("Fire");
- log("time to cook some shrimp");
- if(fire != null)
- {
- inventory.interact("Use", "Raw shrimps");
- sleep(400 + random (100, 200));
- fire.interact("Use");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- }
- else if(fire == null)
- {
- log("fire went out, cutting + lighting again.");
- chopTree();
- lightFire();
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToGateOne() throws InterruptedException
- {
- localWalker.walk(new Position(3091,3091,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughGateOne() throws InterruptedException
- {
- RS2Object gate = objects.closest("Gate");
- if(gate != null)
- {
- if(gate.isVisible())
- {
- gate.interact("Open");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToHouseTwo() throws InterruptedException
- {
- if (randomPath == 0)
- {
- log("random = 0");
- randomPath = random(1,4);
- }
- if(randomPath == 1)
- {
- localWalker.walkPath(pathToHouseTwo);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 2)
- {
- localWalker.walkPath(pathToHouseTwo2);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 3)
- {
- localWalker.walkPath(pathToHouseTwo3);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 4)
- {
- localWalker.walkPath(pathToHouseTwo4);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int enterHouseTwo() throws InterruptedException
- {
- randomPath = 0;
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("door is visible, interacting");
- door.interact("Open");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToChef() throws InterruptedException
- {
- NPC chef = npcs.closest("Master Chef");
- localWalker.walk(new Position(3075,3085,0));
- camera.movePitch(50+ random(10,17));
- if(chef != null)
- {
- if(chef.isVisible())
- {
- log("Chef is near, talk to him.");
- chef.interact("Talk-to");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int mixIngredients() throws InterruptedException
- {
- log("using flour on water");
- inventory.interact("Use", 2516);
- sleep(400 + random (100, 200));
- inventory.interact("Use", 1929);
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int makeBread() throws InterruptedException
- {
- log("using dough on stove");
- RS2Object oven = objects.closest("Range");
- localWalker.walk(oven);
- inventory.interact("Use", 2307);
- sleep(400 + random (100, 200));
- if(oven != null)
- {
- if(oven.isVisible())
- {
- log("interacting with range");
- oven.interact("Use");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnMusic() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("clicking the music tab");
- interfaces.interactWithChild(548, 37, "Music Player");
- sleep(400 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToDoorTwo() throws InterruptedException
- {
- localWalker.walk(new Position(3073,3090,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughDoorTwo() throws InterruptedException
- {
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("door is visible, interacting");
- door.interact("Open");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnEmotes() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on emotes tab");
- interfaces.interactWithChild(548, 36, "Emotes");
- sleep(400 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnYes() throws InterruptedException
- {
- if(interfaces.get(464) != null)
- {
- log("Clicking on yes emoji");
- //interfaces.interactWithChild(464, 38, "Yes");
- Rectangle rec1 = new Rectangle(555,212,15,30);
- Rectangle rec2 = new Rectangle(595,212,15,30);
- Rectangle rec3 = new Rectangle(640,212,15,30);
- Rectangle rec4 = new Rectangle(680,212,15,30);
- Rectangle rec5 = new Rectangle(555,265,15,30);
- Rectangle rec6 = new Rectangle(595,265,15,30);
- Rectangle rec7 = new Rectangle(640,265,15,30);
- Rectangle rec8 = new Rectangle(680,265,15,30);
- Rectangle rec9 = new Rectangle(595,312,15,30);
- Rectangle rec10 = new Rectangle(640,312,15,30);
- int c = random(1, 23);
- if(c == 1)
- {
- log("Random emote 1");
- mouse.click(new RectangleDestination(bot, rec1), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 3)
- {
- log("Random emote 2");
- mouse.click(new RectangleDestination(bot, rec2), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 5)
- {
- log("Random emote 3");
- mouse.click(new RectangleDestination(bot, rec3), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 7)
- {
- log("Random emote 4");
- mouse.click(new RectangleDestination(bot, rec4), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 9)
- {
- log("Random emote 5");
- mouse.click(new RectangleDestination(bot, rec5), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 11)
- {
- log("Random emote 6");
- mouse.click(new RectangleDestination(bot, rec6), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 13)
- {
- log("Random emote 7");
- mouse.click(new RectangleDestination(bot, rec7), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 15)
- {
- log("Random emote 8");
- mouse.click(new RectangleDestination(bot, rec8), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 17)
- {
- log("Random emote 9");
- mouse.click(new RectangleDestination(bot, rec9), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- if(c == 19)
- {
- log("Random emote 10");
- mouse.click(new RectangleDestination(bot, rec10), false);
- mouse.moveRandomly();
- sleep(920 + random(10,34));
- tabs.open(Tab.INVENTORY);
- sleep(950 + random(100,400));
- }
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnRun() throws InterruptedException
- {
- if(interfaces.get(261) != null)
- {
- log("Clicking on run");
- sleep(200);
- interfaces.interactWithChild(261, 55, "Toggle Run");
- sleep(400 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- private void run()
- throws InterruptedException
- {
- if(configs.isSet(173, 0))
- {
- Rectangle localRectangle = new Rectangle(570, 127, 20, 20);
- mouse.click(new RectangleDestination(bot, localRectangle), false);
- sleep(800);
- }
- }
- int runToHouseThree() throws InterruptedException
- {
- if (randomPath == 0)
- {
- log("random = 0");
- randomPath = random(1,4);
- }
- if(randomPath == 1)
- {
- localWalker.walkPath(pathToHouseThree);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 2)
- {
- localWalker.walkPath(pathToHouseThree2);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 3)
- {
- localWalker.walkPath(pathToHouseThree3);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- else if (randomPath == 4)
- {
- localWalker.walkPath(pathToHouseThree4);
- sleep(100 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int enterHouseThree() throws InterruptedException
- {
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("door is visible, interacting");
- door.interact("Open");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToQuestGuide() throws InterruptedException
- {
- NPC quester = npcs.closest("Quest Guide");
- camera.movePitch(gRandom(10,50));
- if(quester != null)
- {
- if(quester.isVisible())
- {
- quester.interact("Talk-to");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnQuests() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on emotes tab");
- interfaces.interactWithChild(548, 50, "Quest List");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goDownLadder() throws InterruptedException
- {
- localWalker.walk(new Position(3088,3120,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- RS2Object ladder = objects.closest("Ladder");
- if(ladder != null)
- {
- if(ladder.isVisible())
- {
- log("ladder is visible, interacting");
- ladder.interact("Climb-down");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToMiningInstructor() throws InterruptedException
- {
- localWalker.walkPath(pathToMiner);
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToMiningInstructor() throws InterruptedException
- {
- NPC miner = npcs.closest("Mining Instructor");
- if(miner != null)
- {
- if(miner.isVisible())
- {
- log("miner exists and is visible, interacting");
- miner.interact("Talk-to");
- antiban();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int prospectTin() throws InterruptedException
- {
- localWalker.walk(new Position(3078,9504,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- RS2Object tin = objects.closest(10080);
- if(tin != null)
- {
- if(tin.isVisible())
- {
- log("tin exists and is visible, prospecting");
- tin.interact("Prospect");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- sleep(2000);
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int prospectCopper() throws InterruptedException
- {
- RS2Object copper = objects.closest(10079);
- localWalker.walk(new Position(3082,9501,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- if(copper != null)
- {
- if(copper.isVisible())
- {
- log("copper exists and is visible, prospecting");
- camera.toEntity(copper);
- sleep(200 + random(100,250));
- copper.interact("Prospect");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- sleep(2000);
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int mineTin() throws InterruptedException
- {
- localWalker.walk(new Position(3078,9504,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- RS2Object tin = objects.closest(10080);
- if(tin != null)
- {
- if(tin.isVisible())
- {
- log("tin exists and is visible, mining");
- tin.interact("Mine");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- sleep(2000);
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int mineCopper() throws InterruptedException
- {
- RS2Object copper = objects.closest(10079);
- localWalker.walk(new Position(3082,9501,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- if(copper != null)
- {
- if(copper.isVisible())
- {
- log("copper exists and is visible, mining");
- camera.toEntity(copper);
- sleep(200 + random(100,250));
- copper.interact("Mine");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- sleep(2000);
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int smeltOre() throws InterruptedException
- {
- RS2Object furnace = objects.closest(10082);
- localWalker.walk(new Position(3079,9498,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- if(furnace != null)
- {
- if(furnace.isVisible())
- {
- log("furnace exists and is visible, interacting");
- clickOnBag();
- sleep(400 + random (100, 200));
- inventory.interact("Use", "Tin ore");
- sleep(400 + random (100, 200));
- furnace.interact("Use");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToMiner() throws InterruptedException
- {
- localWalker.walk(new Position(3079,9504,0));
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(300 + random (100, 200));
- }
- NPC miner = npcs.closest("Mining Instructor");
- if(miner != null)
- {
- if(miner.isVisible())
- {
- log("miner exists and is visible, interacting");
- miner.interact("Talk-to");
- mouse.moveVerySlightly();
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnAnvil() throws InterruptedException
- {
- localWalker.walk(new Position(3082,9499,0));
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- RS2Object anvil = objects.closest("Anvil");
- if(anvil != null)
- {
- if(anvil.isVisible())
- {
- inventory.interact("Use", "Bronze bar");
- sleep(400 + random (100, 200));
- anvil.interact("Use");
- mouse.moveSlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- inventory.interact("Use", "Bronze bar");
- return 200 + gRandom(200, 400.0D);
- }
- int smithDagger() throws InterruptedException
- {
- if(interfaces.get(312) != null)
- {
- log("smithing screen visible, go go");
- interfaces.interactWithChild(312, 2, "Smith 1");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToGateTwo() throws InterruptedException
- {
- localWalker.walk(new Position(3093,9503,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughGateTwo() throws InterruptedException
- {
- RS2Object gate = objects.closest("Gate");
- if(gate != null)
- {
- if(gate.isVisible())
- {
- gate.interact("Open");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToCombatInstructor() throws InterruptedException
- {
- camera.movePitch(gRandom(10,50));
- localWalker.walk(new Position(3104,9508,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- NPC combat = npcs.closest("Combat Instructor");
- if(combat != null)
- {
- if(combat.isVisible())
- {
- log("combat instructor exists and is visible, interacting");
- combat.interact("Talk-to");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnEquipment() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on equipment tab");
- interfaces.interactWithChild(548, 52, "Worn Equipment");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnStats() throws InterruptedException
- {
- if(interfaces.get(387) != null)
- {
- log("Clicking on equipment Stats");
- interfaces.interactWithChild(387, 17, "View Equipment Stats");
- sleep(100 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int equipDagger() throws InterruptedException
- {
- log("equipping dagger");
- inventory.interact("Equip", "Bronze dagger");
- sleep(400 + random(200,300));
- return 200 + gRandom(200, 400.0D);
- }
- int closeStats() throws InterruptedException
- {
- if(interfaces.get(84) != null)
- {
- log("Clicking on X, on equipment Stats");
- interfaces.interactWithChild(84, 4, "close");
- sleep(100 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int removeDagger() throws InterruptedException
- {
- if(equipment.isWieldingWeapon("Bronze dagger"))
- {
- log("taking off dagger");
- equipment.unequip(EquipmentSlot.WEAPON, "Bronze dagger");
- sleep(100 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int equipSwordAndShield() throws InterruptedException
- {
- log("Equipping sword");
- inventory.interact("Wield", "Bronze sword");
- sleep(400 + random(200,300));
- log("Equipping shield");
- inventory.interact("Wield", "Wooden shield");
- sleep(100 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnCombat() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on combat options.");
- interfaces.interactWithChild(548, 48, "Combat Options");
- sleep(100 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughGateThree() throws InterruptedException
- {
- localWalker.walk(new Position(3111,9518,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- RS2Object gate = objects.closest("Gate");
- if(gate != null)
- {
- if(gate.isVisible())
- {
- log("gate is visible, interacting");
- gate.interact("Open");
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int killRat() throws InterruptedException
- {
- NPC rat = npcs.closest("Giant rat");
- if(rat != null)
- {
- if(rat.isVisible() && rat.isAttackable())
- {
- if(!myPlayer().isUnderAttack())
- {
- log("rat is visible and not under attack, kill!");
- rat.interact("Attack");
- mouse.moveSlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating() || myPlayer().isUnderAttack())
- {
- sleep(400 + random(200,400));
- }
- }
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goBackThroughGateThree() throws InterruptedException
- {
- RS2Object gate = objects.closest("Gate");
- if(gate != null)
- {
- if(gate.isVisible())
- {
- log("gate is visible, interacting");
- gate.interact("Open");
- sleep(800 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- localWalker.walk(new Position(3106,9508,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- talkToCombatInstructor();
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int equipRangeGear() throws InterruptedException
- {
- clickOnBag();
- sleep(608);
- log("Equipping bow");
- inventory.interact("Wield", "Shortbow");
- sleep(800 + random(200,300));
- log("Equipping arrows");
- inventory.interact("Wield", "Bronze arrow");
- sleep(400 + random (100, 200));
- localWalker.walk(new Position(3108,9512,0));
- return 200 + gRandom(200, 400.0D);
- }
- int rangeRat() throws InterruptedException
- {
- NPC rat = npcs.closest("Giant rat");
- if(rat != null)
- {
- if(rat.isVisible() && rat.isAttackable())
- {
- if(!rat.isInteracting(myPlayer()))
- {
- log("rat is visible and not under attack, kill!");
- camera.toEntity(rat);
- rat.interact("Attack");
- antiban();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating() || myPlayer().isUnderAttack())
- {
- sleep(400 + random(200,400));
- }
- }
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToLadder() throws InterruptedException
- {
- localWalker.walkPath(pathToLadder);
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int climbUpLadder() throws InterruptedException
- {
- RS2Object ladder = objects.closest("Ladder");
- if(ladder != null)
- {
- if(ladder.isVisible())
- {
- log("ladder is visible, interacting");
- ladder.interact("Climb-up");
- mouse.moveVerySlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToBank() throws InterruptedException
- {
- localWalker.walkPath(pathToBank);
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int openBank() throws InterruptedException
- {
- RS2Object bankbooth = objects.closest(new String[] { "Bank booth" });
- if (bankbooth != null)
- {
- if (bankbooth.isVisible())
- {
- bankbooth.interact("Use");
- sleep(random(400, 700));
- }
- else
- {
- camera.toEntity(bankbooth);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int closeBank() throws InterruptedException
- {
- log("closing the bank.");
- Rectangle Rectangle1 = new Rectangle(479,14, 10, 10);
- mouse.click(new RectangleDestination(bot, Rectangle1), false);
- sleep(400 + random(200,400));
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnPoll() throws InterruptedException
- {
- camera.movePitch(gRandom(10,50));
- localWalker.walk(new Position(3120,3121,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(400 + random(200,400));
- }
- RS2Object poll = objects.closest("Poll booth");
- if(poll != null)
- {
- if(poll.isVisible())
- {
- log("poll is visible, interacting");
- poll.interact("Use");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int closePoll() throws InterruptedException
- {
- log("closing the poll window.");
- Rectangle Rectangle1 = new Rectangle(482,17, 10, 10);
- mouse.click(new RectangleDestination(bot, Rectangle1), false);
- sleep(400 + random(200,400));
- log("Go through next door.");
- localWalker.walk(new Position(3124,3124,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- if(door.getPosition().getX() == 3125)
- {
- log("opening door to advisor");
- door.interact("Open");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToFinancialAdvisor() throws InterruptedException
- {
- camera.movePitch(gRandom(10,50));
- NPC cash = npcs.closest("Financial Advisor");
- if(cash != null)
- {
- if(cash.isVisible())
- {
- log("talking to cash guy.");
- cash.interact("Talk-to");
- mouse.moveSlightly();
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughDoorThree() throws InterruptedException
- {
- localWalker.walk(new Position(3129,3124,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("opening door to leave advisor room.");
- door.interact("Open");
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToChurch() throws InterruptedException
- {
- localWalker.walkPath(pathToPriest);
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- RS2Object open = objects.closest(7112);
- RS2Object closed = objects.closest(7111);
- if(open != null)
- {
- if(open.isVisible())
- {
- log("door is open, walking to priest");
- localWalker.walk(new Position(3124,3106,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- if(closed != null)
- {
- if(closed.isVisible())
- {
- log("doors closed, opening and walking to priest");
- closed.interact("Open");
- sleep(400 + random (100, 200));
- localWalker.walk(new Position(3124,3106,0));
- sleep(400 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToBrother() throws InterruptedException
- {
- NPC bro = npcs.closest("Brother Brace");
- if(bro != null)
- {
- if(bro.isVisible())
- {
- log("talking to priest.");
- bro.interact("Talk-to");
- mouse.moveVerySlightly();
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnPray() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on pray list");
- interfaces.interactWithChild(548, 53, "Prayer");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnFriends() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on friends list");
- interfaces.interactWithChild(548, 32, "Friends List");
- mouse.moveVerySlightly();
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnIgnore() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on ignore list");
- interfaces.interactWithChild(548, 33, "Ignore List");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int goThroughDoorFour() throws InterruptedException
- {
- localWalker.walk(new Position(3122,3103,0));
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- RS2Object door = objects.closest("Door");
- if(door != null)
- {
- if(door.isVisible())
- {
- log("opening door to leave church.");
- door.interact("Open");
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int walkToMage() throws InterruptedException
- {
- localWalker.walkPath(pathToMage);
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int talkToMage() throws InterruptedException
- {
- NPC mage = npcs.closest("Magic Instructor");
- if(mage != null)
- {
- if(mage.isVisible())
- {
- log("talking to magic instructor.");
- mage.interact("Talk-to");
- sleep(200 + random (100, 200));
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- }
- return 200 + gRandom(200, 400.0D);
- }
- int clickOnMagic() throws InterruptedException
- {
- if(interfaces.get(548) != null)
- {
- log("Clicking on pray list");
- interfaces.interactWithChild(548, 54, "Magic");
- mouse.moveSlightly();
- sleep(200 + random (100, 200));
- return 200 + gRandom(200, 400.0D);
- }
- return 200 + gRandom(200, 400.0D);
- }
- int castAtChicken() throws InterruptedException
- {
- NPC chicken = npcs.closest("Chicken");
- localWalker.walk(new Position(3140,3091,0));
- sleep(400 + random (100, 200));
- clickOnMagic();
- while(myPlayer().isMoving() || myPlayer().isAnimating())
- {
- sleep(200 + random(100,200));
- }
- if(interfaces.get(192) != null)
- {
- log("casting on chicken!");
- interfaces.interactWithChild(218, 2, "Cast");
- sleep(100 + gRandom(800, 300.0D));
- chicken.interact("Cast");
- antiban();
- sleep(400 + random (100, 200));
- }
- return 200 + gRandom(200, 400.0D);
- }
- int stopScript() throws InterruptedException
- {
- log("Tutorial Island completed!");
- log("Thanks for using a Pug script!");
- stop();
- stop();
- return 100;
- }
- public void onPaint(Graphics2D g)
- {
- Graphics2D gr = g;
- timeRan = System.currentTimeMillis() - this.timeBegan;
- g.drawString("Time Taken So Far: " + ft(timeRan), 187, 290); // total time runnning
- }
- private String ft(long duration)
- {
- String res = "";
- long days = TimeUnit.MILLISECONDS.toDays(duration);
- long hours = TimeUnit.MILLISECONDS.toHours(duration)
- - TimeUnit.DAYS.toHours(TimeUnit.MILLISECONDS.toDays(duration));
- long minutes = TimeUnit.MILLISECONDS.toMinutes(duration)
- - TimeUnit.HOURS.toMinutes(TimeUnit.MILLISECONDS
- .toHours(duration));
- long seconds = TimeUnit.MILLISECONDS.toSeconds(duration)
- - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS
- .toMinutes(duration));
- if (days == 0) {
- res = (hours + ":" + minutes + ":" + seconds);
- } else {
- res = (days + ":" + hours + ":" + minutes + ":" + seconds);
- }
- return res;
- }
- public void antiban() throws InterruptedException
- {
- int b = random(2, 23);
- switch (b) {
- case 1:
- if (random(0, 13) == 4) {
- mouse.moveSlightly();
- sleep(random(600, random(1200, 2000)));
- mouse.moveRandomly();
- }
- break;
- case 2:
- if (random(1, 6) == 2) {
- camera.movePitch(random(30, 70));
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 3:
- if (random(0, 18) == 5) {
- mouse.moveOutsideScreen();
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 4:
- if (random(0, 19) == 13) {
- camera.moveYaw(random(134, 280));
- sleep(random(600, random(1200, 2000)));
- }
- break;
- case 5:
- if (random(0, 21) == 7) {
- mouse.moveSlightly();
- sleep(random(100, random(201, 275)));
- }
- case 6:
- if (random(0, 21) == 8) {
- mouse.moveVerySlightly();
- sleep(random(100, random(201, 275)));
- mouse.moveRandomly(random(30, 70));
- }
- case 7:
- if (random(0, 21) == 9) {
- mouse.moveRandomly();
- sleep(random(100, random(201, 275)));
- mouse.moveRandomly(random(30, 70));
- }
- default:
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement