• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Fork / Mod PetToys Fix - Pet wranglers rejoice?

AmericanNero

Seasoned veteran member
Joined
Oct 13, 2020
RedCents
4,709¢
If you use pets like I do, you need them to be geared. I use mine to tank and offtank (sk/war/pal ptooi). My team is pet heavy, so anything wonky with pettoys is noticed. At 115, the 2 spells that a mage equips their pet with are Grant Yalrek's Armaments and Grant Crystasia's Heirlooms. PetToys works fine to equip weapons, but attempts give all 6 of the heirlooms even though a 115 level pet can only equip the bottom 4 which results in two reject messages. Kinda embarassing if you are around other people who know mages.

If you also support other pets with pettoysplz, you notice that you can safely add Grant Visor of Shoen to your PetToys list (it won't try to give them to the mage pet), but, if you also want to provide Grant Ocoenydd's Plate... the sub doesn't recognize that the mage pet can't equip those and persists in trying to give that to the mage pet... and reject messages ensue, also an embarassment and time waster.

Finally, there is no provision in the code to give different weapons to the mage pet separate from other pets. Because I MT / OT with my pets, I use the rageswords, but we don't want to give those to other pets. A water pet you'd want to give dps weaps and right now you have to comment out PetToys (see my ini at bottom). Other pet wrangler classes may want hate swords, but those are an exception. Almost everyone just wants dps.

Thus, there are three needs that seem to conflict within PetToys:

1) Equip the mages pet with one set of gear, in particular, make a difference between equipping an earth pet vs others
2) Equip another pet, such as water appropriately
3) Equip other characters pets appropriately

I've provided fixes that make this work.

Plate Fix
The offending line in KA that I added the missing condition to is line 4571. Just paste the new line over the old and no more plate issues with mage pets.

[CODE title="Plate old busted"]
| Check if spell level less than 76 because mage pets auto equipped after that.
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${Spell[${PetToySpell}].Level}>=76 && (${PetToySpell.Find[muzzle]} || ${PetToySpell.Find[visor]} || ${PetToySpell.Find[belt]})) /continue
[/CODE]

[CODE title="Plate new hotness" highlight="2-5"]
| Check if spell level less than 76 because mage pets auto equipped after that.
|||
||| Added plate
|||
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${Spell[${PetToySpell}].Level}>=76 && (${PetToySpell.Find[muzzle]} || ${PetToySpell.Find[visor]} || ${PetToySpell.Find[belt]} || ${PetToySpell.Find[plate]})) /continue
[/CODE]

Heirlooms Fix
Another fix to PetToys resolves the heirlooms issue, copy and paste:

[CODE title="Before Heirloom fix"]
/if (!${2ndPart.Length}) {
/for j 0 to ${InvSlot[pack${BagNum}].Item.Container}
/if (${InvSlot[pack${BagNum}].Item.Item[${j}].ID} && ${InvSlot[pack${BagNum}].Item.Item[${j}].Name.Length}) {
/call GiveTo "${InvSlot[pack${BagNum}].Item.Item[${j}].Name}" ${petID}
}
/delay 10
/next j
/if (${j}>=8 && !${PetToysTemp.Find[${PetToySpell}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
}

[/CODE]


[CODE title="With Heirloom fix" highlight="3-6"] /if (!${2ndPart.Length}) {
/for j 0 to ${InvSlot[pack${BagNum}].Item.Container}
|||
||| Heirlooms 1 & 2 skipped for mage pet, relevant for 105+. Lower level mage pets can have fewer... this will do for majority of situations
|||
/if (${PetToySpell.Find[heirloom]} && ${Me.Pet.CleanName.Equal[${petName}]} && ${j}<3) /continue
/if (${InvSlot[pack${BagNum}].Item.Item[${j}].ID} && ${InvSlot[pack${BagNum}].Item.Item[${j}].Name.Length}) {
/call GiveTo "${InvSlot[pack${BagNum}].Item.Item[${j}].Name}" ${petID}
}
/delay 10
/next j
/if (${j}>=8 && !${PetToysTemp.Find[${PetToySpell}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
}
[/CODE]

Weapons Fix
What I decided was to reserve PetToys1 for a mages earth pet. PetToys2 is for all other pets, such as water, and for pettoysplz.

The old code block begins on line 4534:

[CODE title="Old loop check"] /for i 1 to ${PetToys.Size}
DEBUGPET CHECKING: ${i} - ${PetToys[${i}]}
/if (${ConOn} && ${PetToys[${i}].Find[|cond]}) {
/varset CondNo ${PetToys[${i}].Mid[${Math.Calc[${PetToys[${i}].Find[|cond]}+5]},3]}
} else {
/varset CondNo 0
}
[/CODE]

With the fix:

[CODE title="Update to allow multiple weapons options" highlight="3-8"] /for i 1 to ${PetToys.Size}
DEBUGPET CHECKING: ${i} - ${PetToys[${i}]}
|||
||| Reserving PetToys1 for my earth mage pet hate weaps
||| Reserving PetToys2 for all other types of pets weaps
|||
/if ( ${i}==1 && ((${Me.Pet.CleanName.Equal[${petName}]} && !${PetSpell.Find[earth]}) || !${Me.Pet.CleanName.Equal[${petName}]}) ) /continue
/if ( ${i}==2 && (${Me.Pet.CleanName.Equal[${petName}]} && ${PetSpell.Find[earth]}) ) /continue
/if (${ConOn} && ${PetToys[${i}].Find[|cond]}) {
/varset CondNo ${PetToys[${i}].Mid[${Math.Calc[${PetToys[${i}].Find[|cond]}+5]},3]}
} else {
/varset CondNo 0
}
[/CODE]

Example INI

[CODE lang="ini" title="Pet block"][Pet]
PetOn=1
PetSpell=Manifestation of Earth
;PetSpell=Manifestation of Water
PetFocus=Summoner's Velium Enhanced Earring
PetShrinkOn=1
PetShrinkSpell=Diminutive Companion
PetBuffsOn=1
PetBuffsSize=5
PetBuffs1=Metamorph Wand - Blaster Steam Suit Pilot
;Petbuffs1=Metamorph Totem: Vitrik
PetBuffs2=Iceflame Rampart
PetBuffs3=Companion's Aegis
PetBuffs4=Auspice of Kildrukaun
PetBuffs5=Burnout XIV
;PetBuffs6=Velocity

PetCombatOn=1
PetAssistAt=100
PetAttackDistance=50
PetToysOn=1
PetToysSize=5

| For tank pet you would want rageswords, and bottom 4 Crystasia's Heirlooms
| You hand the pet armor before heirlooms otherwise it kicks back a bracelet

| Mage pets only use weaps and heirlooms
| All other pets use weaps, heirlooms, armor, and visor

; Weapon Types
; Summoned: Silver Ragesword
; Summoned: Silver Fireblade
; Summoned: Silver Iceblade
; Summoned: Silver Shortsword
; Summoned: Silver Mindblade

; PetToys1 will be the mages earth weaps
PetToys1=Grant Yalrek's Armaments|Summoned: Silver Ragesword|Summoned: Silver Ragesword
;PetToys1=Grant Yalrek's Armaments|Summoned: Silver Fireblade|Summoned: Silver Ragesword
; PetToys2 will be all other pet types, including pettoysplz
PetToys2=Grant Yalrek's Armaments|Summoned: Silver Fireblade|Summoned: Silver Iceblade

; These are for non-mage pets
PetToys3=Grant Visor of Shoen
PetToys4=Grant Ocoenydd's Plate

; Mage pets can only use the bottom 4, so we will skip those internally, looking for keyword heirloom
PetToys5=Grant Crystasia's Heirlooms

PetToysGave=
PetBreakMezSpell=Riotous Servant
PetRampPullWait=0
PetSuspend=0
MoveWhenHit=1
PetHoldOn=1
PetForceHealOnMed=0[/CODE]

If you don't want to copy and paste individual code blocks, here is the entire PetToys sub.

[CODE title="Updated Sub PetToys" highlight="42-47,83-86,140-143"]| ----------------------------------------------------------------------------
| SUB: Check PetToys - Based on code from el_nene's autobot. Used with permission.
| Autobot is available at www.Macroquest2.com VIP macro section.
| Updated and Revised for KissAssist - Further tinkered with by American Nero
| ----------------------------------------------------------------------------
Sub PetToys(string petName)
/if (!${Me.Pet.ID}) /return w
DEBUGPET PetToys Enter
/declare i int local
/declare j int local
/declare GrabItem int local 0
/declare PetToySpell string local 0
/declare FullText string local
/declare 2ndPart string local
/declare 3rdPart string local
/declare PetToysTemp string local ${Ini[${IniFileName},Pet,PetToysGave]}
/declare PetToyCheck string local
/declare GaveItem int local 1
/declare CondNo int local 0
/varset BagNum 0
/call OpenInvSlot
/declare petID int local ${Spawn[pet ${petName}].ID}
/if (!${Defined[PetToysOn]}) /return
/if (!${PetToysOn}) /return 0
/if (${BagNumLast}==99) {
/echo Inventory is full
/varset PetToysOn 0
/return X
}
/if (${BagNum}==0) {
/echo You must have an empty Top Inventory slot for Pet Toys to work.
/varset PetToysOn 0
/return X
}
| reset if different pet name only on my pet
/if (!${PetToysTemp.Find[${petName}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/ini "${IniFileName}" "Pet" "PetToysGave" "0"
/varset PetToysTemp 0
}
/for i 1 to ${PetToys.Size}
DEBUGPET CHECKING: ${i} - ${PetToys[${i}]}
|||
||| Reserving PetToys1 for my earth mage pet hate weaps
||| Reserving PetToys2 for all other types of pets weaps
|||
/if ( ${i}==1 && ((${Me.Pet.CleanName.Equal[${petName}]} && !${PetSpell.Find[earth]}) || !${Me.Pet.CleanName.Equal[${petName}]}) ) /continue
/if ( ${i}==2 && (${Me.Pet.CleanName.Equal[${petName}]} && ${PetSpell.Find[earth]}) ) /continue
/if (${ConOn} && ${PetToys[${i}].Find[|cond]}) {
/varset CondNo ${PetToys[${i}].Mid[${Math.Calc[${PetToys[${i}].Find[|cond]}+5]},3]}
} else {
/varset CondNo 0
}
/if (${DebugPet}) {
/echo \atPetDebug PetToys 1: ${PetToys[${i}]}
/echo \atPetDebug PetToys 2: ${PetToysTemp}
/echo \atPetDebug PetToys 3: ${PetToys[${i}].Equal[Null]} || ${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToys[${i}]}]}
/echo \atPetDebug PetToys 4: ${If[${CondNo},${Cond[${CondNo}]},0]}
}
/if (${CondNo}) {
/if (${If[${Cond[${CondNo}]},0,1]}) /continue
}
| Had to add pet name check else it will always skip giving weapons to OTHER pets.
DEBUGPET PetToys ${i} ${PetToys[${i}].Equal[Null]} SkipPetToy 1
/if (${PetToys[${i}].Equal[Null]}) /continue
| Are we handing weapons to the pet
/if (${PetToys[${i}].Arg[2,|].Length} && ${PetToys[${i}].Arg[2,|].NotEqual[null]}) {
/varset FullText ${PetToys[${i}]}
/varset PetToySpell ${PetToys[${i}].Arg[1,|]}
/varset 2ndPart ${PetToys[${i}].Arg[2,|]}
/varset 3rdPart ${PetToys[${i}].Arg[3,|]}
/varset PetToyCheck :${2ndPart}1
} else {
/varset FullText
/varset PetToySpell ${PetToys[${i}]}
/varset 2ndPart
/varset 3rdPart
/varset PetToyCheck ${PetToySpell}:
}
DEBUGPET PetToys ${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${PetToysTemp.Find[1]} && ${PetToysTemp.Find[2]} SkipPetToy 2
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToyCheck}]}) /continue
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${PetToysTemp.Find[1]} && ${PetToysTemp.Find[2]}) /continue
| Check if spell level less than 76 because mage pets auto equipped after that.
|||
||| Added plate
|||
/if (${Me.Pet.CleanName.Equal[${petName}]} && ${Spell[${PetToySpell}].Level}>=76 && (${PetToySpell.Find[muzzle]} || ${PetToySpell.Find[visor]} || ${PetToySpell.Find[belt]} || ${PetToySpell.Find[plate]})) /continue
| Check for pet toy spells in book to prevent double casting of items
/if (${Me.Book[${PetToySpell}]}) {
/call CastWhat "${PetToySpell}" ${Me.ID} Pet-nomem 0 0
/if (!${PetToysTemp.Find[${petName}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/ini "${IniFileName}" "Pet" "PetToysGave" "${petName}"
/varset PetToysTemp ${Ini[${IniFileName},Pet,PetToysGave]}
}
/if (${Macro.Return.Equal[CAST_SUCCESS]}) {
/echo Casting pet toy spell >> ${PetToySpell} <<
}

/delay 15s ${Cursor.ID}
/if (!${Cursor.ID}) /return 0
| Check if spell has summoned a bag or folded pack
/if (${Cursor.Container} || ${Cursor.Name.Find[Folded]}) {
| If item is in Inv Slot exchange it with bag on cursor
/if (${InvSlot[pack${BagNum}].Item.ID}) /nomodkey /itemnotify pack${BagNum} leftmouseup
/while (1) {
/delay 2s ${Cursor.ID}
| Drop bag or item into inventory
/autoinventory
/delay 1s
| Drop exchanged item into inventory after bag is dropped
/if (${Cursor.ID}) /autoinventory
| If folded pack right click to convert to phantom satchel
/if (${InvSlot[pack${BagNum}].Item.Name.Find[folded]}) {
/nomodkey /itemnotify pack${BagNum} rightmouseup
/echo Opening ${InvSlot[pack${BagNum}].Item.Name}
/delay 3s
} else {
/break
}
}
}
/if (${InvSlot[pack${BagNum}].Item.Container} && (${InvSlot[pack${BagNum}].Item.Name.Find[Phantom Satchel]} || ${InvSlot[pack${BagNum}].Item.Name.Find[Pouch of Quellious]})) {
| Open the bag
/nomodkey /itemnotify pack${BagNum} rightmouseup
/delay 10
DEBUGPET PetToys ${i} - ${PetToySpell} - ${2ndPart} - ${3rdPart} - ${BagNum} - ${PetToysTemp}
| Condition revised to allow for pet weapons to be given to other people's pets.
/if (((${Me.Pet.CleanName.Equal[${petName}]} && !${PetToysTemp.Find[${2ndPart}1]}) && ${2ndPart.Length} && ${FindItemCount[=${2ndPart}]}) || (!${Me.Pet.CleanName.Equal[${petName}]} && ${2ndPart.Length} && ${FindItemCount[=${2ndPart}]})) {
/call GiveTo "${2ndPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}1
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
| Condition revised to allow for pet weapons to be given to other people's pets.
/if (((${Me.Pet.CleanName.Equal[${petName}]} && !${PetToysTemp.Find[${3rdPart}2]}) && ${3rdPart.Length} && ${FindItemCount[=${3rdPart}]}) || (!${Me.Pet.CleanName.Equal[${petName}]} && ${3rdPart.Length} && ${FindItemCount[=${3rdPart}]})) {
/call GiveTo "${3rdPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${3rdPart}2
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
/if (!${2ndPart.Length}) {
/for j 0 to ${InvSlot[pack${BagNum}].Item.Container}
|||
||| Heirlooms 1 & 2 skipped for mage pet, relevant for 105+. Lower level mage pets can have fewer... this will do for majority of situations
|||
/if (${PetToySpell.Find[heirloom]} && ${Me.Pet.CleanName.Equal[${petName}]} && ${j}<3) /continue
/if (${InvSlot[pack${BagNum}].Item.Item[${j}].ID} && ${InvSlot[pack${BagNum}].Item.Item[${j}].Name.Length}) {
/call GiveTo "${InvSlot[pack${BagNum}].Item.Item[${j}].Name}" ${petID}
}
/delay 10
/next j
/if (${j}>=8 && !${PetToysTemp.Find[${PetToySpell}]} && ${Me.Pet.CleanName.Equal[${petName}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
}
}
/if (${Cursor.Name.Find[Summoned:]}) {
/if (${2ndPart.Length} && !${PetToysTemp.Find[1]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}1
} else /if (${2ndPart.Length} && ${PetToysTemp.Find[1]} ) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}2
} else /if (!${2ndPart.Length} && !${PetToysTemp.Find[${PetToySpell}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${Cursor.Name}
}
/call GiveTo "${Cursor.Name}" ${petID}
/if (${Me.Pet.CleanName.Equal[${petName}]}) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
/varset GaveItem 0
}
/if (${InvSlot[pack${BagNum}].Item.Name.Find[Phantom Satchel]} || ${InvSlot[pack${BagNum}].Item.Name.Find[Pouch of Quellious]}) /call DestroyBag
}
/next i
| MUST reset PetToysGave after cycle complete in order to stop calling PetToys all the time.
/varset PetToysGave ${PetToysTemp}
/if (${Window[InventoryWindow].Open} && !${GaveItem}) /keypress inventory
/varset PetToysDone 1
/call DoWeMove ${ReturnToCamp} PetToys
DEBUGPET PetToys Leave
/return[/CODE]
 
Last edited:
Fork / Mod PetToys Fix - Pet wranglers rejoice?

Users who are viewing this thread

Back
Top
Cart