MQ2Farm

Chatwiththisname

Learning2Code
Joined
Sep 28, 2008
Messages
1,234
Reaction score
54
Points
48
Location
Texas
MQ2Farm is currently named MQ2FarmTest while it is in testing and development.

MQ2Farm is designed around the concept of Farm.mac with the intent to assist with farming specific items or creatures or to act like a hunter type macro.

Known Issues:
When a mob is running away, I will start to cast a spell, and then start running after it while I'm still casting.

Q: Why to use a plugin instead of a macro?
A: This originally started as a project mostly to learn how to write plugins and I felt that it covered most topics that I would find myself needing to write a plugin for since it already did so much under the hood (in the code). However, having started work on this and progressing as far as I have I determined that this would be the future of Farm.mac.

Q: What can MQ2Farm do that Farm.mac cannot?
A: MQ2Farm has a couple of features that have been added to it that don't currently exist in Farm.mac such as the automatic selection and use of Combat Abilities with the option to customize the ability list via INI. It features custom functions written specifically for MQ2Farm which are slightly different than the functions written into core MQ2 to assist with making Farm.mac work exactly the way I want it to without the use of built in functions. Without the ability to write functions directly I would be at the mercy of the information made available to Macros though MQ2DataTypes.

Q: What can Farm.mac do that MQ2Farm cannot?
A: Farm.mac has been updated more than a few times over the course of time since it's conception and has been molded by the feature requests of the members. With that said, it not only is the model that MQ2Farm is based on, but it also already has all the features that I'm trying to include into MQ2Farm which may or may not be available at this point. MQ2Farm is in TESTING stages and not entirely ready for user consumption. However, with that said it will eventually catch up and surpass Farm.mac, it already has features I didn't think would be possible when writing Farm.mac, and I expect it shall continue to be improved as I write this plugin from the ground up.

Q: I found a bug or would like to request a feature, how do I go about letting you know?
A: You can let me know via discord, or by posting on the discussion thread for this resource. I will determine if it's a reasonable request, or a feature I'd like to add. If it's a bug request I will be able to apply it to my "Known Issues" list and look at resolving the issue.

[TLOs and Member]
${Farm.TargetID} - The intended target farm is going after
${Farm.Version} - Current version of MQ2Farm

[Commands Available]
/farm help or /farm --- Will output the help menu
/farm on|off --- Will turn on|off farming with INI settings.
/farm radius #### --- Will set radius to number provided
/farm zradius #### --- Will set zradius to number provided.
/farm farmmob "Mob Name Here" --- Will specify a farmmob to farm.
/farm farmmob clear --- Will clear the FarmMob and attack anything not on an alertlist.
/farm castdetrimental 1|On 0|Off --- Will turn on and off casting of single target detrimental spells.
/farm debug 1|on 0|Off --- Will turn on and off debugging messages.
/farm MedAt --- Will show you when you will med mana.
/farm MedAt #### --- Will set when you when you will med mana.
/farm MedTill --- Will show you when you will stop medding mana.
/farm MedTill #### --- Will set when you when you will stop medding mana.
/farm HealAt --- Will show you when you will med health.
/farm HealAt #### ---Will show you when you will med health.
/farm HealTill --- Will show you when you will stop medding health.
/farm HealTill #### --- Will set when you when you will med health.
/farm MedEndAt --- Will show you when you will med endurance.
/farm MedEndAt #### --- Will set you when you will med endurance.
/farm MedEndTill --- Will show you when you will stop medding endurance.
/farm MedEndTill #### --- Will set when you will stop medding endurance.
/ignorethis --- Will temporarily ignore your current target.
/ignorethese --- Will temporarily ignore all spawns with this targets clean name.

Changes.txt for MQ2FarmTest
Code:
/* MQ2FarmTest.cpp
Chatwiththisname/PeteSampras - Started MQ2Farm Initial Setup/Preperation
Chatwiththisname/Renji - 10/07/2018 - Worked SpawnSearch and Nav Code
Chatwiththisname 10/8/2018 - Working on Algorithms for Farming.
                            - Adding FarmCommand Functionality.
                            - Added Health/Endurance/Mana Checks, still requires logic for resting routines.
                            - Added HaveAggro() function. Returns true if any Autohaters are populated on Xtargetlist.
Chatwiththisname 10/16/2018 - Test has been down a while, but added a getFirstAggroed() function to try and
                             - deal with aggro before trying to find a mob with a shortest path to fix
                             - ignoring aggrod mobs.
Chatwiththisname 11/12/2018 - Working on CastDetrimental() function to cast single target detrimental spells.
                             - Added rest routines.
Chatwiththisname 1/2/2019 - Cleaning up the code to remove all the comments.
                           - trying to add Discs to combat routines, not having much luck.
                           - Separated FarmTest into seperate files.
                           - Tried adding TLO and member support. No luck, but kept the file.
Chatwiththisname 1/3/2019 - Now generating a list of Discs for toons to use and separating them to sections.
                           - Firing Discs during combat based on the previously mentioned list.
                           - DiscReady function now checks endurance/mana/reagent requirements before reporting true.
                           - Actually enjoying testing this on my berserker. He's doing pretty good DPS without MQ2Melee.
Chatwiththisname 1/5/2019 - Got the Farm datatype fixed and added two members. TargetID and Version. ${Farm.TargetID} ${Farm.Version}
                           - Cleaned up FarmCommand and it now report invalid command.
                           - Made additions to ignorethese and ignorethis.
                           - "/farm " Help list of commands updated to show all commands for current build.
                           - Now sitting when no target is found to kill while it waits for more things to spawn or wander in range.
                           - DiscReady function now makes sure you aren't trying to use an active disc when you already have one running.
                           - Added usage of Instant cast beneficial buffs while in combat.
                           - Made a HUD for use with the ${Farm.TargetID} to get a display of what it's going after and some information, useful for debugging.
                           - You can now add and remove Discs with INI entries. [DiscRemove] section for removing. [DiscAdd] section for Additions.
Chatwiththisname 1/6/2019 - INI's are now character specific, stored in release folder as MQ2FarmTest_CharacterName.ini
                           - Discs are now grabbed and sorted when the /farm on command is given instead of when the plugin loads.
Chatwiththisname 1/7/2019 - Added more refined sorting for summmoning discs and Endurance Regenaration Discs.
                           - Adding abilities base on the INI is no longer Rank Specific.
                           - Removing Combat Abilities base on the INI is no longer rank specific.
                           - INI Name now updated when the farm command is used for anything to ensure that the proper file is being written to.
                           - Added in the casting of Aura Discs and Endurance Regen Discs for use out of combat.
                           - Refined ActiveDisc detections to eliminate trying to use a disc when there is already an active disc, but allow the use of combat abilities unhindered.
Chatwiththisname 1/20/2019 - Added the use of the FarmMobIgnored.ini file in the macro folder for the global ignores
                              so players didn't need to reinvent the wheel and could use the existing ignores file.
                            - Added group health mana and endurance checks so you can now have the merc tag along
                              without worry of running them out of mana.
                            - Reduced the delay between pulses by 1/3rd
                            - Nav will now refresh destination if target is moving while navigating to the selected spawn.
                            - Made some adjustments to stopping distance to prevent "You are to far away" issues.
                            - Discs now verify target is in range before attempting to use if you have a target.
                            - Fixed a crash that occured if no valid spawns were found.
                            - TODO: Add the /permignore command to replicate the usage in the macro
                            - TODO: Fix spell casting...yes, really...maybe....I'm not sure.
                            - TODO: Change the distance checks for NavigateToID(DWORD ID) to use Get3DDistance function instead of GetDistance
                            - TODO: Check for dead group members
                            - TODO: Check for dead mercenaries and handle it appropriately. (Gah, window access?)

[DiscRemove]
DiscRemove1=Hiatus
DiscRemove2=Mangling Discipline
DiscRemove3=Proactive Retaliation
DiscRemove4=Axe of Rekatok
[DiscAdd]
DiscAdd1=Breather
DiscAdd2=Disconcerting Discipline
DiscAdd3=Frenzied Resolve Discipline
DiscAdd4=Axe of the Aeons
DiscAdd5=Cry Carnage
DiscAdd6=Bloodlust Aura
DiscAdd7=Axe of the Demolisher
*/
 
Last edited:
  • Love
Reactions: EQDAB
Looking forward to trying it, the stuff you have been getting done in discord looks great.
 
Looking forward to trying this out as well. Just started a full load of classes so time is limited but once things settle down I'll be sure to give this a go.
 
No changes, but new copy for live as of 1/16/19 on first post. Cheers.

It's also worth mentioning that since my plugin doesn't get compiled with the MMOBugs build, that if you have my plugin loaded and Live gets patched, that when you start up with MQ2 it will crash you right back out of the game, you'll have to unload the plugin following patches until you get a new copy of the plugin from here. So if you download my plugin and EQ patches, and you're crashing because you didn't unload my plugin, then I can at least say I let you know!
 
Last edited:
  • Like
Reactions: EQDAB
Any intentions of posting the source up to GitHub?
 
the current latest source, and likely the last one I'll share is listed in Farm.mac thread. But should give some interested in learning to code some basic idea's on how to achieve some things in C++ as opposed to macros.
 
  • Like
Reactions: EQDAB
Updated the first post with information and new build as of 1/21/19. Changes listed in first post in code block. Essentially my Changes.txt but for this plugin only.
 
  • Like
Reactions: EQDAB
With the "/farm radius #### --- Will set radius to number provided" will it just kill inside that radius and that's it? If I set it up and set the radius in an area will it wander any or just kill the mobs I want Just inside that circle? Getting ready to start playing with it and just looking for an idea before I start.
 
  • Like
Reactions: EQDAB
Tried this out lastnight and when I did a /farm on I crashed straight to desktop. Sent a crash report when it happened. What else would you like me to do when crashes happen?
 
  • Wow
Reactions: EQDAB
I might need to get Fry/Htw to compile for me. I usually compile with the VV which sometimes is not entirely on the same page as MMOBugs compile. It's not currently crashing for me, so that's the only thing I can think would be conflicting.
 
  • Like
Reactions: EQDAB
Would crash logs give an idea if they need to compile or if it's something else on my end? I don't know where the logs go so I have no idea who to ask that part.
 
  • Like
Reactions: EQDAB
Upcoming changes

Some new changes coming. Picture holds the latest upcoming changes. Submitted the git and will be active next time it's updated.

Please note the anchor point. It no longer automatically wanders the zone and instead is anchored to the start location and only engages spawns within a radius from that location. If you want to farm an entire zone, simply increase the radius to a size larger than the zone x 2 at a minimum. The radius for zonewide coverage need not be exact. Simply /farm radius 100000 (or some other really high number).


I added creating a circle on the map using CastRadius, after adding the anchor this is no longer ideal. I'm looking into adding an "anchored" map circle to MQ2Map so that it would show the actual location on the map.

I'm not yet reviving dead mercenaries, so if your merc dies and you don't manually revive it, the plugin will just sit and wait forever. In the future I'll look into automatically reviving mercenaries if yours is dead. For now, just keep an eye on it if you feel your merc might die.
 

Attachments

  • New Bitmap Image.png
    New Bitmap Image.png
    54.5 KB · Views: 21
Last edited:
  • Like
Reactions: EQDAB
Warrior needs mana?

I tried using the MQ2Farm plugin today. I experienced something odd, after doing /farm on, I recieved "warrior name" needs to med Mana.
I should also ask, will this plugin work with a druid pulling using a DoT to pull?

After this it didn't do anything. The warrior had full endurance. The .ini file is below:

Code:
[General]
Debugging=true
useLogOut=false
useEQBC=false
useMerc=true
CastDetrimental=true
[Pull]
ZRadius=25
Radius=320
PullAbility=melee
[Health]
HealAt=40
HealTill=90
[Endurance]
MedEndAt=40
MedEndTill=100
[Mana]
MedAt=30
MedTill=90
 
Last edited:
  • Like
Reactions: EQDAB
I tried using the MQ2Farm plugin today. I experienced something odd, after doing /farm on, I recieved "warrior name" needs to med Mana.
I should also ask, will this plugin work with a druid pulling using a DoT to pull?

After this it didn't do anything. The warrior had full endurance. The .ini file is below:

Code:
[General]
Debugging=true
useLogOut=false
useEQBC=false
useMerc=true
CastDetrimental=true
[Pull]
ZRadius=25
Radius=320
PullAbility=melee
[Health]
HealAt=40
HealTill=90
[Endurance]
MedEndAt=40
MedEndTill=100
[Mana]
MedAt=30
MedTill=90

It's a known issue. Will have to hard code in exlusions for non-mana using classes it appears as I've tried to add a check for a character to have a MaxMana > 0 in order for it to check them, but doesn't appear to care much. Still gets hung up trying to med non-casting classes. Will let you know if I find the time to update the plugin
 
  • Like
Reactions: EQDAB
Try something like:

Code:
if (GetCharInfo2()->Class <= 16)
	{
		if (ClassInfo[GetCharInfo2()->Class].CanCast)
			Domedstuff();
	}
	else if (GetCharInfo()->ManaMax > 0)
                Domedstuff ();
 
  • Like
Reactions: EQDAB
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.
 
  • Wow
Reactions: EQDAB