//Forage lake and river function forageRiver(accName, charName, collectCurios, dropCurios, dropQuality, startPos, waypoints){ //if the length of waypoints is lower than 2, log out and exit client to prevent looping. if(waypoints.length < 2) {jLogout(); jExit();} //main loop. while(true){ //remove any remnants of previous windows of bots. jDropLastWindow(); //if it cannot find a boat it will log out and exit the client to prevent looping. if(!takeBoat()) {jLogout(); jExit();} //teleport to hearthfire and save initial position. portHF(); jSendAction("crime"); jPrint(jTimestamp() + ": Foraging started."); initPos = jMyCoords(); //calculate where to put the boat. var shorePos = jCoord((initPos.x + (waypoints[0][0] - startPos.x)*11), (iniPos.y + (waypoints[0][1] - startPos.y)*11)); boatToLake(shorePos); getIntoBoat(); //foraging loop. for(var i = 1; i