

Franimal
-
Posts
7 -
Joined
-
Last visited
-
Feedback
0%
Posts posted by Franimal
-
-
isFacing(Character)
Some problems may arise with that though; there are cases where they will be facing and not dying to you
-
Is there a method on the NPC class like
npc.getInteractingEntity() or something?
If there is you could use
if(npc.getInteractingEntity().equals(getMyPlayer()) && npc.getAnimation() == deathAnim) count++;
That kind of thing could work.
-
I assume NPC animations are in the API, as well as entity interactions, in which case you can check for death animation while you are interacting and add to kill count. I'm just assuming though, I've never actually written a script for osbot.
-
state is like declare the method?? like int food? int arrows?
You'd have to clarify that question..
BotState is an enum, a group of definitions/types. I could give botState parameters; integers, strings, whatever. I can then create an instance of BotState and set it equal to one of the types of BotState, and later check which it is.
An easier example of an enum would be something like:
private enum Planet { MARS(), JUPITER(), EARTH(), NEPTUNE(); }
I could then assign values to them like distance from earth or mass and add getter methods to it
private enum Planet { MARS(500, 20000), JUPITER(10000, 200000), EARTH(700, 100), NEPTUNE(100000, -500); private final double distance; private final double mass; public Planet(double distance, double mass){ this.distance = distance; this.mass = mass; } public double mass(){ return mass; } public double distance(){ return distance; } }
This would allow me to make a variable currentPlanet, which I could set to any Planet that exists, earth, mars, whatever, and it would then contain that planets distance and mass, which I could check and use.
I assume that's what you were asking. :p
-
1
-
-
I am having some issues with the script loader. I managed to get a test .class file showing up and working sometimes - other times the name would show up but the description would not and the script could not be found. Other scripts I have had no luck with; Test.class has been the only one that has worked. I have tried .groovy also and no luck, as well as scripts other people have written on the site.
Thanks for any help,
Oh and please add some .getPolygon methods to things like tiles ;D.
Another issue: Bot tabs don't always open correctly and sometimes if I close them it thinks they are still open so doesn't let me open a knew one. Does the same with the entire client - sometimes it half closes it so the game screen is still visible and I have to end the process to complete it's closure.
Counting Npc Deaths
in Software Development
Posted
Ah, that's ok then.