#Summon tracker (counter)

6 messages · Page 1 of 1 (latest)

coarse patio
#

Im trying to make a weakaura which tracks the amount of times Ive summoned the specific player. When I summon someone it automaticly shows me how many times Ive summoned that specific person.

Example:
When I cast summon on a new player the weakaura says in raid warning:
"Welcome [target name]. your first summon is coming right up. Please pay (insert price) on arrival", and the name shall be logged into a database of some sort.

Next time I summon that player it should say in raid warning:
"Welcome back [target name], this is your second summon! Next one is free!"

Third summon shall then be in raid warning:
"Welcome [target name], this is your third and therefor free summon!"

Is this possible?

young torrent
coarse patio
young torrent
# coarse patio It would be prefered that its saved over multiple days if that's possible

Yes it is possible, using the (relatively) new aura_env.saved variable extremely briefly discussed here

Not sure what else you want help with but assuming you know the rest of the WA stuff, you would save a table to that variable and the data will still be present between login sessions.

I guess a very rough visualisation of what the table might look like

aura_env.saved = {
  ["bill-dalaran"] = 3, -- Maybe just use a player's GUID instead of their name
  ["jill-twistingnether"] = 7,
}

So the key would be the player's name or GUID and then the corresponding value would be the number of times they have been summoned previously, and if you wished to save more information then instead of the value simply just being the number of times summoned, it would instead be another table continue the additional data you required

GitHub

World of Warcraft addon that provides a powerful framework to display customizable graphics on your screen. - WeakAuras/WeakAuras2

coarse patio
young torrent
# coarse patio When it comes to more advanced Weakauras (basicly soon as I have to do any codin...

No worries, I'm sure you can ask for further help once you have specifics figured out and others will hopefully help.

To maybe give you some ideas and maybe make it easier (or harder) I'll give you some info I think may be relevant.

Your trigger will probably be a CLEU or UNIT_SPELLCAST_SUCCEEDED event for whatever the spell is that is fired whenever a summoning portal from a closet or a meeting stone is successfully sent. You will need to find the exact event and spell id in game as I'm not sure about it, you can use any event tracker but I recommend DevTool.

In your trigger, you will probably want to make sure the source is your player as you want to track when you summon someone and not just anyone's summon's.

You will also probably want to check C_IncomingSummon.IncomingSummonStatus so that you know when a player actually accepts your summon as you don't want to increment the counter if you just keep spam summoning them. I'm not exactly sure how you will know when to call this function, maybe every 5 seconds until a summon is accepted/declined/timed out?

Naturally of course, once you successfully send a summon to a player and they accept the summon, you will want to increment the counter for player in the aura_env.saved table. So something very roughly and pseudocode-y like: