You are not logged in.

Applications: [GameMaster: OPEN] | [Volunteer Testers: OPEN]


This forum will be permanently shut down on Friday 13.07.2018
Please copy or save all important information from old forum before they will be deactivated
We have moved to new board. https://forum.runesofmagic.gameforge.com/Come join us.

1

Wednesday, January 18th 2012, 6:33pm

Quick Pet Verification

Does anyone know of an addon or macro that can give some quick visual verification (icon, etc.) that your pet is summoned? During large raids, it's often difficult to determine if my pet is summoned among the sea of people and pets. A small icon indicating he's present would be awesome, but I haven't found anything like that yet. Wondered if anyone knew of an existing or easy way to do this.

Eledhwen

<span style="color:green!important;"><b>Mentor</b></span>

  • "Eledhwen" has been banned

Posts: 319

Location: Beneath the streets of New York.

Occupation: Acting

  • Send private message

2

Wednesday, January 18th 2012, 7:18pm

pet

I had to change my pets name to an unique one thats easy to see.
Other then that I have no idea. I will ask around.

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

3

Wednesday, January 18th 2012, 11:51pm

Not an add-on, but this little macro (untested) should at least tell you if you have a pet.

Source code

1
/run if UnitExists("playerpet") then DEFAULT_CHAT_FRAME:AddMessage("You have a pet!") else DEFAULT_CHAT_FRAME:AddMessage("No pet!") end
2013... The year from hell....

4

Thursday, January 19th 2012, 8:44pm

Well, I had to make a few changes to make it work, and modified the concept a little. It will now say your pet is summoned if it is summoned or it will summon your pet if it is not. Substitute the slot number for your pet for (1) in the code below. Thanks for the help, Peryl. I would still be interested in a simple icon on the screen to show that the pet is summoned which is not present when it is not if anyone has the interest or inclination.

Source code

1
/run if (IsPetSummoned(1)) then DEFAULT_CHAT_FRAME:AddMessage("You have a pet!") else DEFAULT_CHAT_FRAME:AddMessage("Summoning pet") SummonPet(1) end

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

5

Friday, January 20th 2012, 3:56am

Okay, try this
[SIZE=-1]Disclaimer -- The following is completely untested. No guarantee it will work or even compile. I threw this together on a lark. Use at own risk. What did you expect for 20 minutes of work![/SIZE]

Might be a base for a better add-on. It currently doesn't save the icon position, nor does it save the pet slot number to use. The slash command for this thing is /summonapet

Further, I'm too lazy to zip things up into a proper add-on so I'm posting the code directly.

I call this thing SummonAPet so make a folder in your add-ons folder called that then create to text files inside this new folder. The first is called SummonAPet.toc and the other is SummonAPet.lua.

Here are the contents for each of these files:
[SIZE=+1]SummonAPet.toc[/SIZE]

Source code

1
SummonAPet.lua


[SIZE=+1]SummonAPet.lua[/SIZE]

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
--[[
    SummonAPet 
    
    Puts an clickable icon on screen if your pet is not 
    present and summons it.
    
    TODO/Improvements:
        - Either save current slot (easy) or add more buttons/icons
          to allow summoning different pets if available. (harder)
        - Use proper icon for pet (currently just using a stand-in)
        - Checks for valid pet slots in slash command handler
          (only needed if using one slot)
        - Save icon position
--]]


--[[ Constants ]]--
local ADDON_NAME = "SummonAPet"
local ADDON_SLASH_CMD = "/summonapet"




--[[ Addon variables ]]--
local SummonAPetSlot = 1     -- Slot to use for pet summoning
local AddonReady = false    -- Gets set to true once addon fully loaded




--[[ Addon namespace ]]--
local SummonAPet = {}
_G.SummonAPet = SummonAPet




--[[ Base frame for icon button ]]--
SummonAPet.Frame = CreateUIComponent("Frame", "SummonAPetFrame", "UIParent")
_G.SummonAPetFrame = nil -- trash global created by CreateUIComponent
SummonAPet.Frame:SetSize(32,32)
SummonAPet.Frame:ClearAllAnchors()
SummonAPet.Frame:SetAnchor("LEFT", "LEFT", "UIParent", 20, 0)
SummonAPet.Frame:SetAlpha(1.0)
SummonAPet.Frame:SetMouseEnable(true)
SummonAPet.Frame:SetScripts("OnLoad", [=[ SummonAPet.LoadHandler(this) ]=])
SummonAPet.Frame:SetScripts("OnClick", [=[ SummonAPet.ClickHandler(this) ]=])
SummonAPet.Frame:SetScripts("OnUpdate", [=[ SummonAPet.UpdateHandler(this, elapsedTime) ]=])
SummonAPet.Frame:SetScripts("OnMouseDown", [=[ SummonAPet.MouseDownHandler(this, key) ]=])
SummonAPet.Frame:SetScripts("OnMouseUp", [=[ SummonAPet.MouseUpHandler(this, key) ]=])




--[[ Create a texture for the icon/button ]]--
SummonAPet.Texture = CreateUIComponent("Texture", "SummonAPetIcon", "SummonAPetFrame")
_G.SummonAPetIcon = nil
SummonAPet.Texture:SetTexture("interface/icons/boss_skill/skill_boss_skill_76")  -- Generic texture
SummonAPet.Texture:SetColor(1.0, 1.0, 1.0);
SummonAPet.Texture:SetSize(32,32);
SummonAPet.Texture:SetAlpha(1.0);
SummonAPet.Texture:SetAlphaMode("BLEND");
SummonAPet.Texture:ClearAllAnchors();
SummonAPet.Texture:SetAnchor("CENTER", "CENTER", SummonAPet.Frame, 0, 0);
SummonAPet.Frame:SetLayers(2,SummonAPet.Texture)



--[[ The Addon functions ]]--
function SummonAPet.LoadHandler(self)
    DEFAULT_CHAT_FRAME:AddMessage("['..ADDON_NAME..'] loaded. Use "..ADDON_SLASH_CMD.." for help.",1,1,1)
    DEFAULT_CHAT_FRAME:AddMessage("Right-click icon with mouse to position it.",1,1,1)
end


function SummonAPet.ClickHandler(self)
    SummonPet(SummonAPetSlot)
end


function SummonAPet.UpdateHandler(self, elapsed)
    if IsPetSummoned(SummonAPetSlot) then
        -- pet exists, so hide the icon and make button unclickable
        SummonAPet.Frame:SetMouseEnable(false)
        SummonAPet.Texture:SetAlpha(0)
    else
        -- no pet, so show the icon and make button clickable
        SummonAPet.Frame:SetMouseEnable(true)
        SummonAPet.Texture:SetAlpha(1.0)    
    end
end


function SummonAPet.MouseDownHandler(self, key)
    if key == "RBUTTON" then
        SummonAPet.Frame:StartMoving("CENTER")
    end
end


function SummonAPet.MouseUpHandler(self, key)
    SummonAPet.Frame:StopMovingOrSizing()
end




--[[ Define the slash command handler ]]--
_G['SLASH_'..ADDON_NAME..'1'] = ADDON_SLASHCMD
SlashCmdList[ADDON_NAME] = function (ebox, msg)
    if not msg or msg == "" then
        DEFAULT_CHAT_FRAME:AddMessage("Usage: "..ADDON_SLASH_CMD.." <pet slot number>",1,1,1);
        DEFAULT_CHAT_FRAME:AddMessage("where <pet slot number> is the pet's slot number to use for summoning. Default is 1.",1,1,1)
    else
        local petslot = tonumber((msg or ""))
        
        if petslot < 1 then
            petslot = 1
        end
        SummonAPetSlot = petslot
        DEFAULT_CHAT_FRAME:AddMessage("['..ADDON_NAME..'] Pet slot for summoning set to "..petslot,1,1,1)
    end
end


Enjoy. (if it works that is)

Edit
Fixed a bug (had SetSetAnchor D'oh!) and added a missing call to set the texture to a frame layer (D'oh again!).
2013... The year from hell....

Amberwave

Intermediate

Posts: 369

Location: Chicagoland

  • Send private message

6

Friday, January 20th 2012, 4:03pm

I can tell if my pet is summoned or not by the difference in my health.

7

Friday, January 20th 2012, 6:53pm

Thanks Peryl, I'll give it a test run. @Amber, there are so many combinations of HP buffs during a run, that it is often difficult to use my HP as the indicator.

Edit: It brought up a blank window with a blank drop down, but it didn't summon a pet. It also appeared to disable/conflict with TitleSelect. Thanks for the try, Peryl.

8

Saturday, January 21st 2012, 7:18am

Quoted from "Ozmondius;503504"

Edit: It brought up a blank window with a blank drop down, but it didn't summon a pet. It also appeared to disable/conflict with TitleSelect.
I'm guessing an error at load time. Since add-ons are loaded in alphabetical order, 'T' and beyond would be interfered with. As the author of TitleSelect, I can safely say that nothing here would foul that specific add-on.
Add-on author (retired, but continuing maintenance)

Peryl

Intermediate

Posts: 313

Location: Elsewhere

  • Send private message

9

Sunday, January 22nd 2012, 11:44pm

Fixed a couple of stupid bugs I should have noticed earlier. Might want to try it again. I'm leaving it as it is now so if anyone else wants to take a stab at it. Go ahead.
2013... The year from hell....