//Script made by Beaker of Powerbot.org
import org.rsbot.script.ScriptManifest;
import org.rsbot.script.Script;
import java.awt.*;
import javax.imageio.ImageIO;
import java.io.IOException;
import java.net.URL;
import org.rsbot.event.listeners.PaintListener;
import org.rsbot.script.methods.Mouse;
import org.rsbot.script.methods.Skills;
import org.rsbot.script.wrappers.RSNPC;
@ScriptManifest(authors = "Beaker", keywords = "Fisher", name = "PowerFisher", version =
1.4, description = "Fishes Trout/Salmon at Barbarian Village, drops, repeats.")
public class PowerFisher extends Script implements PaintListener{
int PoleID = 309;
int[] FishID = {331, 335};
int[] FishSpot = {328, 329};
int FeatherID = 314;
public long startTime = System.currentTimeMillis();
private String status = "";
public int startexp;
int XPhour;
int startLevel;
private Image getImage(String url) {
try {
return ImageIO.read(new URL(url));
} catch(IOException e) {
return null;
}
}
private final Image img1 =
getImage("http://img440.imageshack.us/img440/3803/betterw.jpg");
public void onRepaint(Graphics g1) {
int EXPtill = skills.getExpToNextLevel(Skills.FISHING);
int currentLevel = skills.getCurrentLevel(Skills.FISHING);
int levelsGained = currentLevel - startLevel;
int xpGained = 0;
if ( startexp == 0) {
startexp = skills.getCurrentExp(Skills.FISHING);
}
xpGained = skills.getCurrentExp(Skills.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);
Graphics2D g = (Graphics2D)g1;
g.drawImage(img1, 2, 338, null);
g.setColor(Color.red);
g.drawString("Run Time : " + hours + ":" + minutes + ":" + seconds , 16, 414);
g.drawString("XP Gained : " +xpGained , 16, 424);
g.drawString("Levels Gained : " +levelsGained , 16, 434);
g.drawString("XP Until Level : " +EXPtill , 16, 444);
g.drawString("XP Per Hour : " +XPhour , 16, 454);
g.drawString("Status : " +status , 195, 454);
float xpsec = 0;
if ((minutes > 0 || hours > 0 || seconds > 0) && xpsec > 0) {
xpsec = ((float) xpsec)/(float)(seconds + (minutes*60) + (hours*60*60));
}
float xpmin = xpsec * 60;
float XPhour = xpmin * 60;
}
public boolean onStart(){
mouse.setSpeed(7);
log("PowerFisher by Beaker has Successfully Started");
startLevel = skills.getCurrentLevel(Skills.getIndex("fishing"));
startexp = skills.getCurrentExp(Skills.getIndex("fishing"));
return true;
}
public void antiBan() {
int b = random(0, 10);
switch (b) {
case 1: //Checking Fishing XP
if (random(0,4) == 4) {
status = ("Checking Fishing XP");
game.openTab(1);
skills.doHover(Skills.INTERFACE_FISHING);
sleep(random(3000, 4000));
}
break;
case 2: //Mouse off Screen
if (random(0,4) == 3) {
status = ("Moving Mouse Off Screen");
mouse.moveOffScreen();
sleep(random(2000, 5500));
}
break;
case 3: //Move Mouse
if (random(0,4) == 2) {
status = ("Moving Mouse");
mouse.moveSlightly();
sleep(300, 700);
mouse.moveRandomly(40, 860);
}
break;
case 4: //Turn Screen
if (random(0, 4) == 1) {
status = ("Rotating Screen");
camera.setAngle(random(100, 359));
sleep(500,1500);
}
break;
default:
break;
}
}
public void Fish() {
status = ("Fishing");
if(getMyPlayer().getAnimation() == -1){
RSNPC Spot = npcs.getNearest(FishSpot);
if (Spot.doAction("Lure")) {
Spot.doAction("Lure");
sleep(random(150, 1000));
}
return;
}
}
public int loop(){
antiBan();
Fish();
if(inventory.isFull()){
status = ("Dropping Fish");
inventory.dropAllExcept(PoleID, FeatherID);
inventory.dropAllExcept(PoleID, FeatherID);
random(100, 110);
}
return 1000;
}
public void onFinish(){
log("PowerFisher Terminated");
}
}