Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package scripts;
- import org.tribot.script.Script;
- import org.tribot.script.ScriptManifest;
- import org.tribot.api.input.Keyboard;
- import org.tribot.api.input.Mouse;
- import org.tribot.api2007.Banking;
- import org.tribot.api2007.Camera;
- import org.tribot.api2007.Constants;
- import org.tribot.api2007.GameTab;
- import org.tribot.api2007.GroundItems;
- import org.tribot.api2007.Inventory;
- import org.tribot.api2007.NPCs;
- import org.tribot.api2007.Player;
- import org.tribot.api2007.Walking;
- import org.tribot.api2007.Objects;
- import org.tribot.api2007.types.RSCharacter;
- import org.tribot.api2007.types.RSGroundItem;
- import org.tribot.api2007.types.RSNPC;
- import org.tribot.api2007.types.RSObject;
- import org.tribot.api2007.types.RSTile;
- @ScriptManifest(authors = { "SockMonster" }, category = "Tools", name = "S-Willows")
- public class S_Willows extends Script {
- public final int ENT = 1736;
- public final int CUTTING = 867;
- public final int TREE = 1307;
- public final int BANK = 25808;
- public final int LOGS = 1519;
- public final int NEST = 5073;
- public final int[] AXE = {1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739};
- private RSTile[] PATHTO = {
- new RSTile(2723, 3492, 0),
- new RSTile(2719, 3503, 0),
- new RSTile(2709, 3508, 0)};
- private RSTile[] PATHBACK = {
- new RSTile(2709, 3508, 0),
- new RSTile(2719, 3503, 0),
- new RSTile(2723, 3492, 0)};
- RSObject[] Bank = Objects.findNearest(10, BANK );
- RSObject[] Tree = Objects.findNearest(10, TREE );
- RSGroundItem[] Nests = GroundItems.find(new int[] { 5073, 5074 });
- RSNPC[] Ent = NPCs.findNearest(2, ENT);
- @Override
- public void run()
- {
- boolean infinite = true;
- Mouse.setSpeed(175);
- println("Thank you for using S-Willows, please start in Seers Village Bank :)");
- while (infinite)
- {
- // TODO Auto-generated method stub
- {
- if (Player.getRSPlayer().isInCombat()) {
- walktobank(); //Keep
- sleep(20000, 30000);
- }
- if (Player.getAnimation() != -1) {
- //Add antiban? //Keep - Add antiban
- nests();
- ent();
- sleep(400, 600);
- if (Player.isMoving()) {
- sleep(400, 600); //Keep?
- }
- if (Inventory.isFull()){
- walktobank(); //When inv full bank, keep.
- sleep(400, 600);
- }
- openbank();
- sleep(400, 600);
- }
- {
- if (!Tree[0].isOnScreen()) {
- walktotrees();
- sleep(400, 600);
- } else {
- chop();
- }}}
- }
- }
- public boolean checkForCombat() {
- RSCharacter me = Player.getRSPlayer();
- if (me.isInCombat()) {
- return true;
- }
- return false;
- }
- //Opening Invent
- public void invent(){
- if (GameTab.getOpen() != GameTab.TABS.INVENTORY) {
- GameTab.open(GameTab.TABS.INVENTORY);
- sleep(450, 550);}}
- //Walking to Trees
- public void walktotrees(){
- RSObject[] Tree = Objects.findNearest(10, TREE );
- if (!Inventory.isFull() && !Tree[0].isOnScreen() && Tree.length > 0);
- Keyboard.pressKey('\021');
- Walking.walkPath(PATHTO);
- Keyboard.releaseKey('\021');
- sleep(600,900);}
- //Cutting Tree
- public void chop(){
- if (!Inventory.isFull() && Tree.length > 0 && Player.getAnimation() != CUTTING){
- Camera.turnToTile(Tree[0].getPosition());
- Tree[0].click("Chop");
- sleep(800,1000);}}
- //Checking for Nests
- public void nests(){
- if (Nests.length > 0){
- Nests[0].click("Take");
- sleep(450, 700);}}
- //Checking for Ent
- public void ent(){
- if (Tree[0].isOnScreen() && Player.getAnimation() == CUTTING && Ent.length > 0){
- Camera.turnToTile(Tree[0].getPosition());
- Tree[0].click("Chop");
- sleep(800,1000);}}
- //Walking to Bank
- public void walktobank(){
- if (Inventory.isFull() && Bank.length == 0 && !Banking.isBankScreenOpen()){
- Keyboard.pressKey('\021');
- Walking.walkPath(PATHBACK);
- Keyboard.releaseKey('\021');
- sleep(600,900);}}
- //Opening Bank
- public void openbank(){
- if (Inventory.isFull() && Bank.length > 0 && !Banking.isBankScreenOpen()){
- Camera.turnToTile(Bank[0].getPosition());
- Bank[0].click("Bank");
- sleep(400,600);}}
- //Depositing Items
- public void depositeitem(){
- if (Banking.isBankScreenOpen()){
- Banking.depositAllExcept(Constants.IDs.Items.hatchets);
- sleep(500,900);}}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement