Jah 68, typo :?
MonkFisher [Piscatories]
import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
import java.util.ArrayList;
import java.awt.Point;
import java.util.List;
import com.speljohan.rsbot.event.events.*;
import com.speljohan.rsbot.event.listeners.*;
import com.speljohan.rsbot.event.listeners.PaintListener;
import com.speljohan.rsbot.accessors.*;
import com.speljohan.rsbot.account.*;
import com.speljohan.rsbot.bot.*;
import com.speljohan.rsbot.script.wrappers.*;
import com.speljohan.rsbot.script.*;
import com.speljohan.rsbot.event.listeners.ServerMessageListener;
import com.speljohan.rsbot.event.events.ServerMessageEvent;
public class MonkFisher extends Script implements PaintListener, ServerMessageListener { //Names the script
int runAt = random(20, 100);
public long startTime = System.currentTimeMillis();
int Fishgotten;
int loads;
private int startLvl = 0;
private int startExp = 0;
RSTile[] BankPath= {
new RSTile(2335, 3696), new RSTile(2329, 3689)};
RSTile[] BackPath= {
new RSTile(2337, 3698)};
public String getAuthor( ) { //Sets the Authors name
return "Hellfish";
}
public String getName( ) { //Sets the Scripts name
return "MonkFisher";
}
public double getVersion( ) { //Sets the Version number of the script
return 1.0;
}
public String getScriptCategory() { //Sets the category that the script fit's into
return "Hellfish/Fishing";
}
public String getScriptDescription( ) { //Shows a description of the script inside the script dump area
String html="";
html += "";
html += "Description";
html += "";
html += "";
return html;
}
public boolean onStart( Map args ) { //Loads any commands needed when the script is started
setCameraAltitude(false);
Bot.getEventManager().addListener(PaintListener.class, this);
return true;
}
public void onFinish( ) { //Loads any commands to do when the script is ended
Bot.getEventManager().removeListener(PaintListener.class, this);
}
public void serverMessageRecieved(ServerMessageEvent e) {
if (e.getMessage().contains("You catch")) {
Fishgotten++;
}
}
public void onRepaint(Graphics g) {
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;
if(startExp == 0) {
startExp = skills.getCurrentSkillExp(10);
}
if(startLvl == 0) {
startLvl = skills.getCurrentSkillLevel(10);
}
g.setColor(Color.green);
g.setColor(Color.YELLOW);
g.drawString("Hellfish's MonkFisher v1.0", 320, 260);
g.setColor(Color.RED);
g.drawString("run: " + hours + " hrs " + minutes + " min ", 320, 275 );
g.drawString("Catches: " + Fishgotten, 320, 290);
g.drawString("Loads: " + loads, 320, 305);
g.drawString("Levels Gained: " + (skills.getCurrentSkillLevel(10) - startLvl) , 50, 260);
g.drawString("Experience Earned: " + (skills.getCurrentSkillExp(10) - startExp) , 50, 275);
g.drawString("Current Level: " + skills.getCurrentSkillLevel(10) , 50, 290);
g.drawString("Exp to next level: " + skills.getXPToNextLevel(10) , 50, 305);
}
public int loop( ) { //This is the area of the script where you code out the things you want the bot to do
if (getEnergy() >= runAt && !isRunning()) {
setRun(true);
runAt = random(20, 100);
return random(10, 50);
}
//-------BANKING PART-------
if (RSInterface.getInterface( INTERFACE_BANK ).isValid()) {
atInventoryItem(7944, "Deposit-All");
wait(300);
atInventoryItem(7944, "Deposit-All");
loads++;
}
if(!isInventoryFull() && atBank()) {
setCameraAltitude(false);
walkPathMM(randomizePath(BackPath,2,2),14);
wait(100);
}
RSNPC Bank = getNearestNPCByID(3824);
if(isInventoryFull()) {
walkPathMM(randomizePath(BankPath,2,2),14);
wait(100);
if(Bank != null && distanceTo(Bank.getLocation())
clickNPC(Bank, "Bank");
wait(2000);
}
}
//-------BANKING PART-------
//-------FISHING PART-------
RSNPC Spot = getNearestNPCByID(3848);
if(getMyPlayer( ).getAnimation( ) == -1) {
if(Spot != null && !isInventoryFull()) {
clickNPC(Spot, "Net");
wait(2000);
}
}
//-------FISHING PART-------
return random(100,150);
}
public boolean atBank( ) {
return distanceTo(new RSTile(2330, 3689)) }
private RSNPC getNearestNextNPCByID(int... ids) {
int Dist = 20;
RSNPC closest = null;
int[] validNPCs = Bot.getClient().getNPCIndexArray();
NPC[] npcs = Bot.getClient().getNPCArray();
for (int element : validNPCs) {
if (npcs[element] == null) {
continue;
}
RSNPC Monster = new RSNPC(npcs[element]);
try {
for (int id : ids) {
if (id != Monster.getID() || Monster.isInCombat() || Monster.getInteracting() != null) {
continue;
}
int distance = getRealDistanceTo(Monster.getLocation(), false);
if (distance Dist = distance;
closest = Monster;
}
}
} catch (Exception e) {}
}
return closest;
}
private boolean clickNPC(RSNPC npc, String action) {
if (npc == null) {
return false;
}
RSTile tile = npc.getLocation();
if (!tile.isValid()) {
return false;
}
try {
Point screenLoc = npc.getScreenLocation();
if (distanceTo(tile) > 6 || !pointOnScreen(screenLoc)) {
turnToTile(tile);
}
if (distanceTo(tile) > 20) {
walkTileMM(tile);
return false;
}
for (int i = 0; i screenLoc = npc.getScreenLocation();
if (!npc.isValid() || !pointOnScreen(screenLoc)) {
return false;
}
moveMouse(screenLoc, 5, 5);
if (getMenuItems().get(0).toLowerCase().contains(npc.getName().toLowerCase())) {
break;
}
if (getMouseLocation().equals(screenLoc)) {
break;
}
}
List menuItems = getMenuItems();
if (menuItems.isEmpty()) {
return false;
}
for (int a = 0; a if (menuItems.get(a).toLowerCase().contains(npc.getName().toLowerCase())) {
if (menuItems.get(0).toLowerCase().contains(action.toLowerCase())) {
clickMouse(true);
return true;
} else {
clickMouse(false);
return atMenu(action);
}
}
}
} catch (Exception e) {
System.out.print("clickNPC(RSNPC, String) error: " + e);
return false;
}
return false;
}
}
MonkFisher.java
ProFisher2 script (peaks olema botiga kaasas), sisaldab ka monkfish.
Nagu näha eilsel pildil poseerib 17m. Väike uuendus.