private Position getNearestFire(){
ArrayList<Position> matched = new ArrayList<Position>();
int dist = 513;
int objIndex = 0;
List<Position> pos = fireZone.getPositions();
for(int i=0;i<pos.size();i++){
for(int j=0;j<fireSpots.length;j++){
if(pos.get(i) == fireSpots[j]){
matched.add(fireSpots[j]);
int temp = map.distance(fireSpots[j]);
if(temp < dist){
dist = temp;
objIndex = matched.size() - 1;
}
}
}
}
return matched.get(objIndex);
}
??????
http://osbot.org/api/org/osbot/rs07/api/EntityAPI.html#closest-org.osbot.rs07.api.map.Area-java.lang.String...-
RS2Object fire_inside_area = getObjects().closest(fireZone, "Fire");
This is probably the first error you are getting i'm not sure though, there is a lot of stuff wrong / inefficient through out your code :l
When you are trying to find solutions for things to be done in your script try referring to the API docs.
You also keep calling getNearestFire() over and over again, you could just call it once per loop and store it in a variable.
private Position[] fireSpots = {
new Position(3166,3492,0),
new Position(3163, 3492, 0),
new Position(3162, 3492, 0),
new Position(3162, 3491, 0),
new Position(3161, 3490, 0),
new Position(3161, 3489, 0),
new Position(3162, 3488, 0),
new Position(3162, 3487, 0),
new Position(3163, 3487, 0),
new Position(3164, 3486, 0),
new Position(3165, 3486, 0),
new Position(3166, 3487, 0),
new Position(3167, 3487, 0),
new Position(3167, 3488, 0),
new Position(3168, 3489, 0),
new Position(3168, 3490, 0),
new Position(3167, 3491, 0),
new Position(3167, 3492, 0),
new Position(3166, 3492, 0),
new Position(3165, 3493, 0),
new Position(3164, 3493, 0),
new Position(3163, 3492, 0)};
^ just declare an area you can light a fire in and get a random / nearest position inside it instead
Also use item names rather than ids which are subject to possibly change over time.
Look into ConditionalSleep rather than all those static sleeps as sell. http://osbot.org/api/org/osbot/rs07/utility/ConditionalSleep.html