hi this is my first script i have ever made but has no errors. Please try it out and comment thanks
CODE
CODE
- Code:
import bot.*;
import java.awt.*;
public class Drayprofish extends Methods {
long startTime;
int fishLured, fails;
public DrayprofishClient mc) {super(mc);}
public void main(String args[]) {
startTime = System.currentTimeMillis();
printMessage("@or2@System: @cya@Fisher has started!");
printMessage("@or2@System: @cya@Script developed by zain");
while(running()) {
try {
while(inventoryCount() < 30) {
int[] pool = getObjectIndex(193);
if(pool[0] != -1 && !sleeping() && fatigue() != 100L) {
useObject(pool[1], pool[2]);
wait(random(1500, 2500));
}
wait(50);
}
// toBank
int x = random(225, 230);
int y = random(655, 660);
while(!imAt(x, y)) {
walkTo(x, y);
wait(random(1500, 2500));
}
x = random(223, 227);
y = random(639, 645);
while(!imAt(x, y)) {
walkTo(x, y);
wait(random(1500, 2500));
}
//bank
while(!questionMenu()) {
talkToNPC(getNPCIndex(95)[0]);
wait(random(1500, 2500));
}
answerQuestion(0);
while(!inBank())
wait(1000);
depositAll(349);
wait(random(500, 1500));
if(mc.method58(351) > 0)
depositAll(351);
wait(500);
closeBank();
//fishWalk
x = random(225, 230);
y = random(665, 660);
while(!imAt(x, y)) {
walkTo(x, y);
wait(random(1500, 2500));
}
x = random(226, 229);
y = random(663, 666);
while(!imAt(x, y)) {
walkTo(x, y);
wait(random(1500, 2500));
}
}
catch(Exception e) {}
}
}
public void onStop() {
handleCommand("status");
printMessage("@or2@Fisher: @yel@stopped");
}
public boolean onServerMessage(String s) {
s = s.toLowerCase();
if(s.contains("you catch a")) {
fishLured ++;
return true;
}
else if(s.contains("you attempt to catch some"))
return true;
else if(s.contains("you fail to catch anything")) {
fails ++;
return true;
}
return false;
}
public void handleCommand(String s) {
int index = s.indexOf(" ");
String cmd = s;
String args[] = new String[0];
if(index != -1) {
cmd = s.substring(0, index).trim();
args = s.substring(index + 1).trim().split(" ");
}
if(cmd.equals("status")) {
printMessage("@or2@Fisher: @yel@been running for: @or2@" + timeSince(startTime) + " @yel@fish lured: @or2@" + fishLured + " @yel@fails: @or2@" + fails);
}
}
}