Quantcast
Download
(75 Kb)
Download
Updated: 04/07/21 11:53 AM
Pictures
File Info
Compatibility:
Flames of Ambition (6.3.5)
Markarth (6.2.5)
Stonethorn (6.1.5)
Greymoor (6.0.5)
Updated:04/07/21 11:53 AM
Created:06/10/18 11:50 AM
Monthly downloads:260
Total downloads:4,961
Favorites:4
MD5:
Categories:Bags, Bank, Inventory, Buff, Debuff, Spell, Chat Mods, Mail, Miscellaneous
6.3.5
ODT  Updated this week!
Version: 2.62a
by: black dragon [More]
Initialement développé pour les officiers de la guilde "Orbe du Temps" cet addon a évolué pour apporter certaines fonctionnalités :
• Serment des indomptables (pledges) sur un simple clic
• Horloge
• Chronomètre
• Performances
• Statistiques inventaire
• Statistiques armes et armures
• RTS

Version 2.16
• Serments des indomptables DLC : réinitialisation de la séquence selon summerset
• Statistiques armes et armures : ajout du nom des armes équipées
• Statistiques armes : rechargement automatique (paramétrable) quand l'arme atteint 0%

Version 2.17
• Possibilité de paramétrer la recharge automatique de l'arme sans afficher les statistiques
• Avertissement de charge d'arme passé de 10% à 3%
• Menu contextuel paramétré selon le rang (officier ou non)
• Mail de guilde (réservé officiers)

Version 2.18
• Correction d'un bug en mail de guilde

Version 2.19
• Correction d'un bug en RTS

Version 2.20
• Ajout d'un timer

Version 2.21
• Correction d'un bug en stats armure : quand toutes les pièces étaient à 0% l'addon affichait 100%
• Ajout d'une commande pour appeler/renvoyer les assistants (Nuzimeh...)

Version 2.22
• Modification du code d'invitation permanent discord

Version 2.23
• Compatibililté Wolfhunter

Version 2.24
• Serments des indomptables DLC : réinitialisation de la séquence selon Wolfhunter

Version 2.25
• Compatibilité Murkmire

Version 2.26
• Correction d'un bug

Version 2.27
• Annonce de débuff nourriture/boisson
→ Version 2.27b
• débug sur Bloody Mara (227b)
→ Version 2.27f
• Correction de quelques bugs
• Notification de débuff en chat
→ Version 2.27g
• Correction d'un bug

Version 2.28
• Ajout de sons supplémentaires
• Notification de changement de status (Connexion | Déconnexion | AFK | Ne pas déranger) des membres de guilde

Version 2.29
• Ajout de ReloadUI en raccourci et icône ODT
• Ajout d'horodatage sur les notifications de status des membres de guilde
• Notifications de chat

Version 2.30
• Chat personnalisé
Version 2.30a
• Correction d'un bug : les noms n'étaient pas "linkables"

Version 2.31
• Chat personnalisé : affichage permanent du chat (optionnel). La fenêtre de chat reste affichée et ne disparaît pas après 25 secondes d'inactivité comme prévu par [Z]
• Sauvegarde/Chargement des couleurs du chat
→ Version 2.31a - Chat personnalisé : Correction d'un bug concernant les links
→ Version 2.31b - Nourriture & Boisson : Correction de bug de spam de buff d'évent
→ Version 2.31c - Chat personnalisé : correction d'un bug de link en groupe
→ Version 2.31d - Chat personnalisé : correction d'un bug de chat PNJ
→ Version 2.31e : Correction d'un bug /cmd
→ Version 2.31f : correction d'un bug d'enregistrement d'un paramètre | ajout d'une touche
programmable pour basculer la langue du jeu FR/EN
→ Version 2.31g : - Chat personnalisé - Correction d'une erreur quand le signe % se trouvait dans le
texte | Ajout d'un affichage de l'espace de banque
→ Version 2.31h : intercpetion et neutralisation des messages d'erreurs
→ Version 2.31j : correction d'un bug d'enregistrement d'un paramètre

Version 2.32
• Alerte sur l'entraînement de la monture

Version 2.33
• Ajout d'une fenêtre de fond (background)

Version 2.34
• Monture : ajout d'un fond transparent paramétrable
• Divers : ajout d'une option pour verrouiller l'emplacement des fenêtres [ODT]

Version 2.35
• Notification de guilde : le nom de compte est désormais cliquable pour whisp

Version 2.36
• Notifications de guilde: le nom des guildes apparaît
• Notifications de chat : le nom des guildes apparaît
• Notifications de chat : les couleurs paramétrées sont reprises
• Added English version
→ 2.36b : English version rev.1

Version 2.37
• Affichage du type d'eau et appâts en passant le curseur sur un trou de pêche (désactivable dans les paramètres)

Version 2.38
• Statistiques sur le vol (Argent récolté dans la journée | Montant des objets volés en inventaire | Nombre d'objets vendus | Nombre d'objets blanchis | Temps restant)

Version 2.39
• Le mail de guilde n'est plus verrouillé sur [ODT]

Version 2.40
• Compatible Wrathstone

Version 2.42
• Compatible Elsweyr

Version 2.43
• Correction d'un bug (changement de status de membre) lié à un changement du système [Z] concernant l'id de guilde

Version 2.46
• Ajout du Nécro dans les dialogues

Version 2.47
• Compatible Scalebreaker

Version 2.48
• Correction de la séquence des dailies (pledges) Scalebreaker

Version 2.49
• Compatible Dragonhold

Version 2.50
• Possibilité de masquer les fenêtres en combat

Version 2.51
• Compatible Harrowstorm

Version 2.52
• Compatible Greymoor

Version 2.53
• Compatibilté de la pêche pour Artaeum et la Cité Mécanique

Version 2.55
• Compatible Stonehorn

Version 2.56
• Correction d'un bug sur les enchantements lorsqu'un bouclier est équipé.

Version 2.60
• Ajout de lien [url] cliquable en chat

Version 2.62
• Ajout de l'annonce de mort en groupe
• Le codage de la séquence des pledges DLC est toujours en cours



Plus de détails http://www.orbedutemps.net/forums/index.php?topic=3908.60
Optional Files (0)


Archived Files (59)
File Name
Version
Size
Uploader
Date
 ODT
2.61a
71kB
black dragon
03/08/21 04:17 AM
 ODT
2.61
71kB
black dragon
03/08/21 02:36 AM
 ODT
2.60
71kB
black dragon
01/06/21 05:04 AM
 ODT
2.57
70kB
black dragon
11/02/20 11:07 AM
 ODT
2.56
70kB
black dragon
09/03/20 11:56 AM
 ODT
2.55
70kB
black dragon
08/23/20 02:05 AM
 ODT
2.54
78kB
black dragon
07/26/20 03:31 AM
 ODT
2.53.2
77kB
black dragon
07/16/20 11:57 AM
 ODT
2.53
126kB
black dragon
06/30/20 11:40 AM
 ODT
2.52
126kB
black dragon
05/30/20 11:11 AM
 ODT
2.51
126kB
black dragon
03/14/20 01:48 PM
 ODT
2.50a
157kB
black dragon
11/26/19 01:45 PM
 ODT
2.50
156kB
black dragon
11/22/19 12:01 PM
 ODT
2.49.1
155kB
black dragon
11/10/19 10:00 AM
 ODT
2.49.0
155kB
black dragon
10/21/19 11:30 AM
 ODT
2.49
155kB
black dragon
10/21/19 10:59 AM
 ODT
2.48
155kB
black dragon
09/01/19 07:41 AM
 ODT
2.47
155kB
black dragon
08/12/19 09:36 AM
 ODT
2.46
154kB
black dragon
07/05/19 11:48 AM
 ODT
2.45a
154kB
black dragon
05/26/19 10:10 AM
 ODT
2.45
154kB
black dragon
05/26/19 10:06 AM
 ODT
2.44
154kB
black dragon
05/26/19 09:56 AM
 ODT
2.43
154kB
black dragon
05/26/19 09:17 AM
 ODT
2.42
147kB
black dragon
05/23/19 11:44 PM
 ODT
2.41
147kB
black dragon
03/12/19 12:47 AM
 ODT
2.40
147kB
black dragon
02/26/19 01:30 AM
 ODT
2.39
154kB
black dragon
02/22/19 03:15 AM
 ODT
2.38
153kB
black dragon
02/19/19 05:06 AM
 ODT
2.37
120kB
black dragon
02/12/19 04:51 AM
 ODT
2.36b
112kB
black dragon
02/08/19 11:48 PM
 ODT
2.36a
112kB
black dragon
02/07/19 02:19 AM
 ODT
2.36
112kB
black dragon
02/06/19 01:15 PM
 ODT
2.35
106kB
black dragon
02/01/19 03:03 AM
 ODT
2.34
106kB
black dragon
01/30/19 09:17 AM
 ODT
2.33
106kB
black dragon
01/28/19 09:35 AM
 ODT
2.32a
106kB
black dragon
01/26/19 11:05 AM
 ODT
2.32
106kB
black dragon
01/26/19 03:27 AM
 ODT
2.31j
103kB
black dragon
01/24/19 02:47 AM
 ODT
2.31i
103kB
black dragon
01/23/19 11:02 AM
 ODT
2.31h
103kB
black dragon
01/23/19 10:16 AM
 ODT
2.31g
102kB
black dragon
01/23/19 03:00 AM
 ODT
2.31f
102kB
black dragon
01/22/19 10:47 AM
 ODT
2.31e
101kB
black dragon
01/21/19 10:45 AM
 ODT
2.31d
101kB
black dragon
01/21/19 04:41 AM
 ODT
2.31c
101kB
black dragon
01/20/19 02:31 AM
 ODT
2.31a
101kB
black dragon
01/06/19 04:25 AM
 ODT
2.31
102kB
black dragon
01/02/19 12:52 PM
 ODT
2.30a
101kB
black dragon
12/31/18 09:17 AM
 ODT
2.30
99kB
black dragon
12/25/18 12:39 AM
 ODT
2.29
98kB
black dragon
12/21/18 01:12 PM
 ODT
2.28a
96kB
black dragon
12/20/18 07:32 AM
 ODT
2.28
96kB
black dragon
12/20/18 03:50 AM
 ODT
2.27g
94kB
black dragon
12/18/18 12:54 PM
 ODT
2.27f
94kB
black dragon
12/18/18 12:47 PM
 ODT
2.27b
94kB
black dragon
12/15/18 02:27 AM
 ODT
2.27
94kB
black dragon
12/13/18 03:06 AM
 ODT
2.26
93kB
black dragon
12/05/18 03:11 AM
 ODT
2.25
91kB
black dragon
10/22/18 11:28 PM
 ODT
2.25
91kB
black dragon
09/05/18 11:50 AM


Post A Reply Comment Options
Unread 01/06/21, 07:58 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3432
File comments: 4144
Uploads: 66
Originally Posted by black dragon
Thanks,

• This time it's working (icons in chat)

• Variables rename by ODT_variable

• LOCAL don't work everytime that's what i declared variables without "local"
Salut et Bonne année

Thanks for the update
But nearly all those variables like ODT_Combox_State could just be added with local ODT_Combox_State and would work properly.
-> Read about local variables at the end of my post.

And important: There are still some very important changes to do:

Wrong variable names?
You got a few variables now that are only named ODT_, are those correct? e.g. ODT_:SetHidden(true)

Code:
------------------------------------------------------------
			-- affiche la fenetre de la liste des commmandes
			------------------------------------------------------------
			if ODT_Combox_State == 1 then
				ODT_:SetHidden(true)
				ODT_Combox_State = 2
			elseif ODT_Combox_State ==2 then
				ODT_:SetHidden(false)
				ODT_Combox_State = 1
			end
These variables are duplicate:
Code:
local showStartMessage = true
There are still leaking a lot of variables to the global namespace (table _G), please fix them to be local!
From the top of file ODT.lua to the bottom these variables still are global and need to be changed to locals!

LOCAL don't work everytime that's what i declared variables without "local"
You do not seem to understand how the local variables, or the global variables work? And what a "scope" is?
->Check my 2nd post below about "local, global and scopes" please.

Code:
-- Add ODT_ prefix please or add it as local SHOW_BANSPACE at the top of your file ODT.lua or even better, add them to ODT. table with ODT.<variable> instead of polluting the global table _G with all that local variables! 
currentInteractableName
autoSets = {} --Is this even used? If yes, than in another file, not within OTD.lua. So add ODT_ in front please or even better: Move it to ODT.autoSets
guildId -- IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "guildId" variable!
guildrank1cpt to guildrank10cpt
rankIndex -- IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "rankIndex" variable!
aff
function uiCmdList
InitFish
guildId --again, in many places of ODT.lua
character --IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "character" variable!
donothing
dDay
dayOffset
iconFile
printFish
iconprint
Special0101
chattext --IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "chattext" variable!
dayOffset --again
SHOW_BANSPACE 
StolenCurrentMoney
bagStolenPcent
bagLockedPcentStr
dDay -- again
iconprint -- again
ShowFoodMsgEvent
ShowFoodMsg
SendFoodMsg
iconprint --again
odtShowStatus
GuildMemberIndex --IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "GuildMemberIndex" variable!
odtcharName
allianceiconprint
StatusMsg --IMPORTANT TO FIX! This is causing severe problems, if not changed, as several ZOs codes AND addons use a "StatusMsg" variable!
statusiconprint
linkaccName
CustomChatDateTime
CustomChatChan
guildId -- again!!!
CustomChatAccount
CustomChatName
CustomChatLvl
CustomChatAlliance
CustomChatClasse
CustomChatSearch
GuildMemberIndex --Again!!!
CustomChatFound
guildId --Again!!!
GuildMemberIndex --Again!!!
message --Again!!! IMPORTANT TO FIX!
iconprint
mountFeedMessage
clocframex
clocframey
Chrono_framex
Chrono_framey
Timer_framex
Timer_framey
function CreateDefaultSettings -- Just move this function ABOVE the call to this function and add a local up in front. Lua files are read from top (line 1) to bottom (last line of file)! So you need to define functions and variables BEFORE (on top to) you call them!
ShowFoodMsgEvent --again!

parent --Line 4194 -> VERY IMPORTANT TO CHANGE! local fc is not used anywhere, so just remove this line? Or comment it
Important as well - Localization variables:
Inside your en.lua and fr.lua files the entries within local strings = {}, e.g. mailsenderror, will be created as global constants.
ZO_CreateStringId(stringId, stringValue)
-> ZO_CreateStringId("mailsenderror", "|cFF6909Mail ODT : |cC80F14mail non envoyé (") will create the global variable mailsenderror which then can be used via GetString.
Please ALSO add some prefix to these variables, like "ODT_" or else these global names might overwrite other variables too.


e.g. in all your language lua files (en.lua, fr.lua) at the bottom, change the for ... do loop to add the prefix:
Lua Code:
  1. for stringId, stringValue in pairs(strings) do
  2.     ZO_CreateStringId("ODT_" .. stringId, stringValue)
  3.     SafeAddVersion("ODT_" .. stringId, 1)
  4. end

And in your lua files use a function like this then, instead of GetString directly:
Lua Code:
  1. ODT = ODT or {} --Important! Do not forget this line
  2.  
  3. function ODT.getTranslation(stringId)
  4.     return GetString("ODT_" .. stringId)
  5. end
-> Add this to your en.lua file e.g.

Inside your ODT.lua file change the lines
Lua Code:
  1. ODT =
  2. {
  3.     ["chanbuffer"] = {},
  4. }
to
Lua Code:
  1. ODT = ODT or {
  2.     ["chanbuffer"] = {},
  3. }

In all your lua files:
Search for
Code:
GetString(
and replace with
Code:
ODT.getTranslation(
Your addon then will use this function to read the stringId (starting with ODT_).
Last edited by Baertram : 01/06/21 at 08:08 AM.
Report comment to moderator  
Reply With Quote
Unread 01/06/21, 06:14 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3432
File comments: 4144
Uploads: 66
Local variables / Global variables & "scope"
local works perfectly fine if you add them at the top of your files and BEFORE you want to access them.
As you did with: local ODT_Pledges e.g.

And if you define a local within a function ...end , an if ... endif or for... do end loop the local won't be accessible outside this "scope".
Means

Lua Code:
  1. local function testIt()
  2.  local var1 = "Hello World"
  3. end
  4.  
  5. testIt()
  6. d(var1)
Will fail as var1 is ONLY known inside the scope "function testit) and outside it will be nil

Lua Code:
  1. local var1 = "Hello World"
  2. local function testIt()
  3.  var1 = "Hello to you too"
  4. end
  5. d(var1) --Shows "Hello World"
  6.  
  7. testIt()
  8. d(var1) --Shows "Hello to you too"

Wrong scopes will lead to variablse being nil or containing the "old" informartion!
These example lines from your code will not work properly because of the wrong scope: "re-defined local inside a new scope"
Lua Code:
  1. --------------------------------------------------------
  2.     -- ARMES : Recharge automatique de l'enchantement
  3.     --------------------------------------------------------
  4.     if charge < 1 and ODT_WA_Recharge == true then
  5.         local gem = ODT_GetSoulgem()
  6.         if gem then
  7.             ODT_MSG_SHOW(ODT_ItemLink .. GetString(weaponcharged), ODT_WA_SOUND_WEAPON)
  8.             ChargeItemWithSoulGem(BAG_WORN, slot, BAG_BACKPACK, gem)
  9.  
  10.             local chargeInfo = {GetChargeInfoForItem(BAG_WORN, slot)}
  11.             local charge = math.ceil(chargeInfo[1]/chargeInfo[2]*100)          
  12.                         --> Because you have added local inside the if ... else ... end scope the variables chargeInfo and charge are ONLY known inside the if ... else scope! Means: You will change chargeInfo -> okay. You will change charge (using the changed chargeInfo -> okay).
  13. --> But then you will want to access charge again a few lines below, outside of the if ... else ... at line 4508
  14.         else
  15.             ODT_MSG_SHOW(ODT_ItemLink .. GetString(nosoulgem), ODT_WA_SOUND_WEAPON)
  16.         end
  17.        
  18. -->Charge will not contain the value from local charge above as the value was ONLY changed inside the if ... else! So charge here wil lcontain teh value from BEFORE the if ... else ... end!
  19.     if string.find(charge, "-nan") then
  20.         ODT_itemCharge = "bug "
  21.     end
  22.    
  23.     end
  24. ...

The correct function would look like this:
Lua Code:
  1. function ODT_WeaponsCharge(slot)
  2.     local chargeInfo = {GetChargeInfoForItem(BAG_WORN, slot)}
  3.     local charge = math.ceil(chargeInfo[1]/chargeInfo[2]*100)  
  4.     local itemInfo = GetItemInfo(BAG_WORN, slot)
  5.     ODT_ItemLink = GetItemLink(BAG_WORN, slot)
  6.     ODT_itemIcon = itemInfo
  7.     ODT_itemCharge = charge
  8.    
  9.     if string.find(itemInfo, "shield") or ODT_itemIcon == "/esoui/art/icons/icon_missing.dds" or string.find(charge, "-nan") then
  10.         charge = 999
  11.         ODT_itemCharge = ""
  12.  
  13.         if  slot == EQUIP_SLOT_MAIN_HAND then
  14.             ODT_WA_WEAPON11_PCENT:SetHidden(true)
  15.         elseif
  16.             slot == EQUIP_SLOT_OFF_HAND then
  17.             ODT_WA_WEAPON12_PCENT:SetHidden(true)
  18.         elseif
  19.             slot == EQUIP_SLOT_BACKUP_MAIN then
  20.             ODT_WA_WEAPON21_PCENT:SetHidden(true)
  21.         elseif
  22.             slot == EQUIP_SLOT_BACKUP_OFF then
  23.             ODT_WA_WEAPON22_PCENT:SetHidden(true)
  24.         end
  25.     else
  26.         if  slot == EQUIP_SLOT_MAIN_HAND then
  27.             ODT_WA_WEAPON11_PCENT:SetHidden(false)
  28.         elseif
  29.             slot == EQUIP_SLOT_OFF_HAND then
  30.             ODT_WA_WEAPON12_PCENT:SetHidden(false)
  31.         elseif
  32.             slot == EQUIP_SLOT_BACKUP_MAIN then
  33.             ODT_WA_WEAPON21_PCENT:SetHidden(false)
  34.         elseif
  35.             slot == EQUIP_SLOT_BACKUP_OFF then
  36.             ODT_WA_WEAPON22_PCENT:SetHidden(false)
  37.         end
  38.     end
  39.  
  40.     --------------------------------------------------------
  41.     -- ARMES : Recharge automatique de l'enchantement
  42.     --------------------------------------------------------
  43.     if charge < 1 and ODT_WA_Recharge == true then
  44.         local gem = ODT_GetSoulgem()
  45.         if gem then
  46.             ODT_MSG_SHOW(ODT_ItemLink .. GetString(weaponcharged), ODT_WA_SOUND_WEAPON)
  47.             ChargeItemWithSoulGem(BAG_WORN, slot, BAG_BACKPACK, gem)
  48.  
  49.                         --Removed local so that chargeInfo and charge are upated and known OUTSIDE of the if .. else ..end scope
  50.             chargeInfo = {GetChargeInfoForItem(BAG_WORN, slot)}
  51.             charge = math.ceil(chargeInfo[1]/chargeInfo[2]*100)        
  52.         else
  53.             ODT_MSG_SHOW(ODT_ItemLink .. GetString(nosoulgem), ODT_WA_SOUND_WEAPON)
  54.         end
  55.        
  56.     end
  57. --Now chrge was maybe updated in line "charge = math.ceil(chargeInfo[1]/chargeInfo[2]*100)" AND the value is known in this line here properly
  58.     if string.find(charge, "-nan") then
  59.         ODT_itemCharge = "bug "
  60.     end


Lua is always reading your lua files from line 1 to the last line, and thus it tries to find variables the same way: From top to bottom.
If your variables are defined AFTER they will get called -> lua error message.

Lua Code:
  1. --Line 200 of the lua file
  2. local function testIt()
  3.   return var1
  4. end
  5. local resultVar1 = testIt()
  6.  
  7. --Line 300 of the same lua file
  8. local var1 = "Hello World"
e.g. this will fail to work as the variable "var1" is not exisitng before the function "testIt" was called, because var1 is defined local and BELOW (line 300) function testIt (line 200)

Lua Code:
  1. --Line 1 of the lua file
  2. local var1 = "Hello World"
  3.  
  4. --Further down below at line 200
  5. local function testIt()
  6.   return var1
  7. end
  8. local resultVar1 = testIt()
This will work as the variable was defined at line 1 of the same lua file.


Lua Code:
  1. --Line 1 of the lua file
  2. ODT = {}
  3.  
  4. --Further down below at line 200
  5. local function testIt()
  6.   return ODT.var1
  7. end
  8.  
  9. --Line 400
  10. local var1 = "Hello World"
  11. ODT.var1 = var1
  12.  
  13.  
  14. --Line 500 in EVENT_ADD_ON_LOADED
  15. local resultVar1 = testIt()
This will work as the ODT variable is not local -> so it is global in the _G table (_G["ODT"]).
You have added the var1 to ODT.var1 somewhere in your code.
As long as this happens on the timeline of your addon BEFORE the call to function testIt() the variable ODT.var1 was set properly and the function is able to use it properly.



Global variable for different lua files:
If you want to use a variable in multiple files just create a global table e.g. in your first file (first called from your txt file).
ODT = {}
and then add the variables to this table:
local var1 = "Hello World"
ODT.var1 = var1

In your other files use this at the top:
ODT = ODT or {}

This will check if ODT exists and reuse it, or create ODT new as an empty table.

And then you are able to use ODT.var1 in your other file as well.


What are "global variables"?
All non-local variables will be added to the global namespace table _G
So if you define a variable without local, e.g. ODT, it will be e.g.
Lua Code:
  1. ODT = {}
  2. -- same as _G["ODT"]

If you define guildId without local up in front it will be _G["guildId"]. And this will overwrite all existing _G["guildId"] which were defined before, including other variables that were defined as local guildId!!! So this will break other addons.
IF you really need global variables you need to defne them with a unique name, not guildId but ODT_guildId e.g.
And at best just define 1 global table variable ODT = {} and add ALL your needed variables to this table:
ODT.guildId
ODT.iconString
etc.
This will keep the _G table clean and readable + all other addons are able to find and access your ODT table properly.

But within your addon, to be true, you can change 90% of the global variables to be local, just add local up in front and define them at the top of the file ODT.lua
e.g.
lcoal ShowFoodMsg
local guildId
local aff
local ODTDebug
etc.


Editor which supports the lua language and helps with finding local, globals, errors etc.
You really should use an editor that helps you to show these problems, like IntelliJ IDEA with EmmyLua plugin e.g.
Check the description of this "auto completion" plugin to read wher to get and how to install IntelliJ IDEA and the EmmyLua plugin.
https://www.esoui.com/downloads/info2654-ESOUIluaAPIautocompletionforJetBrainsIntelliJIDEAIDEEmmyLuaplugin.html
Last edited by Baertram : 01/06/21 at 07:58 AM.
Report comment to moderator  
Reply With Quote
Unread 11/30/20, 02:00 PM  
black dragon
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 3
Uploads: 1
Thanks,

• This time it's working (icons in chat)

• Variables rename by ODT_variable

• LOCAL don't work everytime that's what i declared variables without "local"
Report comment to moderator  
Reply With Quote
Unread 08/24/20, 04:22 AM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3432
File comments: 4144
Uploads: 66
Hey,

libChat is discontinued outdated and breaks other addons
Do not use and/or include it anymore please!

As after ZOs chat changes from CHAT_SYSTEM to CHAT_ROUTER the chat currently is not able to register multiple same handlers, like CHAT_MESSAGE_HANDLER, you need to waith for an updated LibChatMessage to version 2 (if it wil larrive some day^^) to enablke this functionality again OR use your own callback function for that like pChat does.
But you cannot use libChat, libChat2 libChat3 or any similar libs anymore which are outdated!

So please strip it and change your code to use LibChatMessage, or remove the functionaliy this lib was providing.
Else ALL OTHER CHAT RELATED ADDONS WILL FAIL TO WORK!


Delete:
folder libs

Delete line in ODT.txt:
libs/libChat.lua


In your lua files change:

ODT.lua
Delete:
local ODTCHATLC = LibStub("libChat-1.0")
-> Lib is oudated and discontinued, and breaks other addons! And LibStub MUST NOT BE USED ANYMORE as I had written in my prior post already.

Change all other findings of ODTCHATLC to not use it anymore!

Replace the usage with ZOs chat handlers of CHAT_ROUTER, like done within pChat.
Replace this:
Lua Code:
  1. ODTCHATLC:registerFormat(ODT_FormatMessage, "ODT")

With this:
Lua Code:
  1. CHAT_ROUTER:RegisterMessageFormatter(EVENT_CHAT_MESSAGE_CHANNEL, ODT_FormatMessage)

Then test it!


Keep in mind that using other chat addons together with yours will not work properly anymore as long as ZOs only allows to register 1 callback function to the chat handlers No way to circumvent this atm.


Here is a changed version, including the changes mentioned above + version update, and some other fixes to needed library versions in your txt file:
https://www.dropbox.com/s/x2266t57i7knlhd/ODT_2_56_Baertram.zip?dl=0


And PLEASE do not use all those global variables like these ones:
Lua Code:
  1. ShowFoodMsg = 1
  2. FoodTime = 60
  3. EventFoodTime = 60
  4. isFoodActive = false
There names are pretty similar to other addon variables so pelase put a local in front of them OR add them to your global variable ODT so they do not pollute the global namespace!

Wrong:
ShowFoodMsg = 1
FoodTime = 60
EventFoodTime = 60
isFoodActive = false


Correct if used in multiple lua files:
ODT.ShowFoodMsg = 1
ODT.FoodTime = 60
ODT.EventFoodTime = 60
ODT.isFoodActive = false

Correct if only used in 1 lua file:
local ShowFoodMsg = 1
local FoodTime = 60
local EventFoodTime = 60
local isFoodActive = false

You got like 100 global variables in your ODT.lua file which are not needed to be global! Please change them to local or to be added to your ODT global table, and in your other lua/xml files and functions change the call to them to use ODT. as well.

Else you might get into teouble if other addons use the same name for a variable.

Thank you.
Last edited by Baertram : 08/24/20 at 04:43 AM.
Report comment to moderator  
Reply With Quote
Unread 07/14/20, 06:35 AM  
black dragon
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 3
Uploads: 1
TKS

Originally Posted by Baertram
Please do NOT include old libraries into the addons anymore!
If you include libraries include them WITH THEIR OWN txt file so the addon manager will find newer installed versions of the same library properly.

And be aware that LibStub will be removed soon so prepare the addons to NOT use it anymore, where not needed!
Instead of using LibStub use the global variables of the libraris like LibAddonMenu2.

LibChat schould be removed as it is causing problems. Replace it with LibChatMessage instead or sue your own code for chat formatters.

Please change this WRONG code:
Code:
libs/LibStub\LibStub.lua

Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Libs/LibAddonMenu-2.0/controls/panel.lua
Libs/LibAddonMenu-2.0/controls/submenu.lua
Libs/LibAddonMenu-2.0/controls/button.lua
Libs/LibAddonMenu-2.0/controls/checkbox.lua
Libs/LibAddonMenu-2.0/controls/colorpicker.lua
Libs/LibAddonMenu-2.0/controls/custom.lua
Libs/LibAddonMenu-2.0/controls/description.lua
Libs/LibAddonMenu-2.0/controls/dropdown.lua
Libs/LibAddonMenu-2.0/controls/editbox.lua
Libs/LibAddonMenu-2.0/controls/header.lua
Libs/LibAddonMenu-2.0/controls/slider.lua
Libs/LibAddonMenu-2.0/controls/texture.lua
Libs/LibAddonMenu-2.0/controls/iconpicker.lua

libs/LibNotification.lua
libs/libChat.lua
Delete the folders and files in the subfolder "libs" in total! And afterwards include the needed libraries COMPLETELY with their own txt files in oder to let the game load them properly and find newer versions.

Change your manifest txt file to the appropriate usage of dependencies:
Code:
## DependsOn: LibAddonMenu-2.0>=28 LibNotification
And in your code reference the libraries WITHOUT LibStub.

Replace e.g.
local ODTCHATLC = LibStub("libChat-1.0")
local LAM = LibStub("LibAddonMenu-2.0")


New:
local ODTCHATLC = LibStub("libChat-1.0") --libChat is outdated since years and you should remove it as it causes problems with other addons!
local LAM = LibAddonMenu2


Global variables...
Your addons also uses like only global variables polluting the global namespace What a mess...
Names like InitFish are not connected to your addon in any way and every other addon could see or overwrite it. And variables like "gold" or "message" are also not a good solution as they could overwrite other addons local variables... This definately needs a cleanup.

I'm currently trying to build a package of this addon without the old libraries which you could use.
Will post the file here once I'm finished and got it to work.

Edit:
Forget it, this addon code is a mess, sorry. Everything global and mixed and variable names that are the same so you do not know where to use them + only coded to support french or english dates and time (fixed stuff like split at /, which is not available in non-english/french dates).
So sorry, cannot build a working vesion here.

But find a file with some changes like the libraries and the chat handler code (libChat1 stripped!) inside here. Maybe it helps you change the addon to work properly with newer libs and without having so many global variables polluting the namespace and interfereing with other addons:
https://www.dropbox.com/s/zj7mbztod9...fixed.zip?dl=0


Thanks a lot. Modifications done. Let's try for a while in local mode before update.
Report comment to moderator  
Reply With Quote
Unread 03/14/20, 02:01 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3432
File comments: 4144
Uploads: 66
Please do NOT include old libraries into the addons anymore!
If you include libraries include them WITH THEIR OWN txt file so the addon manager will find newer installed versions of the same library properly.

And be aware that LibStub will be removed soon so prepare the addons to NOT use it anymore, where not needed!
Instead of using LibStub use the global variables of the libraris like LibAddonMenu2.

LibChat schould be removed as it is causing problems. Replace it with LibChatMessage instead or sue your own code for chat formatters.

Please change this WRONG code:
Code:
libs/LibStub\LibStub.lua

Libs/LibAddonMenu-2.0/LibAddonMenu-2.0.lua
Libs/LibAddonMenu-2.0/controls/panel.lua
Libs/LibAddonMenu-2.0/controls/submenu.lua
Libs/LibAddonMenu-2.0/controls/button.lua
Libs/LibAddonMenu-2.0/controls/checkbox.lua
Libs/LibAddonMenu-2.0/controls/colorpicker.lua
Libs/LibAddonMenu-2.0/controls/custom.lua
Libs/LibAddonMenu-2.0/controls/description.lua
Libs/LibAddonMenu-2.0/controls/dropdown.lua
Libs/LibAddonMenu-2.0/controls/editbox.lua
Libs/LibAddonMenu-2.0/controls/header.lua
Libs/LibAddonMenu-2.0/controls/slider.lua
Libs/LibAddonMenu-2.0/controls/texture.lua
Libs/LibAddonMenu-2.0/controls/iconpicker.lua

libs/LibNotification.lua
libs/libChat.lua
Delete the folders and files in the subfolder "libs" in total! And afterwards include the needed libraries COMPLETELY with their own txt files in oder to let the game load them properly and find newer versions.

Change your manifest txt file to the appropriate usage of dependencies:
Code:
## DependsOn: LibAddonMenu-2.0>=28 LibNotification
And in your code reference the libraries WITHOUT LibStub.

Replace e.g.
local ODTCHATLC = LibStub("libChat-1.0")
local LAM = LibStub("LibAddonMenu-2.0")


New:
local ODTCHATLC = LibStub("libChat-1.0") --libChat is outdated since years and you should remove it as it causes problems with other addons!
local LAM = LibAddonMenu2


Global variables...
Your addons also uses like only global variables polluting the global namespace What a mess...
Names like InitFish are not connected to your addon in any way and every other addon could see or overwrite it. And variables like "gold" or "message" are also not a good solution as they could overwrite other addons local variables... This definately needs a cleanup.

I'm currently trying to build a package of this addon without the old libraries which you could use.
Will post the file here once I'm finished and got it to work.

Edit:
Forget it, this addon code is a mess, sorry. Everything global and mixed and variable names that are the same so you do not know where to use them + only coded to support french or english dates and time (fixed stuff like split at /, which is not available in non-english/french dates).
So sorry, cannot build a working vesion here.

But find a file with some changes like the libraries and the chat handler code (libChat1 stripped!) inside here. Maybe it helps you change the addon to work properly with newer libs and without having so many global variables polluting the namespace and interfereing with other addons:
https://www.dropbox.com/s/zj7mbztod9eue2y/ODT_libraries_fixed.zip?dl=0
Last edited by Baertram : 03/14/20 at 02:52 PM.
Report comment to moderator  
Reply With Quote
Unread 08/22/19, 06:41 PM  
Ek1
 
Ek1's Avatar
AddOn Author - Click to view AddOns

Forum posts: 5
File comments: 49
Uploads: 6
Nii mitähän tää tekee?
Report comment to moderator  
Reply With Quote
Unread 07/05/19, 03:09 PM  
Baertram
 
Baertram's Avatar
AddOn Author - Click to view AddOns

Forum posts: 3432
File comments: 4144
Uploads: 66
Just a hint:
If you put the information what has changed from version to version into the "changelog" tab you could make the addon description easier readable. I mean all this text here:
Code:
Version 2.16
• Serments des indomptables DLC : réinitialisation de la séquence selon summerset
• Statistiques armes et armures : ajout du nom des armes équipées
• Statistiques armes : rechargement automatique (paramétrable) quand l'arme atteint 0%

Version 2.17
• Possibilité de paramétrer la recharge automatique de l'arme sans afficher les statistiques
• Avertissement de charge d'arme passé de 10% à 3%
• Menu contextuel paramétré selon le rang (officier ou non)
• Mail de guilde (réservé officiers)

Version 2.18
• Correction d'un bug en mail de guilde
...
For a better readability you should turn the text around so the newest version is at the top and the oldest at the bottom.

The changelog is shown in a seperat browser page and withion Minion as well.
If you update your addon you can see the "changelog" tab on top of the edit box:

=====================================================

Juste un indice:
Si vous mettez les informations sur les modifications apportées d'une version à l'autre dans l'onglet "changelog", vous pourrez rendre la description de l'addon plus lisible. Je veux dire tout ce texte ici:

Code:
Version 2.16
• Serments des indomptables DLC : réinitialisation de la séquence selon summerset
• Statistiques armes et armures : ajout du nom des armes équipées
• Statistiques armes : rechargement automatique (paramétrable) quand l'arme atteint 0%

Version 2.17
• Possibilité de paramétrer la recharge automatique de l'arme sans afficher les statistiques
• Avertissement de charge d'arme passé de 10% à 3%
• Menu contextuel paramétré selon le rang (officier ou non)
• Mail de guilde (réservé officiers)

Version 2.18
• Correction d'un bug en mail de guilde
...

Pour une meilleure lisibilité, vous devez inverser le texte afin que la version la plus récente se trouve en haut et la plus ancienne en bas.

Le journal des modifications "changelog" est affiché dans une page de navigateur distincte et également avec Minion.
Si vous mettez à jour votre addon, vous pouvez voir l'onglet "changelog" en haut de la boîte d'édition:

Last edited by Baertram : 07/05/19 at 03:11 PM.
Report comment to moderator  
Reply With Quote
Unread 02/01/19, 03:25 AM  
black dragon
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 3
Uploads: 1
Re: Hope for the Future

Originally Posted by Akopian Atrebates
Looking at this, I am thinking that I wold love an English version of this. It is modular with excellent customization options. I just do not know French (I can guess at the basic meanings, but the settings would be tough to understand).

Anyway, I hope that at some point somebody takes on the localization of this addon. I love the look, and I also love that it is constantly updated.
Thanks a lot for your comment. If somedy can translate in english i would try to do this.

If some idea please mail [email protected]

Updates informations : http://www.orbedutemps.net/forums/in...?topic=3908.60
Last edited by black dragon : 02/01/19 at 04:01 AM.
Report comment to moderator  
Reply With Quote
Unread 01/30/19, 02:32 PM  
Akopian Atrebates

Forum posts: 6
File comments: 190
Uploads: 0
Hope for the Future

Looking at this, I am thinking that I wold love an English version of this. It is modular with excellent customization options. I just do not know French (I can guess at the basic meanings, but the settings would be tough to understand).

Anyway, I hope that at some point somebody takes on the localization of this addon. I love the look, and I also love that it is constantly updated.
Report comment to moderator  
Reply With Quote
Unread 06/11/18, 04:03 AM  
corao7
 
corao7's Avatar

Forum posts: 0
File comments: 1
Uploads: 0
Super Addon , très pratique !
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: