I found the INI
I determined Velocity was PetBuff2
I did not have a section title {MQ2Bot] so i made one
it fixed it for a short time and now it is doing it again. I am so confused
Here is some code since this can be a teaching moment!I found the INI
I determined Velocity was PetBuff2
I did not have a section title {MQ2Bot] so i made one
it fixed it for a short time and now it is doing it again. I am so confused
to be honest a lot of people have complained about the functionality of the PetBuffIf#=
functionality.
I believe also that the PetBuff# will be based on your currently memorized spells. So if you previously had PetBuffIf2=False or 0, and you have since memorized your spells in a way that it is no longer the 3rd Pet Buff and instead PetBuff3=Velocity, then your if statement will no longer be valid.
If that is the case I recommend you save your spells as sets and always load saved spell sets to avoid reording your spell#
Some people have reported it working, some have reported it not working. I'm really not sure how I can help more than I have as I've never used the plugin. The majority of the time I'm working on some macro that will 100% conflict with mq2bot, thus I don't use the plugin at all.
Sadly I cannot look at the code and expect to have any level of understanding any time soon as my C++ skills are shit.
void CreatePetBuff()
{
if (!InGameOK())
return;
if (BardClass)
return;
vPetBuff.clear();
vPetBuffName.clear();
vPet.clear();
petSpell = NULL;
[COLOR=Yellow] PCHAR szPetBuff[] = { "Aegis of Kildrukaun", "Second Wind Ward", "Host in the Shell", "Hobble of Spirits", "Velocity", NULL };[/COLOR]
char szBuffer[MAX_STRING];
int aaIndex;
_ALTABILITY* aa = nullptr;
for (unsigned int i = 0; szPetBuff[i]; i++)
{
strcpy_s(szBuffer, szPetBuff[i]);
aaIndex = GetAAIndexByName(szBuffer);
if (aaIndex > 0)
{
aa = pAltAdvManager->GetAAById(aaIndex);
if (aa && GetSpellByID(aa->SpellID))
{
vPetBuff.push_back(GetSpellByID(aa->SpellID));
vPetBuffName.push_back(szBuffer);
}
}
}
int petSpellLevel = 0, [COLOR=lime]spirit = 0, iceflame = 0, aggression = 0, haste = 0, warder = 0, growl = 0[/COLOR];
PSPELL ppetSpell, pspirit, piceflame, paggression, phaste, pwarder, pgrowl;
customPetSpell = NULL;
if (strlen(CustomPetSpell) > 5)
if (GetSpellByName(CustomPetSpell))
{
customPetSpell = GetSpellByName(CustomPetSpell);
petSpell = customPetSpell;
vPet.push_back(petSpell);
}
for (unsigned int nSpell = 0; nSpell < NUM_BOOK_SLOTS; nSpell++)
{
if (PSPELL pSpell = GetSpellByID(GetCharInfo2()->SpellBook[nSpell]))
{
if (pSpell->Category == 69 && pSpell->Subcategory>97 && pSpell->Subcategory < 106 && pSpell->Subcategory != 101 && GetCharInfo()->pSpawn->mActorClient.Class != 12 && GetCharInfo()->pSpawn->mActorClient.Class != 2 && GetCharInfo()->pSpawn->mActorClient.Class != 6)
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > petSpellLevel && !customPetSpell)
{
petSpellLevel = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
ppetSpell = pSpell;
petSpell = pSpell;
}
}
if (GetSpellDuration(pSpell, (PSPAWNINFO)pLocalPlayer) < 3)
continue;
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Spirit of "))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > spirit)
{
spirit = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pspirit = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Empowered Minion"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > spirit)
{
spirit = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pspirit = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 70)
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > haste)
{
haste = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
phaste = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, " Warder"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > warder)
{
warder = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pwarder = pSpell;
}
}
/*
if(pSpell->Category==69 && pSpell->Subcategory==71 && strstr(pSpell->Name,"Growl of the"))
{
if(pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class]>growl)
{
growl=pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pgrowl=pSpell;
}
}
*/
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, " Aggression"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > aggression)
{
aggression = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
paggression = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Iceflame"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > iceflame)
{
iceflame = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
piceflame = pSpell;
}
}
}
}
if (petSpellLevel > 0)
vPet.push_back(ppetSpell);
if (haste)
{
vPetBuff.push_back(phaste);
vPetBuffName.push_back(phaste->Name);
}
if (growl)
{
vPetBuff.push_back(pgrowl);
vPetBuffName.push_back(pgrowl->Name);
}
if (iceflame)
{
vPetBuff.push_back(piceflame);
vPetBuffName.push_back(piceflame->Name);
}
if (warder)
{
vPetBuff.push_back(pwarder);
vPetBuffName.push_back(pwarder->Name);
}
if (aggression)
{
vPetBuff.push_back(paggression);
vPetBuffName.push_back(paggression->Name);
}
if (spirit)
{
vPetBuff.push_back(pspirit);
vPetBuffName.push_back(pspirit->Name);
}
if (!BardClass)
{
PSPELL pSpell;
for (unsigned int i = 0; i < NUM_SPELL_GEMS; i++)
{
pSpell = GetSpellByID(GetCharInfo2()->MemorizedSpells[i]);
if (pSpell)
{
if (pSpell->Category == 69 && pSpell->Subcategory == 10)
{
vPetBuff.push_back(pSpell);
vPetBuffName.push_back(pSpell->Name);
}
}
}
}
if (vPet.size())
{
WriteChatf("\awPetSpell: \a-t%s", vPet[0]->Name);
}
char szTemp[MAX_STRING] = { 0 }, szSpell[MAX_STRING];
strcpy_s(szSpell, "PetBuffIf");
if (GetPrivateProfileString(INISection, szSpell, NULL, szTemp, MAX_STRING, INIFileName))
{
SpellIf.insert(make_pair<string, string>(szSpell, szTemp));
SpellIt = SpellIf.find(szSpell);
if (SpellIt != SpellIf.end())
WriteChatf("PetBuffIf: %s", SpellIt->second.c_str());
}
for (unsigned int i = 0; i < vPetBuff.size(); i++)
{
sprintf_s(szSpell, "PetBuffIf%d", i);
WriteChatf("\awPetBuff%d: \a-t%s", i, vPetBuff[i]->Name);
if (GetPrivateProfileString(INISection, szSpell, NULL, szTemp, MAX_STRING, INIFileName))
{
SpellIf.insert(make_pair<string, string>(szSpell, szTemp));
SpellIt = SpellIf.find(szSpell);
if (SpellIt != SpellIf.end())
WriteChatf("PetBuffIf%d: %s", i, SpellIt->second.c_str());
}
}
if (!strstr(PetIllusionItem, "NULL"))
{
char test[MAX_STRING];
sprintf_s(test, "${If[${FindItem[%s].ItemSlot},1,0]}", PetIllusionItem);
ParseMacroData(test,MAX_STRING);
if (atoi(test) == 1)
{
sprintf_s(test, "${FindItem[%s].Spell.Name}", PetIllusionItem);
ParseMacroData(test,MAX_STRING);
if (GetSpellByName(test))
{
PetIllusionSpell = GetSpellByName(test);
WriteChatf("\awPet Illusion: \a-t%s", PetIllusionSpell->Name);
}
}
}
}
So like I said.. and easy way to ensure it doesnt cast during combat is:When I load mq2bot I only see 1 velocity and it has been PetBuff2 every time I have check
Pete the code might as well be Hindi I can't follow it and it makes my mind go numb. Fry spend over an hour a couple years ago holding my hand and trying to massage it into my skull to no real effect.
void CreatePetBuff()
{
if (!InGameOK())[COLOR="DarkOrange"]If I'm not in the game exit this function[/COLOR]
return;
if (BardClass)[COLOR="darkorange"]If I'm a bard exit this function[/COLOR]
return;
vPetBuff.clear();[COLOR="darkorange"]vPetBuff (class or struct) clear function[/COLOR]
vPetBuffName.clear();[COLOR="darkorange"]vPetBuffName(class or struct) clear function[/COLOR]
vPet.clear();[COLOR="darkorange"]vPet (what does the v stand for....OhhHHHHhHhh it's a vector...duh)[/COLOR]
petSpell = NULL; [COLOR="darkorange"]same as /varset petSpell NULL[/COLOR]
[COLOR="darkorange"]Here's it's shady...what is a PCHAR, what is an sz.
This is clearly the declaration of an array of the type PCHAR with it's initialization strings. [/COLOR]
PCHAR szPetBuff[] = { "Aegis of Kildrukaun", "Second Wind Ward", "Host in the Shell", "Hobble of Spirits", "Velocity", NULL };
[COLOR="darkorange"]a buffer for storage of strings of characters??[/COLOR]
char szBuffer[MAX_STRING];
int aaIndex;[COLOR="darkorange"]declared integer called aaIndex with no initialization value[/COLOR]
_ALTABILITY* aa = nullptr;[COLOR="darkorange"]_ALTABILITY* pointer as a type, var named aa set to nothing?[/COLOR]
for (unsigned int i = 0; szPetBuff[i]; i++)[COLOR="darkorange"]a for loop...obviously[/COLOR]
{
strcpy_s(szBuffer, szPetBuff[i]);[COLOR="darkorange"]strcpy copies the string from the first to the last...or is it the other way around?[/COLOR]
aaIndex = GetAAIndexByName(szBuffer);[COLOR="darkorange"]Finally initializing aaIndex but where the hell did GetAAIndex....oh it's a function,
it's using the buffer as a paramater...I missed the proto/dec for this so I'll just pretend I went and looked for it.[/COLOR]
if (aaIndex > 0)[COLOR="darkorange"]if the variable aaIndex initailized above with the function GetAAIndexByName(szBuffer); has a value greater than 1 do these things.[/COLOR]
{
aa = pAltAdvManager->GetAAById(aaIndex);[COLOR="DarkOrange"]aa = pAltAdvManager lamda's GetAAById(aaIndex)function[/COLOR]
if (aa && GetSpellByID(aa->SpellID))[COLOR="darkorange"]fucking lost me[/COLOR]
{
vPetBuff.push_back(GetSpellByID(aa->SpellID));[COLOR="darkorange"]shit just got real..vectorPetBuff calls the function to push_back with a function as a parameter which has a parameter of a lamda expression....wtf /lost[/COLOR]
[COLOR="darkorange"]Ok, my brain hurts. I'll stop here haha. [/COLOR]
vPetBuffName.push_back(szBuffer);
}
}
}
int petSpellLevel = 0, spirit = 0, iceflame = 0, aggression = 0, haste = 0, warder = 0, growl = 0;
PSPELL ppetSpell, pspirit, piceflame, paggression, phaste, pwarder, pgrowl;
customPetSpell = NULL;
if (strlen(CustomPetSpell) > 5)
if (GetSpellByName(CustomPetSpell))
{
customPetSpell = GetSpellByName(CustomPetSpell);
petSpell = customPetSpell;
vPet.push_back(petSpell);
}
for (unsigned int nSpell = 0; nSpell < NUM_BOOK_SLOTS; nSpell++)
{
if (PSPELL pSpell = GetSpellByID(GetCharInfo2()->SpellBook[nSpell]))
{
if (pSpell->Category == 69 && pSpell->Subcategory>97 && pSpell->Subcategory < 106 && pSpell->Subcategory != 101 && GetCharInfo()->pSpawn->mActorClient.Class != 12 && GetCharInfo()->pSpawn->mActorClient.Class != 2 && GetCharInfo()->pSpawn->mActorClient.Class != 6)
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > petSpellLevel && !customPetSpell)
{
petSpellLevel = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
ppetSpell = pSpell;
petSpell = pSpell;
}
}
if (GetSpellDuration(pSpell, (PSPAWNINFO)pLocalPlayer) < 3)
continue;
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Spirit of "))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > spirit)
{
spirit = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pspirit = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Empowered Minion"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > spirit)
{
spirit = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pspirit = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 70)
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > haste)
{
haste = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
phaste = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, " Warder"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > warder)
{
warder = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pwarder = pSpell;
}
}
/*
if(pSpell->Category==69 && pSpell->Subcategory==71 && strstr(pSpell->Name,"Growl of the"))
{
if(pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class]>growl)
{
growl=pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
pgrowl=pSpell;
}
}
*/
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, " Aggression"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > aggression)
{
aggression = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
paggression = pSpell;
}
}
if (pSpell->Category == 69 && pSpell->Subcategory == 71 && strstr(pSpell->Name, "Iceflame"))
{
if (pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class] > iceflame)
{
iceflame = pSpell->ClassLevel[GetCharInfo()->pSpawn->mActorClient.Class];
piceflame = pSpell;
}
}
}
}
if (petSpellLevel > 0)
vPet.push_back(ppetSpell);
if (haste)
{
vPetBuff.push_back(phaste);
vPetBuffName.push_back(phaste->Name);
}
if (growl)
{
vPetBuff.push_back(pgrowl);
vPetBuffName.push_back(pgrowl->Name);
}
if (iceflame)
{
vPetBuff.push_back(piceflame);
vPetBuffName.push_back(piceflame->Name);
}
if (warder)
{
vPetBuff.push_back(pwarder);
vPetBuffName.push_back(pwarder->Name);
}
if (aggression)
{
vPetBuff.push_back(paggression);
vPetBuffName.push_back(paggression->Name);
}
if (spirit)
{
vPetBuff.push_back(pspirit);
vPetBuffName.push_back(pspirit->Name);
}
if (!BardClass)
{
PSPELL pSpell;
for (unsigned int i = 0; i < NUM_SPELL_GEMS; i++)
{
pSpell = GetSpellByID(GetCharInfo2()->MemorizedSpells[i]);
if (pSpell)
{
if (pSpell->Category == 69 && pSpell->Subcategory == 10)
{
vPetBuff.push_back(pSpell);
vPetBuffName.push_back(pSpell->Name);
}
}
}
}
if (vPet.size())
{
WriteChatf("\awPetSpell: \a-t%s", vPet[0]->Name);
}
char szTemp[MAX_STRING] = { 0 }, szSpell[MAX_STRING];
strcpy_s(szSpell, "PetBuffIf");
if (GetPrivateProfileString(INISection, szSpell, NULL, szTemp, MAX_STRING, INIFileName))
{
SpellIf.insert(make_pair(szSpell, szTemp));
SpellIt = SpellIf.find(szSpell);
if (SpellIt != SpellIf.end())
WriteChatf("PetBuffIf: %s", SpellIt->second.c_str());
}
for (unsigned int i = 0; i < vPetBuff.size(); i++)
{
sprintf_s(szSpell, "PetBuffIf%d", i);
WriteChatf("\awPetBuff%d: \a-t%s", i, vPetBuff[i]->Name);
if (GetPrivateProfileString(INISection, szSpell, NULL, szTemp, MAX_STRING, INIFileName))
{
SpellIf.insert(make_pair(szSpell, szTemp));
SpellIt = SpellIf.find(szSpell);
if (SpellIt != SpellIf.end())
WriteChatf("PetBuffIf%d: %s", i, SpellIt->second.c_str());
}
}
if (!strstr(PetIllusionItem, "NULL"))
{
char test[MAX_STRING];
sprintf_s(test, "${If[${FindItem[%s].ItemSlot},1,0]}", PetIllusionItem);
ParseMacroData(test,MAX_STRING);
if (atoi(test) == 1)
{
sprintf_s(test, "${FindItem[%s].Spell.Name}", PetIllusionItem);
ParseMacroData(test,MAX_STRING);
if (GetSpellByName(test))
{
PetIllusionSpell = GetSpellByName(test);
WriteChatf("\awPet Illusion: \a-t%s", PetIllusionSpell->Name);
}
}
}
}
Future protip: Provide us a list of your debug log and a list of what spells you have. We dont know when something changes because none of the developers play the game. Looking up velocity in the database reveals that the mage AA was renamed to Velocity I and Velocity II. This means it probably isnt storing the AA correctly and is storing it as "Velocity." It also means the other pet buffs that were renamed are doing the same thing and spamming casting. Would be helpful if someone can confirm what the actual AA name is. Is it just "Velocity" or is it something else? If it is just "Velocity" then i am back to square one as to what would be causing the issue without knowing what buffs are on your pet. Additionally, if this is the only one that is messed up then just disable it because honestly who cares about pet runspeed when you are in a static camp.update on this very inconstant problem
I did a 6 hour grind yesterday. left mage on bot because when he is not his pet won't stay on target. I am fortunate to have a machine for each toon and I just kept jabbing the nuke button. pretty much one nuke a cast of velocity then another nuke.
without doing anything else he started functioning properly for the last half an hour. very frustrating