Guys,
I extended the pettoys feature to produce pet for a single targeted pet, or for all the group's pet.
- Pet toys: ability to request pettoys on demand for any pet.
syntax /pettoysplz ${Target.CleanName}
- Pet toys: ability to request pettoys for all group's pets.
syntax /pettoysplz GROUP
Here are the codes changes, that valid for version 7.6.7
1 Event declaration
2 alias declaration
3 add the argument ${Me.Pet.CleanName} to the sub PetToys when needed
i.e :
4 Add the fuction Event_PetToysPlease(
5 Change the fuction Sub PetToys as follow
I extended the pettoys feature to produce pet for a single targeted pet, or for all the group's pet.
- Pet toys: ability to request pettoys on demand for any pet.
syntax /pettoysplz ${Target.CleanName}
- Pet toys: ability to request pettoys for all group's pets.
syntax /pettoysplz GROUP
Here are the codes changes, that valid for version 7.6.7
1 Event declaration
Rich (BB code):
#Event PetToysPlease "#*#PetToysPlease #1#"
2 alias declaration
Rich (BB code):
/squelch /alias /pettoysplz /echo PetToysPlease
3 add the argument ${Me.Pet.CleanName} to the sub PetToys when needed
i.e :
Rich (BB code):
replace /call PetToys by /call PetToys ${Me.Pet.CleanName}
4 Add the fuction Event_PetToysPlease(
Rich (BB code):
| -------------------------------------------------------------------------------------
| SUB: Event PetToysPlease
| -------------------------------------------------------------------------------------
Sub Event_PetToysPlease(Message,string MTPet)
/declare zPetID int local
/declare zID int local
/declare zShortName string local
/declare zPetName string local
/declare i int local 0
/declare PetToysTemp string local
/varset PetToysTemp string local ${Ini[${IniFileName},Pet,PetToysGave]}
/if (!${MTPet.Length} || ${MTPet.Find[null]}) /return
/if (${MTPet.Find[GROUP]}) {
/echo pet toys on group's pets
/for i 0 to ${Group}
/varset zID ${Group.Member[${i}].ID};
/varset zPetID ${Group.Member[${i}].Pet.ID}
/varset zShortName ${Spawn[${zID}].Class.ShortName}
/varset zPetName ${Group.Member[${i}].Pet.CleanName}
/echo ${zID} && ${zPetID} && ${Select[${zShortName},shm,nec,mag,bst,dru,enc,shd]} && ${Spawn[${zPetName}].Type.Equal[Pet]}
/if (${zID} && ${zPetID} && ${Select[${zShortName},shm,nec,mag,bst,dru,enc,shd]} && ${Spawn[${zPetName}].Type.Equal[Pet]}) {
/if (${PetToysOn}) /call pettoys ${zPetName}
/if (${Spawn[${zPetName}].ID} != ${Me.Pet.ID} ) {
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
} else {
/varset PetToysTemp string local ${Ini[${IniFileName},Pet,PetToysGave]}
}
}
/next i
} else {
/if (!${Spawn[${MTPet}].Type.Equal[Pet]}) /return
/echo doing pet toys ${MTPet}.
/varset PetToysTemp string local ${Ini[${IniFileName},Pet,PetToysGave]}
/ini "${IniFileName}" "Pet" "PetToysGave" "0"
/if (${PetToysOn}) /call pettoys ${MTPet}
/if (${Spawn[${MTPet}].ID} != ${Me.Pet.ID} ) /ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
/return
Rich (BB code):
| ----------------------------------------------------------------------------
| SUB: Check PetToys - Based on code from el_nene's autobot. Used with permission.
| Autobot is available at www.Macroquest2.com VIP macro section.
| ----------------------------------------------------------------------------
Sub PetToys(string petName)
/if (${DebugBuffs}) /echo DEBUGBUFFS PetToys leave
/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 GaveItem int local 1
/call OpenInvSlot
/declare petID string local ${Spawn[${petName}].ID}
/if (${BagNum}==0) {
/echo You must have an empty Top Inventory slot for Pet Toys to work.
/varset PetToysOn 0
/return
}
/if (!${InvSlot[pack${BagNum}].Item.Container} && !${Me.FreeInventory}) {
/echo Inventory is full
/varset PetToysOn 0
/return
}
| reset if different pet name
/if (!${PetToysTemp.Find[${petName}]}) {
/ini "${IniFileName}" "Pet" "PetToysGave" "0"
/varset PetToysTemp ${Ini[${IniFileName},Pet,PetToysGave]}
}
/for i 1 to ${PetToys.Size}
/if (${DebugBuffs}) {
/echo DEBUGBUFFS PetToys 1: ${PetToys[${i}]}
/echo DEBUGBUFFS PetToys 2: ${PetToysTemp}
/echo DEBUGBUFFS PetToys 3: ${PetToys[${i}].Equal[Null]} || ${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToys[${i}]}]})
}
/if (${PetToys[${i}].Equal[Null]} || (${PetToysTemp.Find[${petName}]} && ${PetToysTemp.Find[${PetToys[${i}]}]})) /goto :SkipPetToy
| Are we handing weapons to the pet
/if (${PetToys[${i}].Arg[2,|].Length}) {
/varset FullText ${PetToys[${i}]}
/varset PetToySpell ${PetToys[${i}].Arg[1,|]}
/varset 2ndPart ${PetToys[${i}].Arg[2,|]}
/varset 3rdPart ${PetToys[${i}].Arg[3,|]}
} else {
/varset PetToySpell ${PetToys[${i}]}
}
/if (${2ndPart.Length} && ${PetToysTemp.Find[${2ndPart}1]} || ${3rdPart.Length} && ${PetToysTemp.Find[${3rdPart}2]}) /goto :SkipPetToy
| Check for pet toy spells in book to prevent double casting of items
/if (${Me.Book[${PetToySpell}]}) {
/call CastWhat "${PetToySpell}" ${Me.ID} Pet
/if (!${PetToysTemp.Find[${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 100 ${Cast.Ready[${PetToySpell}]}
/delay 5s ${Cursor.ID}
/if (!${Cursor.ID}) /return
| 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${i}].Item.ID}) /nomodkey /itemnotify pack${BagNum} leftmouseup
:Unfolded
/delay 2s ${Cursor.ID}
| Drop exchanged item into inventory
/autoinventory
/delay 1s
| 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
| Return to top to drop bag into inventory
/goto :Unfolded
}
}
/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
/if (${DebugBuffs}) /echo DEBUGBUFFS PetToys ${i} ${PetToySpell} ${2ndPart} ${3rdPart}
/if (${2ndPart.Length} && ${FindItemCount[${2ndPart}]} && !${PetToysTemp.Find[${2ndPart}1]}) {
/call GiveTo "${2ndPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${2ndPart}1
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
/if (${3rdPart.Length} && ${FindItemCount[${3rdPart}]} && !${PetToysTemp.Find[${3rdPart}2]}) {
/call GiveTo "${3rdPart}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}:${3rdPart}2
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
/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}]}) {
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/ini "${IniFileName}" "Pet" "PetToysGave" "${PetToysTemp}"
}
}
}
/if (${Cursor.Name.Find[Summoned:]}) {
/call GiveTo "${Cursor.Name}" ${petID}
/varset PetToysTemp ${PetToysTemp}|${PetToySpell}
/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
/goto :SkipPetToy
}
:SkipPetToy
| Reset spell vars
/if (${FullText.Arg[2,|].Length}) {
/varset FullText
/varset 2ndPart
/varset 3rdPart
}
/if (!${PetToysOn}) /return
/next i
/if (${Window[InventoryWindow].Open} && !${GaveItem}) /keypress inventory
/varset PetToysDone 1
/if (${DebugBuffs}) /echo DEBUGBUFFS PetToys LEAVE
/return

