Page 1 of 1

any cmd for detecting pet? [solved]

Posted: Wed Dec 12, 2012 11:04 am
by botje
is there anything i can use to see if my alt has a pet, so i can enable pet assist accordinly?

Re: any cmd for detecting pet?

Posted: Wed Dec 12, 2012 11:21 am
by rock5
You can use the eggpet class. This checks the first 3 slots.

Code: Select all

local pet
for i = 1,3 do
    pet = CEggPet(i)
    if pet.EggId ~= 0 then
        break
    end
end
if pet.EggId == 0 then
    settings.profile.options.EGGPET_ENABLE_ASSIST = false
else
    settings.profile.options.EGGPET_ENABLE_ASSIST = true
    settings.profile.options.EGGPET_ASSIST_SLOT = i
end

Re: any cmd for detecting pet? [solved]

Posted: Wed Dec 12, 2012 11:27 am
by botje
very nice ^^

im always amazed how easy you pull these things out of your hat xd

thanx rock :)

Re: any cmd for detecting pet?

Posted: Wed Dec 12, 2012 11:37 am
by rock5
Well it helps that I wrote the eggpet class and I know the options. :D

Re: any cmd for detecting pet?

Posted: Wed Dec 12, 2012 11:57 am
by botje
true true xd

Re: any cmd for detecting pet? [solved]

Posted: Wed Dec 12, 2012 4:10 pm
by botje
hmm. does'nt work O.o

keeps printing cant find id etc

i used it in onload profile

Re: any cmd for detecting pet?

Posted: Wed Dec 12, 2012 5:17 pm
by lisa
rock5 wrote:You can use the eggpet class. This checks the first 3 slots.

Code: Select all

local pet
for i = 1,3 do
    pet = CEggPet(i)
    if pet.EggId ~= 0 then
        break
    end
end
if pet.EggId == 0 then
    settings.profile.options.EGGPET_ENABLE_ASSIST = false
else
    settings.profile.options.EGGPET_ENABLE_ASSIST = true
    settings.profile.options.EGGPET_ASSIST_SLOT = i
end
that is for your own egg pet, he means another character's eggpet.

If you know the name of it's pet you could do a "scan" of objects for it's name I guess. Not sure if there is any indicator for who the pet belongs to, maybe the name also says the owner in memory?

<Joes pet Shadow>
Joe being character's name, Shadow being pet's name. Worth checking out.

Re: any cmd for detecting pet? [solved]

Posted: Wed Dec 12, 2012 6:37 pm
by botje
no, i actually mean my own pet, so i can enable it.

Re: any cmd for detecting pet? [solved]

Posted: Wed Dec 12, 2012 8:35 pm
by lisa
botje wrote:no, i actually mean my own pet, so i can enable it.
ohh well in that case we should fix rock's code lol

Code: Select all

local pet
for i = 1,3 do
    pet = CEggPet(i)
    if pet.EggId ~= 0 then
        break
    end
end
if pet.EggId == 0 then
    settings.profile.options.EGGPET_ENABLE_ASSIST = false
else
    settings.profile.options.EGGPET_ENABLE_ASSIST = true
    settings.profile.options.EGGPET_ASSIST_SLOT = pet.EggSlot
end

Re: any cmd for detecting pet?

Posted: Wed Dec 12, 2012 10:14 pm
by rock5
As usual. :D :oops:

Re: any cmd for detecting pet?

Posted: Thu Dec 13, 2012 3:09 am
by botje
thanx :P