ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   AddOn Search/Requests (https://www.esoui.com/forums/forumdisplay.php?f=165)
-   -   Auto Potion//Emergency Quickslot addon (https://www.esoui.com/forums/showthread.php?t=1703)

JadeKnightblazer 06/02/14 02:49 AM

Auto Potion//Emergency Quickslot addon
 
Is it possible to code an addon that will automatically select a presetted quickslot (the player picks which quickslot that will be for the Emergency slot) when the character falls below a threshold of their choosing. Then a popup with this items Icon will pop up larger and ask the player to hit [Q].

This style of Emergency / Warning will be like player the first Fable. Which each time the Heros resource gets low the Guild Leader will whisper "They you health is low, watch that", following with a quick button to press to recover said resource.

Threshold Options Check Box:
[] Low health (25%)
[] Low Magicka (25%)
[] Low stam (25%)
[] Stat boost potion effect fades
[] Food Buff fades

Emergency Quickslot:
Silder/Pull down: 1 - 8

Over all: Is it possible to Automate the Selecting of the Quickslot (To a presetted slot), Then reqest for the player to Hit Q.

-Thanks :)

Garkin 06/02/14 06:55 AM

Quote:

Originally Posted by JadeKnightblazer (Post 8943)
Is it possible to code an addon that will automatically select a presetted quickslot (the player picks which quickslot that will be for the Emergency slot) when the character falls below a threshold of their choosing. Then a popup with this items Icon will pop up larger and ask the player to hit [Q].

Yes this is possible.

Quote:

Originally Posted by JadeKnightblazer (Post 8943)
This style of Emergency / Warning will be like player the first Fable. Which each time the Heros resource gets low the Guild Leader will whisper "They you health is low, watch that", following with a quick button to press to recover said resource.

It is not possible to send chat message to other players from addon.

Quote:

Originally Posted by JadeKnightblazer (Post 8943)
Threshold Options Check Box:
[] Low health (25%)
[] Low Magicka (25%)
[] Low stam (25%)
[] Stat boost potion effect fades
[] Food Buff fades


Emergency Quickslot:
Silder/Pull down: 1 - 8

This is a simplified example how it can be done:
Lua Code:
  1. local announce = ZO_CenterScreenAnnounce_GetAnnounceObject()
  2. ZO_CenterScreenAnnounce_SetEventPriority(EVENT_POWER_UPDATE)
  3. --slots can be set by addon, this is just a simplified example (first quick slot is 9 (ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 1)):
  4. local quickSlots = {
  5.    [POWERTYPE_HEALTH] = ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 1,
  6.    [POWERTYPE_MAGICKA] = ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 2,
  7.    [POWERTYPE_STAMINA] = ACTION_BAR_FIRST_UTILITY_BAR_SLOT + 3,
  8. }
  9. local messages = {
  10.    [POWERTYPE_HEALTH] = "Health below 25%, press \"Q\"",
  11.    [POWERTYPE_MAGICKA] = "Magicka below 25%, press \"Q\"",
  12.    [POWERTYPE_STAMINA] = "Stamina below 25%, press \"Q\"",
  13. }
  14.  
  15. EVENT_MANAGER:RegisterForEvent("MyAddon_OnPowerUpdate", EVENT_POWER_UPDATE,
  16.    function(eventCode, unitTag, _, powerType, powerValue, powerMax)
  17.       if (unitTag == "player") then
  18.          if (powerType == POWERTYPE_HEALTH) or (powerType == POWERTYPE_MAGICKA) or (powerType == POWERTYPE_STAMINA) then
  19.             if (powerValue / powerMax) < 0.25 then
  20.                SetCurrentQuickslot(quickSlots[powerType])
  21.                announce:AddMessage(eventCode, CSA_EVENT_SMALL_TEXT, SOUNDS.MESSAGE_BROADCAST, ZO_POWER_BAR_GRADIENT_COLORS[powerType][2]:Colorize(messages[powerType]))
  22.             end
  23.          end
  24.       end
  25.    end)
This code checks if your health/magicka/stamina is below 25%, automatically selects 1st/2nd/3rd quick slot and displays warning message. It does not check cooldowns on potions (probably if QUICKSLOT_WINDOW.quickSlots[quickSlots[powerType]].useable then ...do something... end).

Quote:

Originally Posted by JadeKnightblazer (Post 8943)
Over all: Is it possible to Automate the Selecting of the Quickslot (To a presetted slot), Then reqest for the player to Hit Q.

-Thanks :)

  1. yes
  2. yes, but not using the /whisper from the guild leader

JadeKnightblazer 06/02/14 07:04 AM

Thanks for answering, and glad there is hope for this type of addon :)


As for the "Guild Leader" thing, that was the name / title of one of the Characters in Fable --> http://www.gamespot.com/reviews/fabl.../1900-6415659/

Was not directed towards party members or other forms in ESO :)

Harven 06/02/14 07:09 AM

Hey,
It's nice and simple idea. I'm willing to do such addon.

Harven 06/04/14 03:48 PM

Here is the addon: Potions Alert. It's limited to potions for now.

Didz 05/20/16 12:21 PM

This sounded like a brilliant idea for a mod, so I installed it this afternoon and decided to try it out.

But I can't get it to work.

I've selected the three potions I want to use for Magicka; Health and Stamina, and selected 30% as the trigger point of each.

And I've chosen the position and size of the alert button.

But running around in circles in town to drain my stamina produced no reaction at all.

What am I doing wrong.

votan 05/20/16 01:03 PM

Quote:

Originally Posted by [email protected] (Post 27021)
This sounded like a brilliant idea for a mod, so I installed it this afternoon and decided to try it out.

But I can't get it to work.

I've selected the three potions I want to use for Magicka; Health and Stamina, and selected 30% as the trigger point of each.

And I've chosen the position and size of the alert button.

But running around in circles in town to drain my stamina produced no reaction at all.

What am I doing wrong.

Outside combat there is no alert.
To test it, you have to set your action bar to "always on" and watch your quickslot switch to your stamina slot.

Baertram 05/20/16 01:47 PM

There is another addon which is able to warn you and to swap your quickslots automatically if your food buff runs out, or if you get into combat/out of combat (depending on your current zone/dugneon/AvA [PvP]/PvE).
It is called FCO StarveStop

Didz 05/21/16 03:29 AM

Quote:

Originally Posted by votan (Post 27022)
Outside combat there is no alert.
To test it, you have to set your action bar to "always on" and watch your quickslot switch to your stamina slot.

Thanks, I realised this last night when it started popping up whilst I was questing. so, it was working.:o


All times are GMT -6. The time now is 04:41 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI