Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import bot.script.BotScript;
- import bot.script.Manifest;
- import bot.script.methods.Skills;
- import bot.script.enums.Skill;
- import bot.script.enums.Tab;
- import bot.script.methods.Bank;
- import bot.script.methods.Game;
- import bot.script.methods.Inventory;
- import bot.script.methods.Players;
- import bot.script.methods.Walking;
- import bot.script.wrappers.NPC;
- import bot.script.wrappers.Tile;
- import bot.script.methods.Npcs;
- import java.awt.*;
- @Manifest(author = "Coordinates", name = "Al-Kharid Net Fishing", description = "Net fishes in Al-Kharid", version = 1.00)
- public class AlkharidNet extends BotScript {
- //XP and Levels
- int xpStart = 0;
- int lvlStart;
- int xpGained;
- int lvlCurrent;
- int fish = 0;
- //Stall and Tea
- int SHRIMP = 318;
- int ANCH = 322;
- int NET_SPOT = 316;
- //Tiles
- Tile BANK_BOOTH = new Tile(3269, 3164);
- Tile FISHING_SPOT = new Tile(3267, 3149);
- //Etc.
- long runtime;
- long startTime = 0;
- @Override
- public boolean onStart() {
- xpStart = Skills.getXp(Skill.FISHING);
- lvlStart = Skills.getLevel(Skill.FISHING);
- startTime = System.currentTimeMillis();
- if (!Inventory.contains(304)) {
- log("You must start with a fishing net in your inventory!");
- return false;
- }
- return true;
- }
- @Override
- public int loop() {
- if (Game.getEnergy() >= 45 && !Walking.isRunOn()) {
- if (Game.getTab() == Tab.CONTROLS) {
- Walking.setRun(true);
- } else {
- Game.openTab(Tab.CONTROLS);
- }
- }
- if (Inventory.isFull()) {
- if (BANK_BOOTH.distance() < 3) {
- bank();
- } else {
- if (!Players.getLocal().isMoving()) {
- Walking.walkTo(Walking.getClosestTileOnMap(BANK_BOOTH));
- sleep(750);
- }
- if (Players.getLocal().isMoving() && Walking.readyForNextFlag(BANK_BOOTH)) {
- Walking.walkTo(Walking.getClosestTileOnMap(BANK_BOOTH));
- sleep(750);
- }
- }
- }
- if (!Inventory.isFull()) {
- if (Players.getLocal().getAnimation() == 621) {
- return 1;
- }
- if (FISHING_SPOT.distance() < 3) {
- fish();
- } else {
- if (!Players.getLocal().isMoving()) {
- Walking.walkTo(Walking.getClosestTileOnMap(FISHING_SPOT));
- sleep(750);
- }
- if (Players.getLocal().isMoving() && Walking.readyForNextFlag(FISHING_SPOT)) {
- Walking.walkTo(Walking.getClosestTileOnMap(FISHING_SPOT));
- sleep(750);
- }
- }
- }
- if (BANK_BOOTH.distance() < 3 && Inventory.contains(SHRIMP) || BANK_BOOTH.distance() < 3 && Inventory.contains(ANCH)) {
- if (!Bank.isOpen()) {
- Bank.open();
- sleep(2000);
- } else {
- Bank.deposit(SHRIMP, Inventory.getCount(SHRIMP, false));
- Bank.deposit(ANCH, Inventory.getCount(ANCH, false));
- }
- }
- return 1;
- }
- @Override
- public void onFinish() {
- }
- private final Color color1 = new Color(0, 0, 255, 151);
- private final Color color2 = new Color(0, 0, 0);
- private final Color color3 = new Color(1, 1, 1);
- private final BasicStroke stroke1 = new BasicStroke(1);
- private final Font font1 = new Font("Arial", 0, 13);
- @Override
- public void paint(Graphics g1) {
- runtime = System.currentTimeMillis() - startTime;
- xpGained = (Skills.getXp(Skill.FISHING) - xpStart);
- lvlCurrent = (Skills.getLevel(Skill.FISHING));
- int lvlGain = (lvlCurrent - lvlStart);
- int xpHour = (int) ((double) xpGained / runtime * 3600000);
- int catchesHour = (int) ((double) fish / runtime * 3600000);
- Graphics2D g = (Graphics2D)g1;
- g.setColor(color1);
- g.fillRect(237, 258, 271, 69);
- g.setColor(color2);
- g.setStroke(stroke1);
- g.drawRect(237, 258, 271, 69);
- g.setFont(font1);
- g.setColor(color3);
- g.drawString("Al-Kharid Net by Coordinates", 241, 271);
- g.setColor(color2);
- g.drawLine(237, 273, 508, 273);
- g.setColor(color3);
- g.drawString("Catches: " + fish, 241, 291);
- g.drawString("XP Gained: " + xpGained, 241, 308);
- g.drawString("Current Level: " + lvlCurrent + "(+" + lvlGain + ")", 241, 323);
- g.drawString("XP/Hour: " + xpHour, 374, 308);
- g.drawString("Catches/HR: " + catchesHour, 374, 291);
- g.drawString("Run time:" + timeToString((int) runtime), 374, 323);
- g.drawString("Version 1.00", 435, 271);
- }
- public void bank() {
- if (!Bank.isOpen()) {
- Bank.open();
- sleep(2000);
- } else {
- fish += Inventory.getCount(SHRIMP, false);
- fish += Inventory.getCount(ANCH, false);
- Bank.deposit(SHRIMP, Inventory.getCount(SHRIMP, false));
- Bank.deposit(ANCH, Inventory.getCount(ANCH, false));
- }
- }
- public void fish() {
- NPC FISH_SPOT = Npcs.getNearest(NET_SPOT);
- if (FISH_SPOT == null) {
- return;
- }
- if (Players.getLocal().getAnimation() == -1) {
- FISH_SPOT.interact("Net");
- sleep(2000);
- } else {
- sleep(500);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement