Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.scripts;
- import java.awt.*;
- import com.kbot2.scriptable.Script;
- import com.kbot2.scriptable.methods.wrappers.*;
- import com.kbot2.scriptable.methods.data.*;
- import com.kbot2.scriptable.methods.Calculations;
- public class Planks extends Script {
- /*Path*/
- Rectangle plankTiles = new Rectangle(3209, 3666, 37, 34);
- Tile[] fromBanktoPlanks = new Tile[] {new Tile(3187,3692), new Tile(3190,3682), new Tile(3190,3672), new Tile(3196,3670), new Tile(3203,3673), new Tile(3206,3681), new Tile(3211,3681)};
- Tile[] fromPlankstoBank = walking.reversePath(fromBanktoPlanks);
- /*Define*/
- NPC b;
- GroundItem PLANK;
- Tile PLANK_TILE;
- Point Point_c;
- Tile myLocat;
- /*ID's*/
- int PLANK_ID = 454;
- int BANK_ID = 3217;
- int status = 0;
- int LOW_HEALTH = 21;
- int FOOD_ID = 333;
- public void eatFood() {
- if (inventory.contains(FOOD_ID)) {
- gameScreen.openTab(gameScreen.TAB_INVENTORY);
- inventory.atItem("Eat", FOOD_ID);
- }
- }
- @Override
- public boolean active() {
- return true;
- }
- public String getName() {
- return "Planks";
- }
- @Override
- public String getAuthor() {
- return "SuperTaranta";
- }
- @Override
- public String getDescription() {
- return "Planks";
- }
- @Override
- public boolean onStart() {
- log("Starting SuperTaranta's GayClub");
- return true;
- }
- public int loop() {
- if (!isLoggedIn()) {
- return random(1000, 1100);
- }
- camera.setAltitude(true);
- if(walking.getEnergy() > 30)
- walking.setRunning(true);
- switch (status) {
- case 0:
- if (inventory.isFull()) {
- sleep(500);
- status = 3;
- } else {
- status = 1;
- sleep(500);
- }
- return random(300, 500);
- case 1:
- // From Bank To Planks
- log("Walking from Bank to Planks");
- walking.walkPath(fromBanktoPlanks);
- while(getMyPlayer().isMoving())
- sleep(3000);
- status = 2;
- return random(150, 300);
- case 2:
- // Around Planks
- PLANK = groundItems.getClosestItem(20, PLANK_ID);
- if (PLANK != null) {
- PLANK_TILE = PLANK.getLocation();
- myLocat = getMyPlayer().getLocation();
- Point_c = new Point(myLocat.getX(), myLocat.getY());
- log("Around Planks");
- if (!getCalculations().onScreen(getCalculations().tileToScreen(PLANK.getLocation()))) {
- walking.walkToMM(PLANK_TILE);
- }
- if (getCalculations().onScreen(getCalculations().tileToScreen(PLANK.getLocation()))) {
- PLANK.doAction("Take");
- } else { plankTiles.contains(Point_c);
- }
- }
- if(inventory.getCount() == 28)
- status = 3;
- return random(150, 300);
- case 3:
- // From Planks to Bank
- log("Walking from Planks to Bank");
- if(inventory.isFull()){
- walking.walkPath(fromPlankstoBank);
- while(getMyPlayer().isMoving())
- sleep(3000);
- status = 4;
- } else {
- status = 2;
- return random(150, 300);
- }
- case 4:
- //Banking
- b = npcs.getClosest(20, BANK_ID);
- log("Checking/Opening Bank");
- while (!bank.isOpen()) {
- if (b != null)
- b.doAction("Bank");
- sleep(750, 1000);
- }
- status = 5;
- return random(150, 300);
- case 5:
- // Banking
- log("Banking");
- if (!bank.isOpen()) {
- status = 4;
- return 100;
- }
- while (inventory.getCount() > 1) {
- bank.depositAll(960);
- }
- if (skills.getLevel(Skills.SKILL_HITPOINTS) == LOW_HEALTH){
- bank.withdrawItem(FOOD_ID, 1);
- sleep(500);
- eatFood();
- }
- status = 0;
- return random(150, 300);
- }
- return random(100, 300);
- }
- }
Add Comment
Please, Sign In to add comment