MQ2Farm

Try something like:

Code:
if (GetCharInfo2()->Class <= 16)
	{
		if (ClassInfo[GetCharInfo2()->Class].CanCast)
			Domedstuff();
	}
	else if (GetCharInfo()->ManaMax > 0)
                Domedstuff ();

This is what I'm using currently.

Code:
inline float PercentMana(PSPAWNINFO &pSpawn)
{
	if ((float)pSpawn->ManaMax <= 0) return 100.0f;
	return (float)pSpawn->ManaCurrent / (float)pSpawn->ManaMax * 100.0f;
}

I expected that would work.

If you are interested, I would just recommend a couple of things to do. ManaMax is 0, no need to cast it as float in your if().
Do you need the float? Personally, I would just change it to an int, and floor() a x+.5 or something. E.g., since the calls compare to things like MedAt and MedTill, which are ints, you can be assured there are no floating point precision errors.

Also, I would suggest the return check make sure ManaMax > 0 before the division, as you will be causing a division by zero error that won't signal.

The binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. If the second operand of / or % is zero the behavior is undefined.

Up to you, just a couple basic ideas.

htw
 
Try something like:

Code:
if (GetCharInfo2()->Class <= 16)
	{
		if (ClassInfo[GetCharInfo2()->Class].CanCast)
			Domedstuff();
	}
	else if (GetCharInfo()->ManaMax > 0)
                Domedstuff ();

This is what I'm using currently.

Code:
inline float PercentMana(PSPAWNINFO &pSpawn)
{
	if ((float)pSpawn->ManaMax <= 0) return 100.0f;
	return (float)pSpawn->ManaCurrent / (float)pSpawn->ManaMax * 100.0f;
}

I expected that would work.

If you are interested, I would just recommend a couple of things to do. ManaMax is 0, no need to cast it as float in your if().
Do you need the float? Personally, I would just change it to an int, and floor() a x+.5 or something. E.g., since the calls compare to things like MedAt and MedTill, which are ints, you can be assured there are no floating point precision errors.

Also, I would suggest the return check make sure ManaMax > 0 before the division, as you will be causing a division by zero error that won't signal.

The binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. If the second operand of / or % is zero the behavior is undefined.

Up to you, just a couple basic ideas.

htw

Hmm, that is correct that I don't see a need to cast it as a float when I check ManaMax.
I did check to make sure ManaMax was > 0 with the check that lies and says 100.0f, by saying if it's <=0 return 100. which means it should never do the division.

I don't think there's really a need for flooring anything as being that accurate is likely not an idea. I do cast to floats for the division problem to get a percentage result, otherwise
2000/5000*100.0f would be 0*100.0f so for that bit I do need the casting to get an accurate result I'd think.

Haven't had a chance to work on this lately, but will soon.
 
Like I said, do what you want. It's your plugin. Not looking to argue/debate.
 
Pushed change to my git for the fix. Turns out
Code:
 myGroup->pMember[i]->pSpawn->ManaCurrent
was already returning the percentage for group members. No idea why I wasn't thinking that I can't get exact values from others than myself. Adjustments were made and it's now processing correctly the Health, Endurance, and Mana of group members.
 
With

/farm farmmob "Mob Name Here" --- Will specify a farmmob to farm.

Is it possible to specify a list of specific mobs to farm if you know they are all in one area or is that command for farming just one specific mob at a time?
 
Still supported?

Is this plugin still supported? I have been using pullfarm.mac for some time and was wondering if that funtionality was built into this plugin?

Thanks,
Lugnut
 
Is this plugin still supported? I have been using pullfarm.mac for some time and was wondering if that funtionality was built into this plugin?

Thanks,
Lugnut

Chatwiththisname is still active, if there is any problems, I am sure he'll look into them.
 
Is this plugin still supported? I have been using pullfarm.mac for some time and was wondering if that funtionality was built into this plugin?

Thanks,
Lugnut

Pulling is not part of the plugin. I haven't made changes to the code in about 10 months as my focus shifted to other plugins. This is strictly a hunter plugin.
 
I Downloaded this plugin today. Thanks for sharing it first off. I am trying this on my bard for obvious reasons and after few minutes he will stop..a message will say "character is wating for valid targets or agro..then spam stand sit stand sit. Is there anyway to stop that with settings or is this a known bug?
 
I Downloaded this plugin today. Thanks for sharing it first off. I am trying this on my bard for obvious reasons and after few minutes he will stop..a message will say "character is wating for valid targets or agro..then spam stand sit stand sit. Is there anyway to stop that with settings or is this a known bug?

Trying changing the radius that the plugin searches for mobs:

/farm radius xxxx
/farm zradius xxxx

Just use however large numbers you want to use.
 
I tried this yesterday and it's decent.

kudos
 
When I use this with my bard and I use the /mac twist 1 2 3 command stops me dead in my tracks.
 
This happens with the macro and the plugin.
 
Last edited:
I've been using this for a few weeks now for hunting tradeskill items, Been working pretty well although have to move character now and again and turn off/on again to restart it hunting.

One minor gripe about it though is you can /farm farmmob "a Mob" to hunt one kind of mob, but if you want to farm multiples - like snakes and crawlers, you cannot. Only one named mob at a time.

You can "ignorethese" pretty well, but wouldn't it be better to have a "huntthese" option instead? Or hunt target option which allows you to add different types of mobs to the hunt list?


Also, have an option to not sit while waiting for a mob. You might see one which the plugin hasn't and try moving towards it but act like a russian dancer sitting on his heels and jumping up and down.....
 
I've been using this for a few weeks now for hunting tradeskill items, Been working pretty well although have to move character now and again and turn off/on again to restart it hunting.

One minor gripe about it though is you can /farm farmmob "a Mob" to hunt one kind of mob, but if you want to farm multiples - like snakes and crawlers, you cannot. Only one named mob at a time.

You can "ignorethese" pretty well, but wouldn't it be better to have a "huntthese" option instead? Or hunt target option which allows you to add different types of mobs to the hunt list?


Also, have an option to not sit while waiting for a mob. You might see one which the plugin hasn't and try moving towards it but act like a russian dancer sitting on his heels and jumping up and down.....

farm uses a spawnsearch, it will get similar results to ${NearestSpawn[1, npc noalert 1 radius ${Radius} zradius ${ZRadius}]} from the macro. When you add a /farm farmmob "Something here" you're appending to the spawn search terms. So you could in theory do the following.

/farm farmmob "race spider"

Which would farm all mobs with the race of spider.

You could.

/alert add 10 "a giant snake"
/alert add 10 "a rat"
/alert add 10 "a bat"

/farm farmmob "alert 10"

and farm would kill any "a giant snake", "a rat", and "a bat"

Check out the wiki information for spawn searchs.

Spawn Search - MacroQuest Wiki
 
  • Like
Reactions: Wolfy
Farmmob not working?

Anyone having trouble with /farm farmmob <mobname> not working correctly? I used to be able to type /farm farmmob ape and it would kill all the apes in the area. When I do that now I get the message "Character is resting while waiting for valid targets or agro".


Edit: Must have been a zone specific issue. MQ2Farm running fine in a different zone.

Lugnut
 
Last edited:
Been using this for a few hours now and I can't seem it get it to not hump the ground over and over again when no spawn is detected.

mobs up it runs perfectly.

I turned all the medding to 0. but it still constantly sits and half stands and sits again on repeat then doesn't hunt the mobs when they are back up.

"Character is resting while waiting for valid targets or aggro."

Any suggestions?

Thanks!
 
Been using this for a few hours now and I can't seem it get it to not hump the ground over and over again when no spawn is detected.

mobs up it runs perfectly.

I turned all the medding to 0. but it still constantly sits and half stands and sits again on repeat then doesn't hunt the mobs when they are back up.

"Character is resting while waiting for valid targets or aggro."

Any suggestions?

Thanks!

Is there a way to not make it sit at all?
 
Figured it out. It was mq2autoforage trying to forage while it is trying to sit.
 
Any way to remove a mob accidentially put on the permignore list?