import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.util.Map;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.Constants;
import org.rsbot.script.Script;
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.wrappers.RSInterface;
import org.rsbot.script.wrappers.RSNPC;
import org.rsbot.script.wrappers.RSObject;
import org.rsbot.script.wrappers.RSTile;
//**Authors, Category, Name, Version**//
@ScriptManifest(authors = { "v3n0m96, Tnwrestler360" }, category = "Fishing", name = "VenzLobbs", version = 1.0, description =
"
" +
"" +
"")
public class VenzLobbs extends Script implements PaintListener{
//**Variables** //
RSNPC Fishing;
RSTile[] bankToFish = {new RSTile(2809, 3441), new RSTile(2814, 3437), new RSTile(2828, 3437), new RSTile(2836, 3435), new RSTile(2843, 3435)};
RSTile[] fishToBank = reversePath(bankToFish);
RSTile bankTile = new RSTile(2809, 3441);
RSTile fishTile = new RSTile(2842,3432);
public int bankBoothID = 2213;
public int speed = 10;
int sAdj;
public int fishAnimation = 619;
public int net = 303;
public int pot = 301;
public long startTime = System.currentTimeMillis();
public int startexp;
public int exp;
public int expGained;
public int energyToRunAt = random(40, 100);
//script manifest//
final ScriptManifest properties = getClass().getAnnotation(ScriptManifest.class);
//On-Start methods//
public boolean onStart( Map args ) {
log("//////////////");
log("///////////////");
log("////////////////");
log("/////////////////");
log("//////////////////");
log("///////////////////");
log("////////////////////");
log("/////////////////////");
log("//////////////////////");
log("///////////////////////");
log("////////////////////////");
log("///////////////////////");
log("//////////////////////");
log("/////////////////////");
log("////////////////////");
log("///////////////////");
log("//////////////////");
log("/////////////////");
log("////////////////");
log("///////////////");
log("//////////////");
log("VenzLobbs Initialized");
return true;
}
public void getMouseSpeed(final int speed) {
this.speed = speed;
getMouseSpeed();
}
//searching for mine//
public boolean Fish(){
if(getMyPlayer().getAnimation() == -1) {
RSNPC fishingSpot = getNearestNPCByID(321);
if(fishingSpot != null) {
if(tileOnScreen(fishingSpot.getLocation())) {
atTile(fishingSpot.getLocation(), "Cage");
wait(random(2000,2500));
}
if (!fishingSpot.isOnScreen() && !getMyPlayer().isMoving()) {
walkTileMM(fishingSpot.getLocation());
}
}
}
return true;
}
//need to bank//
public boolean walkToBank() {
if (distanceTo(bankTile) >= 3) {
if (distanceTo(getDestination()) < random(5, 12)
|| distanceTo(getDestination()) > 40) {
if (!walkPathMM(fishToBank)) {
walkToClosestTile(fishToBank);
}
}
}
return true;
}
private boolean openBank() {
final RSObject bank = getNearestObjectByID(bankBoothID);
if (bank == null) {
return false;
}
if (!tileOnScreen(bank.getLocation())) {
wait(random(50,100));
turnToTile(bank.getLocation(), 15);
}
return atTile(bank.getLocation(), "Use-quickly");
}
public boolean walkToFish() {
if (distanceTo(fishTile) >= 4) {
if (distanceTo(getDestination()) < random(5, 12)
|| distanceTo(getDestination()) > 40) {
if (!walkPathMM(bankToFish)) {
walkToClosestTile(bankToFish);
}
}
}
return true;
}
public void antiBan() {
getMouseSpeed(random(9 + sAdj, 12 + sAdj));
int random = random(1, 24);
switch (random) {
case 1:
if (random(1, 40) != 1)
break;
moveMouse(random(10, 750), random(10, 495));
break;
case 2:
if (random(1, 40) != 1)
break;
int angle = getCameraAngle() + random(-90, 90);
if (angle < 0) {
angle = random(0, 10);
}
if (angle > 359) {
angle = random(0, 10);
}
setCameraRotation(angle);
break;
case 3:
if (random(1, 3) != 1)
break;
moveMouseSlightly();
break;
default:
break;
}
getMouseSpeed(random(8 + sAdj, 11 + sAdj));
}
//The Loop//
public int loop() {
if(getMyPlayer().getAnimation() != -1){
antiBan();
}
if(getMyPlayer().getAnimation() == fishAnimation){
return random(500, 800);
}
if(isInventoryFull()){
walkToBank();
openBank();
if (RSInterface.getInterface(Constants.INTERFACE_BANK).isValid()) {
bank.depositAllExcept(pot);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(2000);
walkToFish();
wait(random(2000, 2500));
}
}else{
Fish();
}
return random(800, 1000);
}
public void onRepaint(Graphics g) {
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
if (isLoggedIn()) {
if ( startexp == 0) {
startexp = skills.getCurrentSkillExp(Constants.STAT_FISHING);
}
expGained = skills.getCurrentSkillExp(Constants.STAT_FISHING) - startexp;
long millis = System.currentTimeMillis() - startTime;
long hours = millis / (1000 * 60 * 60);
millis -= hours * (1000 * 60 * 60);
long minutes = millis / (1000 * 60);
millis -= minutes * (1000 * 60);
long seconds = millis / 1000;
long minutes2 = minutes + (hours * 60);
g.setColor(new Color(0, 0, 0, 70));
g.fillRect(549, 207, 186, 256);
g.setColor(new Color(47, 47, 89, 200));
g.setColor(Color.WHITE);
g.setFont(new Font("Palatino Linotype", Font.BOLD, 22));
g.drawString("VenzLobbs", 565, 237);
g.setFont(new Font("Palatino Linotype", Font.ITALIC, 13));
g.drawString("by v3n0m96+Tnwrestler360" , 635, 261);
g.setFont(new Font("Trajan Pro", Font.PLAIN, 16));
g.drawString("Time running:"+hours+":"+minutes+":"+seconds+"." , 566, 309);
g.drawString("EXP Gained:"+expGained , 566, 349);
g.setFont(new Font("Palatino Linotype", Font.PLAIN, 13));
g.setColor(Color.RED);
g.fill3DRect(566, 376, 150, 11, true);
g.setColor(Color.GREEN);
g.fill3DRect(566, 376, skills.getPercentToNextLevel(Constants.STAT_FISHING), 11, true);
g.setColor(Color.BLACK);
g.drawString(skills.getPercentToNextLevel(Constants.STAT_FISHING) + "% to " + (skills.getCurrentSkillLevel(Constants.STAT_FISHING) + 1), 586, 386);
}
}
}