- import java.awt.*;
- import java.awt.event.*;
- import com.speljohan.rsbot.plugin.*;
- import com.speljohan.rsbot.script.*;
- import com.speljohan.rsbot.bot.*;
- import com.speljohan.rsbot.script.wrappers.*;
- import com.speljohan.rsbot.event.listeners.*;
- import com.speljohan.rsbot.event.events.*;
- import com.speljohan.rsbot.accessors.*;
- //Importing all the Script functions and Wrappers (Objects, NPC's, Characters)
- public class ChatResponderModded extends Random {
- public int dyingAnimation = 836;
- String reply="NO REPLY";
- String textSent;
- String[] oldQ = {""};
- long nextTalk = System.currentTimeMillis()+random(160000,170000*random(2,4));
- long lastCheck = -1;//lets make it do a check at the start
- String[] attackNames = {"Attack", "attack", "ATT", "Att", "att"};
- String[] defenseNames = {"Defence", "defence", "Defense", "defense", "DEF", "Def", "def"};
- String[] strengthNames = {"Strength", "strength", "STR", "Str", "str"};
- String[] hitpointsNames = {"Hitpoints", "hitpoints", "HP", "Hp", "hp", "Hits", "hits"};
- String[] rangeNames = {"Range", "range", "Ranged", "ranged"};
- String[] prayerNames = {"Prayer", "prayer", "Pray", "pray"};
- String[] magicNames = {"Magic", "magic", "Mage", "mage"};
- String[] cookingNames = {"Cooking", "cooking", "Cook", "cook"};
- String[] woodcuttingNames = {"Woodcutting", "woodcutting", "WC", "Wc", "wc"};
- String[] fletchingNames = {"Fletching", "fletching", "Fletch", "fletch"};
- String[] fishingNames = {"Fishing", "fishing", "Fish", "fish"};
- String[] firemakingNames = {"Firemaking", "firemaking", "Firemake", "firemake", "FM", "Fm", "fm"};
- String[] craftingNames = {"Crafting", "crafting", "Craft", "craft"};
- String[] smithingNames = {"Smithing", "smithing", "Smith", "smith"};
- String[] miningNames = {"Mining", "mining", "Mine", "mine"};
- String[] herbloreNames = {"Herblore", "herblore", "Herb", "herb"};
- String[] agilityNames = {"Agility", "agility", "Agil", "agil"};
- String[] thievingNames = {"Thieving", "thieving", "Theif", "thief"};
- String[] slayerNames = {"Slayer", "slayer", "Slay", "slay"};
- String[] runecraftingNames = {"Runecrafting", "runecrafting", "Runecraft", "runecraft", "RC", "Rc", "rc"};
- String[] farmingNames = {"Farming", "farming", "Farm", "farm"};
- String[] hunterNames = {"Hunting", "hunting", "Hunter", "hunter"};
- String[] constructionNames = {"Construction", "construction", "constructing", "constructing"};
- String[] summoningNames = {"Summoning", "summoning", "Summon", "summon"};
- public String statName(int stat) {
- if(stat == STAT_ATTACK)
- return pickRandomName(attackNames);
- if(stat == STAT_DEFENSE)
- return pickRandomName(defenseNames);
- if(stat == STAT_STRENGTH)
- return pickRandomName(strengthNames);
- if(stat == STAT_HITPOINTS)
- return pickRandomName(hitpointsNames);
- if(stat == STAT_RANGE)
- return pickRandomName(rangeNames);
- if(stat == STAT_PRAYER)
- return pickRandomName(prayerNames);
- if(stat == STAT_MAGIC)
- return pickRandomName(magicNames);
- if(stat == STAT_COOKING)
- return pickRandomName(cookingNames);
- if(stat == STAT_WOODCUTTING)
- return pickRandomName(woodcuttingNames);
- if(stat == STAT_FLETCHING)
- return pickRandomName(fletchingNames);
- if(stat == STAT_FISHING)
- return pickRandomName(fishingNames);
- if(stat == STAT_FIREMAKING)
- return pickRandomName(firemakingNames);
- if(stat == STAT_CRAFTING)
- return pickRandomName(craftingNames);
- if(stat == STAT_SMITHING)
- return pickRandomName(smithingNames);
- if(stat == STAT_MINING)
- return pickRandomName(miningNames);
- if(stat == STAT_HERBLORE)
- return pickRandomName(herbloreNames);
- if(stat == STAT_AGILITY)
- return pickRandomName(agilityNames);
- if(stat == STAT_THIEVING)
- return pickRandomName(thievingNames);
- if(stat == STAT_SLAYER)
- return pickRandomName(slayerNames);
- if(stat == STAT_RUNECRAFTING)
- return pickRandomName(runecraftingNames);
- if(stat == STAT_FARMING)
- return pickRandomName(farmingNames);
- if(stat == STAT_HUNTER)
- return pickRandomName(hunterNames);
- if(stat == STAT_CONSTRUCTION)
- return pickRandomName(constructionNames);
- if(stat == STAT_SUMMONING)
- return pickRandomName(summoningNames);
- return null;
- }
- public void talk() {
- long currentTime = System.currentTimeMillis();
- long minutes = (currentTime-lastCheck)/(60000);
- if(lastCheck == -1) {
- for(int i=0;i<training.length;i++)
- oldXP[i] = skills.getCurrentSkillExp(i);
- }
- if(minutes >= 1) {
- lastCheck = System.currentTimeMillis();
- for(int i=0;i<training.length;i++) {
- if(oldXP[i] != skills.getCurrentSkillExp(i)) {
- if(training[i] <= 5)
- training[i]++;
- } else {
- training[i] = 0;
- }
- }
- for(int i=0;i<training.length;i++)
- oldXP[i] = skills.getCurrentSkillExp(i);
- }
- int biggest=-1;
- int biggestNum = -1;
- for(int i=0;i<training.length;i++) {
- if(training[i] > biggest && training[i]>0) {
- biggest = training[i];
- biggestNum = i;
- }
- }
- if(biggest > 0)
- talk2(biggestNum);
- }
- public String xpToString(int level) {
- String[] extraArray = {"","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ". =\\", ".=\\", " =\\", "=\\", ". =O", ".=O", " =O", "=O",
- ". =)", ".=)", " =)", "=)", ". =]", ".=]", " =]", "=]",
- ". =P", ".=P", " =P", "=P", ". =D", ".=D", " =D", "=D",
- };
- int percent = skills.getPercentToNextLevel(level);
- int xpTo = skills.getXPToNextLevel(level);
- int skillLevel = skills.getCurrentSkillLevel(level);
- String only = "";
- String temp = "";
- String[] toArray = {"to", "to", "to", "2", "till", "till", "until", "until"};
- String to=toArray[random(0,toArray.length)];
- String[] onlyArray = {"only", "just"};
- if(percent < 20 && random(1,5) == 3) {
- only=onlyArray[random(0,1)]+" ";
- }
- String k = "k";
- String m = "m";
- if(random(0,2) == 0) {
- k="K";
- m="M";
- }
- if(xpTo > 1000000)
- temp = xpTo/1000000+m;
- else if(xpTo > 1000)
- temp = xpTo/1000+k;
- else
- temp = ""+xpTo;
- String[] moreArray = {"to go", "more", "left", "To Go", "More", "Left"};
- String more=moreArray[random(0,moreArray.length)];
- String[] xpArray = {"xp", "XP", "Xp", "EXP", "Exp", "exp", "Experience", "experience"};
- String xp=xpArray[random(0,xpArray.length)];
- String[] levelArray = {"Lvl", "LVL", "lvl",
- "Lev", "lev", "LV", "lv", "Lv", "Level", "level"};
- String lvl = levelArray[random(0,levelArray.length)];
- String[] talkArray = {only+temp+xp+" "+more+" "+to+" "+lvl+" "+(skillLevel + 1), only+temp+" "+statName(level)+" "+xp+" "+more+" "+to+" "+lvl+" "+(skillLevel + 1),
- "i "+only+"need "+temp+" "+xp+" "+more+" "+to+" "+lvl+" "+skillLevel, "i "+only+"need "+temp+" "+statName(level)+" "+xp+" "+more+" "+to+" "+lvl+" "+(skillLevel + 1)};
- return talkArray[random(0,talkArray.length)]+extraArray[random(0,extraArray.length)];
- }
- public void hoverInterface(int iface, int child) {
- hoverInterface(RSInterface.getChildInterface(iface, child));
- }
- public void hoverInterface(RSInterfaceChild i) {
- if (!i.isValid()) return;
- Rectangle pos = i.getArea();
- moveMouse((int) random(pos.getMinX(), pos.getMaxX()), (int) random(pos.getMinY(), pos.getMaxY()));
- }
- public void talk2(int skill) {
- if(nextTalk > System.currentTimeMillis())
- return;
- nextTalk = System.currentTimeMillis()+random(140000,160000*random(2,4));
- if(getNearestPlayerDistance() >=5) //nobodys close enough to talk to.
- return;
- String[] extraArray = {"","","","?","?","?","."};
- String extra=extraArray[random(0,extraArray.length)];
- int gamble = random(1,3);
- String stat = statName(skill);
- int level = skills.getCurrentSkillLevel(skill);
- String only = "";
- String[] onlyArray = {"only", "just"};
- if(level < 30 && random(1,5) == 3) {
- only=onlyArray[random(0,1)]+" ";
- }
- String[] extraArray2 = {"","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ". =\\", ".x[)", " =\\", " lol", ". =O", ".=O", " =O", "=O",
- ". =)", ".=)", " =)", "=)", ". =]", ".=]", " =]", "=]",
- ". =P", ".=P", " =P", "=P", ". =D", ".=D", " =D", "=D",
- };
- String extra2=extraArray2[random(0,extraArray2.length)];
- String[] levelArray = {"", "", "", "", "", "Lvl ", "LVL ", "lvl ",
- "Lev ", "lev ", "LV ", "lv ", "Lv ", "Level ", "level "};
- String lvl = levelArray[random(0,levelArray.length)];
- String[] misc1 = {"what's your", "wuts ur", "whats your", "what's your", "quts yur"};
- String[] echoMineArray = {"mine is "+only+lvl+level, "mine is "+only+lvl+level, "mine is "+only+lvl+level, only+lvl+level+" here",
- only+lvl+level+" over here"};
- String echoMine = echoMineArray[random(0,echoMineArray.length)];
- if(gamble == 1) {
- textSent = misc1[random(0,misc1.length)]+" "+stat+" level"+extra;
- sendText(textSent,true);
- wait(random(100,300));
- if(random(0,21) != 20) //one in 20 chance it wont say your level back.
- wait(random(6000,7000));
- sendText(echoMine+extra2,true);
- } else if(gamble == 2) {
- int oldTab = getCurrentTab();
- openTab(TAB_STATS);
- wait(random(100,200));
- hoverInterface(320,125+random(0,5));
- wait(random(500,2000));
- String text = xpToString(skill);
- System.out.println("\n\n\n"+text+"\n\n\n");
- sendText(text, true);
- openTab(oldTab);
- }
- }
- public String getName() { //Name of the Script
- return "ChatResponderImproved"; //between "" what will show up in RSBot script selector
- }
- public double getVersion() { //Version of the Script
- return 1.0; //what will show up in RSBot script selector
- }
- public String getAuthor() { //Author of the Script
- return "Mike, ToshiXZ & Tejanca"; //what will show up in RSBot script selector
- }
- public boolean onStart(String[] args) { //First thing run, when a Script is started (holds an array called "args" which contain the arguments put in by user in Script Selector
- return true; //return true = Start Script; return false = Don't Start Script
- }
- public String getChildText(int iface, int child) {
- return RSInterface.getInterface(iface).getChild(child).getText();
- }
- public String[] getChatMessages(boolean stripName) {
- String[] temp = new String[100];
- int tempi=0;
- for(int i=155; i >= 56; i--)
- if(getChildText(137,i).contains("<col=0000ff>")) {
- if(stripName) {
- temp[tempi] = getChildText(137,i).substring(getChildText(137,i).indexOf("<col=0000ff>")+12);
- tempi++;
- } else {
- temp[tempi] = getChildText(137,i).replaceAll("<col=0000ff>", "");
- tempi++;
- }
- }
- return temp;
- }
- String oldChat = "";
- String[] chat = new String[100];
- String[] chat2 = new String[100];
- int[] training = new int[STAT_SUMMONING];
- int[] oldXP = new int[STAT_SUMMONING];
- public boolean activateCondition() { //Main function of the Script
- reply();
- talk();
- return false;
- }
- public void reply() {
- chat = getChatMessages(true);
- chat2 = getChatMessages(false);
- if(chat[0] == null || oldChat.equalsIgnoreCase(chat2[0]))
- return;
- if (oldQ[0].equalsIgnoreCase(chat2[0]))
- return;
- String temp=chat2[0];
- String name = temp.substring(0,temp.indexOf(":"));
- if(name.equalsIgnoreCase(getMyPlayer().getName()))
- return;
- if(replyToPlayer(chat[0])) {
- log("ChatResponder is replying to: ");
- log(chat2[0]);
- log("Successfully replied with:");
- log(reply);
- oldQ[0] = chat2[0];
- }
- }
- public int loop() {
- return -1; //wtf? this shouldn't be called.
- }
- public String pickRandomName(String[] possible) { //it needs to USUALLY pick the first two.
- if(random(0,5) == 3)
- return possible[random(0,possible.length)];
- else
- return possible[random(0,1)];
- }
- public boolean replyToPlayer(String text) {
- text=text.toLowerCase();
- reply="NO REPLY";
- Boolean doPrefix = true;
- int oldTab = -1;
- if (getMyPlayer().getAnimation() == dyingAnimation){
- String[] deathArray = {"crap","well that sucks","oh man","dang it","F T L...sigh"};
- String death=deathArray[random(0,deathArray.length)];
- sendText(death,true);
- reply=death;
- return true;
- }
- if (text.contains("botting?") || text.contains("ur a bot") || text.contains("bot?") || text.contains("macro?") || text.contains("bot..")) {
- String[] bottingArray = {"botting is lame","bots r for losers!","id never bot","lol botting fails","i sure ain't a bot","nah","i dont bot!","i've never botted before"};
- String botting=bottingArray[random(0,bottingArray.length)];
- sendText(botting,true);
- reply=botting;
- return true;
- }
- if (text.contains("im bored") || text.contains("i'm bored") || text.contains("i am bored") || text.contains("i ma bored")) {
- String[] boredArray = {"me too", "i am not", "*yawn* me too", "so am i","i am also","nice to meet you bored :)","nice to meet you bored","i'm not","im not","im not, im just tired"};
- String bored=boredArray[random(0,boredArray.length)];
- sendText(bored,true);
- reply=bored;
- return true;
- }
- if (text.contains("w00t") || text.contains("woot") || text.contains("w00t") || text.contains("yipee") || text.contains("yay!")) {
- String[] wootArray = {"Gratz", "congratz", "congratulations", "lol gratz?"};
- String woot=wootArray[random(0,wootArray.length)];
- sendText(woot,true);
- reply=woot;
- return true;
- }
- if (text.contains("sup") || text.contains("wazup") || text.contains("nmu") || text.contains("sup") || text.contains("s up?")) {
- String[] supArray = {"meh, not much","nothing much","nmu","meh, nothing really","nothing, bored"};
- String sup=supArray[random(0,supArray.length)];
- sendText(sup,true);
- reply=sup;
- return true;
- }
- if (text.contains("k till") || text.contains("k untill")) {
- String[] ktillArray = {"thats nice","cool, good luck","good luck","nice","that's nice","sweet","wow","gratz"};
- String ktill=ktillArray[random(0,ktillArray.length)];
- sendText(ktill,true);
- reply=ktill;
- return true;
- }
- if (text.contains("m till") ||text.contains("m untill")) {
- String[] mtillArray = {"holy sheet","wow","dang!","dang","holy smokes","w0w","good luck!","good luck"};
- String mtill=mtillArray[random(0,mtillArray.length)];
- sendText(mtill,true);
- reply=mtill;
- return true;
- }
- if (text.contains("why are you doing that") || text.contains("why are you doin that") || text.contains("y r u doing that")) {
- String[] looperrorArray = {"'cuz i can","because i want to","why not?","why aren't you?!","it makes people mad"};
- String looperror=looperrorArray[random(0,looperrorArray.length)];
- sendText(looperror,true);
- reply=looperror;
- return true;
- }
- if (text.contains("cya") || text.contains("bye") || text.contains("c ya") || text.contains("later") || text.contains("seeya")) {
- String[] cyaArray = {"later","bye","seeya!","cya","ok bye then"};
- String cya=cyaArray[random(0,cyaArray.length)];
- sendText(cya,true);
- reply=cya;
- return true;
- }
- if (text.endsWith("hi") || text.contains("Hey") || text.contains("Yo") || text.contains("Helow") || text.contains("Hello") || text.startsWith("Hi") && text.indexOf("fish") == -1 && text.indexOf("smithing") == -1 && text.indexOf("hitp") == -1 && text.indexOf("which") == -1 && text.indexOf("the") == -1 && text.indexOf("not") == -1 && text.indexOf("high") == -1 && text.indexOf("this") == -1) {
- String[] greetingArray = {"hey","yo man","hi","yo","hello","greetings","hi :)"};
- String greeting=greetingArray[random(0,greetingArray.length)];
- sendText(greeting,true);
- reply=greeting;
- return true;
- }
- if((text.contains("level") || text.contains("lv")) && (text.indexOf(" ") == text.lastIndexOf(" ") || text.startsWith("what") || text.endsWith("?") || text.endsWith("lv") || text.endsWith("lvl") || text.endsWith("lev") || text.endsWith("level"))) { //asking for a level
- int whichSkill = -1;
- String statName;
- if(text.contains("att")) {
- whichSkill = STAT_ATTACK;
- statName=pickRandomName(attackNames);
- } else if(text.contains("def")) {
- whichSkill = STAT_DEFENSE;
- statName=pickRandomName(defenseNames);
- } else if(text.contains("str")) {
- whichSkill = STAT_STRENGTH;
- statName=pickRandomName(strengthNames);
- } else if(text.contains("hp") || text.contains("hit")) {
- whichSkill = STAT_HITPOINTS;
- statName=pickRandomName(hitpointsNames);
- } else if(text.contains("range")) {
- whichSkill = STAT_RANGE;
- statName=pickRandomName(rangeNames);
- } else if(text.contains("pray")) {
- whichSkill = STAT_PRAYER;
- statName=pickRandomName(prayerNames);
- } else if(text.contains("mag")) {
- whichSkill = STAT_MAGIC;
- statName=pickRandomName(magicNames);
- } else if(text.contains("cook")) {
- whichSkill = STAT_COOKING;
- statName=pickRandomName(cookingNames);
- } else if(text.contains("wc") || text.contains("woodcut")) {
- whichSkill = STAT_WOODCUTTING;
- statName=pickRandomName(woodcuttingNames);
- } else if(text.contains("fletch")) {
- whichSkill = STAT_FLETCHING;
- statName=pickRandomName(fletchingNames);
- } else if(text.contains("fish")) {
- whichSkill = STAT_FISHING;
- statName=pickRandomName(fishingNames);
- } else if(text.contains("fm") || text.contains("fire")) {
- whichSkill = STAT_FIREMAKING;
- statName=pickRandomName(firemakingNames);
- } else if(text.contains("craft")) {
- whichSkill = STAT_CRAFTING;
- statName=pickRandomName(craftingNames);
- } else if(text.contains("smith")) {
- whichSkill = STAT_SMITHING;
- statName=pickRandomName(smithingNames);
- } else if(text.contains("mining") || text.contains("mine")) {
- whichSkill = STAT_MINING;
- statName=pickRandomName(miningNames);
- } else if(text.contains("herb")) {
- whichSkill = STAT_HERBLORE;
- statName=pickRandomName(herbloreNames);
- } else if(text.contains("agil")) {
- whichSkill = STAT_AGILITY;
- statName=pickRandomName(agilityNames);
- } else if(text.contains("thiev") || text.contains("theiv")) {
- whichSkill = STAT_THIEVING;
- statName=pickRandomName(thievingNames);
- } else if(text.contains("slay")) {
- whichSkill = STAT_SLAYER;
- statName=pickRandomName(slayerNames);
- } else if(text.contains("farm")) {
- whichSkill = STAT_FARMING;
- statName=pickRandomName(farmingNames);
- } else if(text.contains("runecraft") || text.contains("rc")) {
- whichSkill = STAT_RUNECRAFTING;
- statName=pickRandomName(runecraftingNames);
- } else if(text.contains("hunt")) {
- whichSkill = STAT_HUNTER;
- statName=pickRandomName(hunterNames);
- } else if(text.contains("construct")) {
- whichSkill = STAT_CONSTRUCTION;
- statName=pickRandomName(constructionNames);
- } else if(text.contains("summon")) {
- whichSkill = STAT_SUMMONING;
- statName=pickRandomName(summoningNames);
- } else {
- statName = "NO STAT!";
- }
- if(whichSkill != -1) {
- oldTab=getCurrentTab();
- openTab(TAB_STATS);
- int gambleInt = random(1,4);
- String[] extraArray = {"","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- "","","","","","","","","","","","","","","","","","",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ".",".",".",".",".",".",".",".",".",".",".",".",".",".",
- ". =\\", ".=\\", " =\\", "=\\", ". =O", ".=O", " =O", "=O",
- ". =)", ".=)", " =)", "=)", ". =]", ".=]", " =]", "=]",
- ". =P", ".=P", " =P", "=P", ". =D", ".=D", " =D", "=D",
- };
- String extra=extraArray[random(0,extraArray.length)];
- if(extra.contains("=") && random(1,3) == 1)
- extra=extra.replaceAll("=", ":"); //transforms some happyfaces :D =D
- String[] onlyArray = {"only", "just"};
- String[] levelArray = {"Lvl", "LVL", "lvl", "Lev", "lev", "LV", "lv", "Lv", "Level", "level"};
- String[] haveArray = {"have","have","have","have", "got", "Have", "Got"};
- String misc="";
- String only="";
- String have=haveArray[random(0,haveArray.length)];
- if(random(0,2) == 1 && statName.endsWith("ing")) {
- statName = statName.substring(0,statName.length()-1); //will sometimes remove g at end (e.g mining to minin)
- }
- int skillLevel = skills.getCurrentSkillLevel(whichSkill);
- if(skillLevel < 30 && random(1,5) == 3) {
- only=onlyArray[random(0,1)]+" ";
- }
- misc+=levelArray[random(0,levelArray.length)];
- if(misc.length() > 0)
- misc = " "+misc;
- if(gambleInt == 1) {
- reply=""+skillLevel+extra;
- } else if(gambleInt == 2) {
- reply="My "+statName+misc+" is "+only+skillLevel+extra;
- } else if(gambleInt == 3) {
- reply="I "+only+"have "+skillLevel+" "+statName+extra;
- }
- }
- }
- if(reply=="NO REPLY") {
- return false;
- } else {
- String prefix="";
- wait(random(2000,3000));
- if(random(1,6) == 2)
- reply=reply.toLowerCase();
- sendText(reply,true);
- if(oldTab != -1) {
- wait(random(10,100));
- openTab(oldTab);
- }
- return true;
- }
- }
- public String getScriptCategory() {
- return "Antiban";
- }
- public int getNearestPlayerDistance() {
- int Dist = 20;
- RSPlayer closest = null;
- int[] validPlayers = Bot.getClient().getPlayerIndexArray();
- Player[] players = Bot.getClient().getPlayerArray();
- for (int element : validPlayers) {
- if (players[element] == null) {
- continue;
- }
- RSPlayer player = new RSPlayer(players[element]);
- try {
- int distance = distanceTo(player);
- if (distance < Dist) {
- Dist = distance;
- closest = player;
- }
- } catch (Exception e) {}
- }
- if(closest==null)
- return 999;
- return distanceTo(closest.getLocation());
- }
- }
