Thread Tools Display Modes
06/02/14, 02:49 AM   #1
JadeKnightblazer
Join Date: Feb 2014
Posts: 24
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
  Reply With Quote
06/02/14, 06:55 AM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by JadeKnightblazer View Post
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.

Originally Posted by JadeKnightblazer View Post
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.

Originally Posted by JadeKnightblazer View Post
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).

Originally Posted by JadeKnightblazer View Post
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

Last edited by Garkin : 06/02/14 at 08:14 AM.
  Reply With Quote
06/02/14, 07:04 AM   #3
JadeKnightblazer
Join Date: Feb 2014
Posts: 24
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
  Reply With Quote
06/02/14, 07:09 AM   #4
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
Hey,
It's nice and simple idea. I'm willing to do such addon.
  Reply With Quote
06/04/14, 03:48 PM   #5
Harven
 
Harven's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 135
Here is the addon: Potions Alert. It's limited to potions for now.
  Reply With Quote
05/20/16, 12:21 PM   #6
Didz
 
Didz's Avatar
Join Date: May 2016
Posts: 22
Unhappy

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.
  Reply With Quote
05/20/16, 01:03 PM   #7
votan
 
votan's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2014
Posts: 577
Originally Posted by [email protected] View Post
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.
  Reply With Quote
05/20/16, 01:47 PM   #8
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,971
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
  Reply With Quote
05/21/16, 03:29 AM   #9
Didz
 
Didz's Avatar
Join Date: May 2016
Posts: 22
Originally Posted by votan View Post
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.
  Reply With Quote

ESOUI » AddOns » AddOn Search/Requests » Auto Potion//Emergency Quickslot addon


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off