No... you should be using a method to accomplish ONLY one thing... in this case finding the monster closest to your character.
Then in the main bot thread check if the returned value is not null and then figure out if you want to either attack that monster or jump to it.
When writing methods they should be accomplishing ONE thing only. Ideally they should only be doing one generic function so that the same method can be used across a number of purposes...
EG: You shouldn't have the distance formula inside each and every method in which you want to use it... you should have it as a separate method so that you can call it from anywhere in the source.
Also keep in mind when creating things the differences between how you set something up...
public/private/protected: This sets the access level basically for the method. Public can be accessed outside of the class in which they reside, private cannot (generally you use a public get/set method to modify it).
static: Means that you cannot create new instances of this object. If you do not have the static keyword then you would be able to create more instances of it by using the new keyword.
ie: Coords are not static... you can have more than 1 coord but for a calculation you generally don't want more than 1 copy of the same calculation system.
Coord C = new Coord(); creates a new coord object... If you didn't do 'new' or assign it to an existing object it wouldn't work because it doesn't know which instance of an object you are referring to.
void/bool/etcetc is the return type. Void means it does NOT return a value, it simply executes a set of instructions. All others need a return type which can be used to initiate values.
IE: our get closest item method returns a ground item... so we can do something like
Items.GroundItem I = Calculations.GetClosestItem(C);
Alternatively you could use boolian logic with a bool return value to do something like...
if(Calculations.OffScreen(C, TargetCoords))
return;
You guys REALLY should be looking at some other guides both on epvp and elsewhere... there are a BUNCH in my siggy and all over the site... Try looking through some C# guides before you continue.
Then in the main bot thread check if the returned value is not null and then figure out if you want to either attack that monster or jump to it.
When writing methods they should be accomplishing ONE thing only. Ideally they should only be doing one generic function so that the same method can be used across a number of purposes...
EG: You shouldn't have the distance formula inside each and every method in which you want to use it... you should have it as a separate method so that you can call it from anywhere in the source.
Also keep in mind when creating things the differences between how you set something up...
public/private/protected: This sets the access level basically for the method. Public can be accessed outside of the class in which they reside, private cannot (generally you use a public get/set method to modify it).
static: Means that you cannot create new instances of this object. If you do not have the static keyword then you would be able to create more instances of it by using the new keyword.
ie: Coords are not static... you can have more than 1 coord but for a calculation you generally don't want more than 1 copy of the same calculation system.
Coord C = new Coord(); creates a new coord object... If you didn't do 'new' or assign it to an existing object it wouldn't work because it doesn't know which instance of an object you are referring to.
void/bool/etcetc is the return type. Void means it does NOT return a value, it simply executes a set of instructions. All others need a return type which can be used to initiate values.
IE: our get closest item method returns a ground item... so we can do something like
Items.GroundItem I = Calculations.GetClosestItem(C);
Alternatively you could use boolian logic with a bool return value to do something like...
if(Calculations.OffScreen(C, TargetCoords))
return;
You guys REALLY should be looking at some other guides both on epvp and elsewhere... there are a BUNCH in my siggy and all over the site... Try looking through some C# guides before you continue.