Hey guys, so I still haven't released my NMZ script but I got sidetracked creating a script for Hunter as I saw there are practically none on the SDN. Hopefully the developers will allow this one on the SDN as it only covers birds. Maybe in the future it could cover other hunter methods aswell but its a very simple script and I am just gonna go ahead and give it to you guys because I love you.....no, seriously.....I....I love you....say it back....SAY YOU FUC*ING LOVE ME BACK!
joking
anyways have fun and feel free to alter the script for better anti-ban or whatever because if a lot of people use it, they'll build a profile as its a pretty simple script.
TIP: Remember to start the script with your bird of choice nearby. The automatic detection simply works off what bird is detected near you.
Things this script can do:
Picking up fallen over traps
Setting traps
Detecting if you're trying to place a trap where there already is one
Checking traps
Dismantling failed attempts
Descriptive paint telling you your progress and if you're a good boy it occasionally tells you so.
Handles multiple traps (As many as your level allows)
Drops meats, keeps feathers, and buries all the bones (Feel free to alter this, it's in the first lines of the code, just change desired properties to true or false)
Automatically detects what birds are near to catch
Things this script can not do:
IMPORTANT: This script detects how many traps are laid out and can not be used while other people are in the world catching birds in the same area as you. I'll add a world hopper method soon but i gotta figure out how to make it detect if they're using bird snares because it's cool if they're trapping something else.
Intelligently place traps in patterns. It just lays them either randomly in the defined area, or right next to each other.
Provide adequate anti-ban....it's just randomized really, but doesn't interact with the client while waiting or any of that good stuff
Catch Larupias for you.....BIRDS ONLY. BIRDS.
Tell you how long it will take to get 99....well actually it COULD do that but it won't because you're being too needy.
Make you tons of money. They're birds, not birds made of solid gold.
Cleverly walk you to your preferred location. You gotta start the script NEAR the birds of choice.
Get you more matches on Tinder, believe me I tried.
Here's a small proggy for you....especially you, Tim..... ;)
Second proggy aswell.
Here's a copy of the .jar if anyone doesn't know how to create jars in Eclipse: https://www.mediafire.com/file/jwojxc7zlrn768r/TT Birds.jar
Can a more veteran person verify to others that the link is in fact just the script?
Here's the code for you more programming-savvy kids out there: (0 errors, make sure you've put the OSBot jar in your build path)
package pkg;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics2D;
import java.text.DecimalFormat;
import java.util.List;
import java.util.concurrent.TimeUnit;
import org.osbot.rs07.api.map.Area;
import org.osbot.rs07.api.map.Position;
import org.osbot.rs07.api.model.GroundItem;
import org.osbot.rs07.api.model.RS2Object;
import org.osbot.rs07.api.ui.Skill;
import org.osbot.rs07.script.Script;
import org.osbot.rs07.script.ScriptManifest;
@ScriptManifest(author = "Paradox", info = "TT Birds", name = "TT Birds", version = 1, logo = "")
public class Main extends Script {
public boolean DROP_BONES = false;//if false, will bury, if true, will drop
public boolean DROP_FEATHERS = false;
//WILL DROP MEAT NO MATTER WHAT BITCH
public boolean make_mommy_love_me = false;
public long timeStart;
public int startXP, startLvl;
public int caught, fails = 0;
public int timesClicked = 0;
public int lvl = 0;
boolean setup1, setup2, setup3, setup4, setup5 = false;
public int[] snareLocations = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
String[] birdSpecs = {"Copper longtail", "9379", "2308", "3595"};
public Area birdArea = new Area(2308 + 2, 3595 + 2, 2308 - 2, 3595 - 2);
public void onStart() {
startLvl = getSkills().getStatic(Skill.HUNTER);
startXP = getSkills().getExperience(Skill.HUNTER);
timeStart = System.currentTimeMillis();
getExperienceTracker().start(Skill.HUNTER);
lvl = getSkills().getStatic(Skill.HUNTER);
if (getNpcs().closest("Copper longtail") != null) {
birdSpecs[0] = "Copper longtail";
birdSpecs[1] = "9379";
birdSpecs[2] = "2308";
birdSpecs[3] = "3595";
}
if (getNpcs().closest("Tropical wagtail") != null) {
birdSpecs[0] = "Tropical wagtail";
birdSpecs[1] = "9348";
birdSpecs[2] = "2501";
birdSpecs[3] = "2891";
}
if (getNpcs().closest("Crimson swift") != null) {
birdSpecs[0] = "Crimson swift";
birdSpecs[1] = "9373";
birdSpecs[2] = "2610";
birdSpecs[3] = "2928";
}
if (getNpcs().closest("Cerulean twitch") != null) {
birdSpecs[0] = "Cerulean twitch";
birdSpecs[1] = "9375";
birdSpecs[2] = "2733";
birdSpecs[3] = "3769";
}
if (getNpcs().closest("Golden warbler") != null) {
birdSpecs[0] = "Golden warbler";
birdSpecs[1] = "9377";
birdSpecs[2] = "3406";
birdSpecs[3] = "3145";
}
birdArea = new Area((Integer.parseInt(birdSpecs[2]) + 2), (Integer.parseInt(birdSpecs[3]) + 2), (Integer.parseInt(birdSpecs[2]) - 2), (Integer.parseInt(birdSpecs[3]) - 2));
}
@Override
public int onLoop() throws InterruptedException {
try {
List<GroundItem> la = getGroundItems().getAll();
for (int i = 0; i < la.size(); i++) {
if (la.get(i).getName().contains("Bird snare")) {
GroundItem ab = la.get(i);
while (ab != null && ab.isVisible() && ab.exists()) {
whileID = 5;
la.get(i).interact("Take");
sleep(random(800, 1000));
}
}
}
} catch (NullPointerException e) {
log("Nullpointer in taking ground items");
}
try {
if (getObjects().closest(9344) != null) {
RS2Object snare = getObjects().closest(9344);
while (snare.exists() && snare.isVisible() && snare != null) {
whileID = 4;
getObjects().closest(9344).interact("Dismantle");
sleep(random(1400, 1700));
}
fails++;
//sleep(random(1500, 2100));
//layTrap();
}
} catch (NullPointerException e) {
log("Nullpointer in dismantling failed trap");
}
try {
if (getObjects().closest(Integer.parseInt(birdSpecs[1])) != null) {
RS2Object caughtSnare = getObjects().closest(Integer.parseInt(birdSpecs[1]));
if (caughtSnare != null) {
while (caughtSnare != null && caughtSnare.isVisible() && caughtSnare.exists()) {
whileID = 3;
caughtSnare.interact("Check");
sleep(random(900, 1400));
trapLayed = false;
}
caught++;
//sleep(random(1500, 2200));
//layTrap();
}
}
} catch (NullPointerException e) {
log("Nullpointer in Clicking caughtSnare");
}
try {
int trapCount = 0;
List<RS2Object> tl = getObjects().getAll();
for (int i = 0; i < tl.size(); i++) {
if (tl.get(i) != null) {
RS2Object dis = tl.get(i);
if (dis != null) {
if (dis.getName() != null) {
if (dis.getName().contains("Bird snare") && dis.isVisible() && dis.exists()) {
trapCount++;
}
}
}
}
}
if (trapCount < getMaxTraps()) {
trapLayed = false;
layTrap();
}
} catch (NullPointerException e) {
log("Nullpointer in checking snare count");
}
try {
if (getInventory().getAmount("Bones") > dropAt || getInventory().isFull() || getInventory().getEmptySlotCount() == 1) {
if (!DROP_BONES) {
while (getInventory().contains("Bones")) {
whileID = 2;
getInventory().getItem("Bones").interact("Bury");
sleep(random(700, 900));
}
} else {
getInventory().dropAll("Bones");
sleep(random(700, 900));
}
getInventory().dropAll("Raw bird meat");
if (DROP_FEATHERS) {
getInventory().dropAll("Stripy feather", "Blue feather", "Red feather", "Orange feather", "Yellow feather");
}
dropAt = (getInventory().getEmptySlotCount() / 2) - random(0, 4);
}
} catch (NullPointerException e) {
log("Nullpointer in getting rid of stuff");
}
return random(500, 800);
}
public int getMaxTraps() {
int lvl = getSkills().getStatic(Skill.HUNTER);
if (lvl < 20) {
return 1;
}
if (lvl >= 20 && lvl < 40) {
return 2;
}
if (lvl >= 40 && lvl < 60) {
return 3;
}
if (lvl >= 60 && lvl < 80) {
return 4;
}
return 5;
}
public int dropAt = random(2, 5);
List<Position> badPositions = null;
public boolean interrupted, trapLayed = false;
public void layTrap() throws InterruptedException {
if (!birdArea.contains(myPlayer())) {
getWalking().walk(birdArea.getRandomPosition());
}
RS2Object bs = getObjects().closest("Bird snare");
if (bs != null) {
while (bs.getPosition() == myPlayer().getPosition() || (myPlayer().getPosition().getX() == bs.getPosition().getX() && myPlayer().getPosition().getY() == bs.getPosition().getY())) {
whileID = 8;
moveRandomly();
}
}
try {
while (!trapLayed && !interrupted) {
whileID = 1;
if (birdArea.contains(myPlayer())) {
if (getInventory().contains("Bird snare")) {
int trps = (int)getInventory().getAmount("Bird snare");
//getWalking().walk(new Position(random(myPlayer().getX() - 4, myPlayer().getX() + 4), random(myPlayer().getY() - 4, myPlayer().getY() + 4), 0));
if (getInventory().getItem("Bird snare").interact("Lay")) {
timesClicked++;
sleep(random(400, 600));
if (timesClicked >= 1 && ((int)getInventory().getAmount("Bird snare") == trps)) {
moveRandomly();
}
trapLayed = true;
sleep(random(3000, 3400));
}
} else {
interrupted = true;
try {
List<GroundItem> la = getGroundItems().getAll();
for (int i = 0; i < la.size(); i++) {
if (la.get(i).getName().contains("Bird snare")) {
GroundItem ab = la.get(i);
while (ab != null && ab.isVisible() && ab.exists()) {
whileID = 5;
la.get(i).interact("Take");
sleep(random(800, 1000));
}
}
}
} catch (NullPointerException e) {
log("Nullpointer in taking ground items");
}
}
} else {
getWalking().walk(birdArea.getRandomPosition());
}
}
} catch (NullPointerException e) {
log("Nullpointer in laying trap");
}
}
public void moveRandomly() {
getWalking().walk(new Position(random(myPlayer().getX() - 4, myPlayer().getX() + 4), random(myPlayer().getY() - 4, myPlayer().getY() + 4), 0));
}
public boolean onBadPosition() {
boolean ison = false;
for (int i = 0; i < badPositions.size(); i++) {
if (myPlayer().getPosition() == badPositions.get(i)) {
ison = true;
}
}
return ison;
}
public int whileID = -1;
public void onPaint(Graphics2D g) {
int lvlsGained = getSkills().getStatic(Skill.HUNTER) - startLvl;
int xpGain = getSkills().getExperience(Skill.HUNTER) - startXP;
DecimalFormat df = new DecimalFormat("#,###");
int totalz = caught + fails;
long ttl = getExperienceTracker().getTimeToLevel(Skill.HUNTER);
double percent = 0;
if (totalz > 0) {
percent = (((float) caught) / totalz) * 100;
}
long millis = System.currentTimeMillis() - timeStart;
String ft = String.format("%d min, %d sec",
TimeUnit.MILLISECONDS.toMinutes(millis),
TimeUnit.MILLISECONDS.toSeconds(millis) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(millis))
);
String tolvl = String.format("%d min, %d sec",
TimeUnit.MILLISECONDS.toMinutes(ttl),
TimeUnit.MILLISECONDS.toSeconds(ttl) -
TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(ttl))
);
g.setFont(new Font("Trebuchet MS", Font.BOLD, 16));
g.setColor(Color.WHITE);
g.drawString("Catching " + birdSpecs[0] + "s", 10, 222);
g.setFont(new Font("Trebuchet MS", Font.PLAIN, 14));
g.drawString("Time running: " + ft + " (" + getExperienceTracker().getGainedXPPerHour(Skill.HUNTER) + " XP/hr)", 35, 240);
g.drawString("XP gained: " + df.format(xpGain) + " (" + tolvl + " to lvl)", 35, 255);
g.drawString("Current Level: " + getSkills().getStatic(Skill.HUNTER) + " (+" + lvlsGained + ")", 35, 270);
if (totalz <= 0) {
g.drawString("Caught: " + df.format(caught) + ", Failed: " + df.format(fails), 35, 285);
} else {
g.drawString("Caught: " + df.format(caught) + ", Failed: " + df.format(fails) + " (" + String.format("%2.02f", percent) + "%)", 35, 285);
}
g.drawString("x", getMouse().getPosition().x - 2, getMouse().getPosition().y + 4);
}
}