February 28, 201510 yr I have a simple hunter script I'm working on which works for 1 trap, but I dont know how to make it work for multiple traps. This is due to the fact that I use : Entity ready = objects.closest(9345); as a means of detecting my traps. objects.closest only works on one object so I need to find a way to deal with multiple. Thanks
February 28, 201510 yr I have never had a need to do this, but you can just store one: Entity ready = objects.closest(9345); Entity second = objects.closest(new Filter blah blah in this filter return false if the object.equals(ready));
February 28, 201510 yr Author I have never had a need to do this, but you can just store one: Entity ready = objects.closest(9345); Entity second = objects.closest(new Filter blah blah in this filter return false if the object.equals(ready)); but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically?
February 28, 201510 yr but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically? it will ignore the ready enitty and look for whatever fits the best filter.
February 28, 201510 yr but if it returns false when the closest object is ready, would it pick up the closest object after ready ,or would it just be null basically? Are you trying to check if a trap fell? If so you only need to store one fallen trap. If you have a loop going, and you are constantly checking for a closest object (the fallen trap), say you have 2 fallen traps, it will store the first one, then you can operate on it, i.e. pick it up and reset it. Then the loop goes again checking for another fallen trap, you just set one, so there is one left on the ground, it will then store that one, you put it back up, and move on. You just need to check for one fallen trap. If you store multiple fallen traps you will over complicate your script unnecessarily. You cant operate on more than 1 fallen trap at a time anyway.
February 28, 201510 yr Author alright i tried the filter and it works thanks a lot friends. also if you are using object entities and you are in a place where there a shit ton of objects(like the jungle) will all these objects mess up the bot trying to find a specific object?
March 1, 201510 yr alright i tried the filter and it works thanks a lot friends. also if you are using object entities and you are in a place where there a shit ton of objects(like the jungle) will all these objects mess up the bot trying to find a specific object? If i'm reading this correctly, no it shouldn't objects.closest("whatever string" or whatever id) you have in here will only be looked for, not anything else.
Create an account or sign in to comment