Thread Tools Display Modes
04/03/23, 04:25 PM   #1
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Question IsPvpFlagged mean in pvp zone?

Im looking for a way for my addon to detect if a saved player @NAME or unitid is in a campaign like cyro, IC or battleground so to not attempt interacting with them.

The only function related I can find is IsPvpFlagged(unittag). Does pvpflagged mean in pvp zone? Or anyone have any other suggestion?
  Reply With Quote
04/03/23, 04:36 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,964
Not sure about the PvP flagged, you will have to test it, but you know that the unitTag is not the character name and you will need to use some way to get the unitTag via group, guild, or reticle/crosshair somehow?
And saving the unitTag will not work as they change even in the same group upon porting to new zones, or as members join the group, or leavem.


Maybe GetUnitZone(unitTag) and then check if the zoneIds == Cyrodiil or Imperail City or Sewers can help?
But it does not tell you if they are queued and not in that zones yet!

The zoneIds are in the list of LibZone, LibZone_Data.lua

Search for Cyrodiil and you'll get the ID, I think it was something in the 180ish, maybe 181?
Not sure anymore about IC and IC sewers, and if BGs have a proper zoneId or not.
  Reply With Quote
04/03/23, 06:16 PM   #3
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
Yeh I'm aware unittag doesnt use @NAME. It was more the theory or function to check I was more interested in. I have done some testing and IsPvpFlagged() appears to work with same faction in cyro so far. I was unable to group with an enemy faction guildy that was in cyro to test that. Im waiting for a few guinea pigs to get on to help me test the rest in diff scenarios.

The purpose of the check it to not attempt group traveling to that person if they are in cyro, IC or battleground.

The addon is basically complete and now im just fine tuning it. I did have another question though unrelated to this thread. Is it possible to execute or use a quickslot from code? It doesn't appear so but I thought I would ask incase ive missed something.

*EDIT*
So after some testing IsPvPFlagged() rings true if theyre in cyro, IC and the sewers but so far false everywhere else.. Haven't tested battlegrounds yet but its next on my list.

Last edited by sinnereso : 04/04/23 at 12:54 AM.
  Reply With Quote
04/04/23, 05:45 AM   #4
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,964
No, no execution of skills or Quickslot is allowed by addons. Although if the item in the Quickslot is a companion (or another collection) you can start that via API calls (summon it, unsummon it). But potions, food etc. Alike is nothing that can be used from Quickslot automatically. We can only change the Quickslot wheel to show that particular slot and you manually have to activate it via the normal Quickslot keybind then.

using food from the inventory may work directly though, haven't tested that since years. It was possible in the past, but maybe it's removed meanwhile. but I do not think potions or similar would AND you should Not try that and make ZOs angry because you try to create some automatisms/botting routines... If any API gets revoked/removed because ppl try stuff that should simply not happen, you can be sure the rest of the community here will be very "thankfull"...!
  Reply With Quote
04/04/23, 03:50 PM   #5
sinnereso
AddOn Author - Click to view addons
Join Date: Oct 2022
Posts: 245
K thank you.. thats what it was looking like. I was wondering if it were possible to maka sort of auto keep repair where it would loop it on keep repair AP gain so you'd only have to hit it once and it would repeat until no gains.

Another question which tbh i havent dug into yet but will be after my rando dungeon here... Im considering a hide "save armory build" button in armory or grey it out or something option. I hate it and makes me nervous everytime im in there. IMO save should be way off and not easy to click.

If you can think of the command for that off the top of your head that would be amazing otherwise ill dig into it shortly.
  Reply With Quote
04/04/23, 04:21 PM   #6
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,964
<control>:SetHidden(true)
<control>:SetMouseEnabled(false)

Move your mouse above the button, use merTorchbug or Zgoo and type /tbm or /zgoo mouse to inspect the control and you got the name.

To do that as the armory opens check what scene it uses, e.g. by using /tbsc with mertorchbug to see the SCENE_MANAGER and check currentScene entry.
Use the scene state change callback, or a fragment if the scene is the armory scene but the button only shows at 1 fragment of that scene, to hide and/or show it according to your needs.
https://wiki.esoui.com/Scene_Manager:_On_scene_change
https://wiki.esoui.com/Fragments_in_...t_state_change
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » IsPvpFlagged mean in pvp zone?


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