Download
(54 Kb)
Download
Updated: 03/29/24 02:57 PM
Pictures
File Info
Compatibility:
Scions of Ithelia (9.3.0)
Endless Archive (9.2.5)
Updated:03/29/24 02:57 PM
Created:01/21/24 06:53 PM
Monthly downloads:199
Total downloads:891
Favorites:5
MD5:
9.3.0
Farmers ToolKit
Version: 240329i
by: Vilkasmanga [More]
An Addon in Development, the Farmers Toolkit is a collection of (mostly) command-line options to help track farming but also includes options for random pets, random messages in battle or when reading books, show rapport of companions and whatever else a bored Farmer might want an addon to do. This is intended to be a standalone addon but it will use certain addon libraries if available (e.g., LibAddonMenu2, LibCustomMenu, etc.)

Sample capabilities:

Farming / Bag Inventory:
  • Show quantity of items just farmed (how many you just got, how many you have overall)
  • Added ability to have "shopping lists" aka farming targets on screen (track / find NN of [item])
  • Color-coded on-screen status of bags (open slots, adjustable levels for "warning" and "panic" messages)
  • Search through recently farmed (i.e., this login session) items and get count (this session and overall)
  • List items farmed and which bank they are currently in (backpack, bank, craft bag, etc.)
  • General stats (%age of "new" items, # of chests opened, etc.)
  • On-screen summary of open slots, # of items farmed, # of slots used by treasures/trash/containers, etc.

Favorite Pet Support
  • You can now identify a subset of your pets to be "favorites" and randomly launch one via "/ft petnow" (or via a button in the GUI)
  • If you have marked pets as favorites and turned on "PetSwap" (see below), it will draw only from the list of favorite pets (otherwise, it will randomly pull from any of your available non-combat pets).

Endeavors / Daily Gifts:
  • Track which daily and weekly endeavors you are working on, show on-screen reminders until complete
  • Track whether you have received the latest daily gift, show # complete, # to go, etc.

Misc stuff that a farmer totally needs for an addon (not really)
  • Flash an onscreen reminder if daily/weekly endeavors are about to time out (3 hour warning)
  • On-screen bounty timer (in test)
  • Randomly choose a non-combat pet after farming NNN items (NNN is configurable)
  • Play a celebration sound when certain items are farmed (butterfly wind and mudcrab chitin, for now, you can add to the list via "/ft set targets" or via the GUI (right click an item in inventory)
  • Show companion's rapport levels (the original function of this addon...)
  • Unrelated commentary on-screen when reading books, doing battle, etc. (Farmers: Time rich, sometimes)

This is my first add on so most everything is command line for now. As I learn GUI configuration, I'll update. This is a collection of capabilities we in the Soloists Guild wish we had - if you have thoughts or suggestions, let me know. I am continuously developing on this in order to avoid real work and responsibilities. Also, if you have a better way to do something, please feel free to let me know - this is a learning process.


So, looking at other addons, this page is also where the detailed explanation seems to go so...
if that's not the case, let me know. Otherwise... .gory details below.

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

Detailed instructions / explanations / minutiae


Daily Task and Inventory Screen Example

There are three sections to this on-screen guide: (1) the daily tasks (endeavors, not daily quests) summary line, (2) the current state of inventory, and (3) a list of recommended endeavors.

(1) - The daily task line
This line summarizes how many daily endeavor (DE) and Weekly Endeavor (WE) are complete, as well as whether you have picked up your Daily Gift (DG)

The line is color coded with grey = none, yellow = at least 1 endeavor is done, green = all complete.

(2) - The inventory line
This line shows a quick summary of your open bags, e.g.,
"Farming (Open 25/205): Total 51 (Unique: 18, Restocked: 3, Chests: 2)"
Where:

- "Open 25/205" means you have 25 slots out of 205 open.
- This text will be green as long as the # of open slots > the value set for "Warning bag limit"
- The text will turn to yellow if # of open slots falls below the Warning bag limit, and a reminder ("W@25") will be shown on the line.
- The text will be red if the # of open slots falls below the panic level, and a reminder ("P@10") will be shown.
- You can set the values for warning and panic via the chat window (/ft setwarn 25) or the GUI ("Inventory Controls", if LibAddOnMenu is available - optional)

Total 51 (Unique: 18, Restocked: 3, Chests: 2) - summary of your farming so far
- This test shows that 51 total items have been farmed, of which
- 18 are unique (if you gather 15 Platinum Dust, it still only counts as one unique entry)
- 3 are restocked (meaning you did not already have some of these in your bag inventory)
- And you have looted 2 chests.
- Note: If you have any stolen items in your bags, the total count will be shown on this line as well.

Recommended endeavors
This is a list of both daily - marked with a (D) in the title - and weekly endeavors - marked with a (W)
This is not a complete list, only the ones that ESO has decided are not difficult (no "4" level entries shown)
(... because farmers will do endeavors but they can't take time away from the farm to go running off to Imperial City every day...)

Color coding / screen behavior

- The end of each endeavor line will show the progress and is color coded: grey = not started, yellow = underway.

- Once an endeavor is complete, it will be removed from the list (and the count in the summary section described above will get updated)

- Once three dailies have been completed, all the daily endeavors will be removed from the list. Similarly, once a weekly endeavor is complete, all the weekly entries will be removed.

- Once both dailies and weeklies have been completed, the list disappears entirely.... until tomorrow.

- When entering combat, this panel is replaced with encouraging words for farmers in battle (in a smaller text to free up screen space until the villain is slain...)


Chat Window Example #1




In this example of the farming reports to the chat window, you can see:
- One item of Makko being farmed for the first time (as shown by the blue text and the "Session first" bit)
This is the 5th item we've farmed this session (1 / 5) and we have a total of 2,418 in our overall inventory

- One Mundane Rune, first time seen this session (8th item overall and we have 2,549)
In addition, we're farming Mundane Runes and this is 1 of 3, with two to go

- Similarly, we farmed our first 6 pieces of Rough Ruby Ash, bringing the overall total to 58,192.
We're also farming (shopping list) Rough Ruby Ash, with a target of 44 - with this 6, we have 38 to go.

- Later on, we looted 127 gold bringing the on-character total to 2,312,716

- By 18:36, farmed another 3 pieces of Rough Ruby Ash, so the farming target shows 9/44 with 35 to go.
Note the text color for this line is yellow, visually indicating this is not the first time we've farmed it this session.

A summary of the farming report is available via /ft showtargets (I should add an image of that, I suppose)

Chat Window Example #2



Similar to the previous example but a couple of specific call outs:

- At 18:48, you see a purple line entry. The addon will celebrate your having farmed NNN number of items every time you pass NNN (set via /ft set reminder or via the GUI tool). This has no functionality other than to encourage your farming and to play a sound when you reach these interim milestones.

However, if you have the "Random Pet" option turned on (see configuration screen or set via /ft peton), there is a chance (defaults to 33% but is configurable) that a random non-combat pet will be called each time you reach a milestone.

You see an example of that in the line which reads "Suddenly, there is a rustling in your pack!".

Finally, this example also shows two additional chat-line abilities:

1 - "/ft fl" - You can list all of the items you have farmed this session using "/ft fl" (FL = farming list). It will show you the item (as a link), total number farmed (this session) and total amount in inventory.

2 - "/ft fl [search term]" - Since that list can get lengthy, you can search for matching entries using /ft fl [term] (see examples at 18:48 searching for "raw" and then "rube". This will pattern match the lines and only show the ones matching the supplied phrase.

If you've read this far, I'll tell you there is also a "/ft fl2" command which displays the unique id # of the item as well. Not that you need that but farmers are just a curious lot by nature.

Farming / Shopping List Window Example


(Note: This snapshot was taken at a different time so it won't flow with the numbers from the previous examples)

In this example, we have 1 of 15 Alchemical Resins, none of our Butterfly Wings, and 12/ 50 (24%) of our Rubedite Ore target amount.

Once a target has been met, it is removed from the on-screen list (but still shows in the chat window via "/ft showtargets")

Optional Functionality

If the LibCustomMenu library is available, you can set targets for items in your inventory by right clicking the item and choosing "Set Farming target via chat". This will simply key in the command line argument of "/ft settarget [link] " and then let you type in a number and hit ENTER to set / update the target count for that item.

If the LibAddonMenu library is available, you can configure settings via the GUI (Settings ->Addon->Farmers Toolkit) (see examples, below). There are command line equivalents for all the configurable items (except for changing fonts. On the list to add, I just need to find a nicer way of entering font names via text.)

Reporting Controls


In this example, you can control the fonts for the lines and lists detailed above as well as control whether they are active:
- Chat reporting will turn on/off the farming reports sent to chat (i.e., the examples above)
- Screen reporting will turn on/off the daily / inventory on-screen reports
- Farming target will turn on/off the farming list shopping list on-screen reports.
- Not shown, there are also entries for choosing favorite pets (As of update 240219g)

Inventory / Miscellaneous Controls


You can set the Warning and Panic levels for # of open slots in your bags (either by using the slider or just typing in a number and hitting ENTER)

You can also turn on/off the random pet swapping upon reaching a milestone (# of items farmed)

You can set the milestone limit (the reminder count, reminding you what a great job you are doing with this farming stuff) via "/ft reminder NNN"

And, to be honest, sometimes, you just can't wait for the milestone and you want a random pet. Thus, the "Gimme a random pet" button (or "/ft petnow" chat command)

Generally speaking, most everything is written to be chat-line friendly and not require any additional libraries. With that in mind, here is a snap shot to the current list of chat commands. This list will change and if it grows much more, a screenshot really won't work so going forward, for the latest updates, check back here or use the "/ft news" command after an update. With the exception of setting fonts, everything available in the GUI can be done at the command line.

Sample Help Line


There are entries in this list that aren't discussed above (/ft savedata/loaddata, /dt savetargets/loadtargets, etc.) but the help screen should get you through the bulk of that kind of thing.

Finally, putting it all together, it can look something like this. (Remember, you can change the fonts/sizes and toggle the panels)...


If something doesn't make sense (likely) or I've missed some functionality you really need (very likely), drop me a line. If I can figure out how to do it (iffy likely), I will!

-V
Version 240329i (per /ft version) - Functionality Update

New functionality

- On-screen warning if endeavors are about to timeout.
- If you have not finished your 3 dailies or weekly endeavor and only NN hours remain, this will warn you to get a move on.
- Configurable via GUI or "/ft EWL nn"


- On-screen warning if you have an active bounty.
- The on screen reminder appears only if you have a bounty
- On screen reminder shows the amount of your bounty and estimated time left before it goes to 0
- HOWEVER! It only updates when something else (e.g., an inventory change) drives it (for now)
>>> THIS IS IN DEV STILL - The EVENT REGISTER code is not firing as expected. (Hints welcome!)


- On-screen button to immediately launch a favorite pet (by request)
- The chosen icon is an odd choice but it is what I found. I'm looking for the
actual icon used in game for non-combat pets but... for now, it is the rightmost / new button
- Also working on how to add mouseover text to the onscreen buttons, etc. - Stay tuned!



Minor Changes / Enhancements

- Adjusted capability of "/ft fl2" to flag items that are in two spots, i.e.: bags and bank / craftbag
- New feature / idea, designed to help keep bag slots open by showing items that could
potentially be moved to a craftbag or bank. Not sure if this is going to go anywhere, tbh.
Feels useful from a bag management perspective but doesn't fit the "farmer toolkit" idea.
I don't want this to morph / drift into inventory management, there are many other / better solutions.
(But I do like the idea of flagging duplicate-space items for helping me cleanup things.)
- To test, run "/ft fl2" - to see only the summary and duplicate items, search for something that
likely doesn't exist, e.g. "/ft fl2 zebrawing"

Bug Fixes

- General code cleanup, removed debug commands/routines and (some) extraneous variables, typos corrected / created.

----- Previous entries below -----

New functionality

- Re-wrote much of how Favorite Pets are implemented.
Trying to transition from the older approach to the newer one without breaking older instances of the AddOn.
This is definitely a work in progress area. Everything should work as (if not better than) it did before.

- Note: Identified issue requiring multiple "favorite pet" configuration blocks.
Good news: A solution is being worked.
Bad news: Didn't get resolved for this release.
This version works as before (multiple pet boxes on config screen), hope to have an improvement on next release.

- Farming target / shopping lists may now be auto-loaded on login in addition to being saved (/ft savetargets) and loaded (/ft loadtargets). This just automates "loadtargets" on login (available via GUI configuration option)

- Added support for an abbreviated form of on-screen inventory reporting (one line, uses less screen space)
- This also suppresses detailed endeavor information and allows you to minimize the info blocks
(See "Inventory pin" item below for details)

- Enhanced inventory slot reporting: Added Trash, Treasure, Companion Items, and Containers
- On-screen reporting now shows number of slots in your bag taken up by Trasure or Trash (reported as Trashure, obviously)
(This is supported under the standard on-screen reports as well as the 'terse' version)
- On-screen reporting now shows # of (non-equipped) companion items in your backpack
(Because these tend to pile up on me unless something reminds me how many items
I am lugging around, often for no reason)
- On-screen reporting now shows # of unopened containers (treasure bags, coffers, etc.)
(Because these tend to pile up on me much like companion items, stolen loot, etc.)

- Activated "pin" icon over FarmList to toggle displaying the full list
(but keeps the header on the screen, useful for short-term "rolling up" of
the list, hitting the icon again will toggle the list back into view.)
- This is currently not a setting saved across logins / reloadui's - feedback welcome

- Activated "pin" icon over Inventory on-screen area to toggle through display options
- Setting 1: Normal version, shows inventory and endeavor status
- Setting 2: Abbreviated inventory line, no endeavor display (terse version)
- Setting 3: Single line on screen saying display has temporarily been suppressed
- This is currently not a setting saved across logins / reloadui's - feedback welcome

- Activated "configuration" icon over Farming List on-screen area to open up GUI confg screen

- Activated "configuration" icon over Inventory on-screen area to open up GUI confg screen


Minor Changes / Enhancements

- Reordered entries in "Misc behaviors" GUI config section for better flow

- Resolved a confusing aspect where a stolen treasure could appear in both the "Stolen" count
and the "Treasure (Trashure)" counts, suggesting there were two items or two bag slots being
used when there in fact only one slot should be reported. The new approach now counts only
stolen items (that is, if stolen, it counts as stolen and no longer increments treasure or
companion items.)

- Added line numbers to shopping list (by request)



Bug Fixes

Corrections
- Changed on-screen coloring on "difficult" endeavors to color entire line (for better readability)
- Fixed some anomalous favourite pet behavior during the re-write of that section








Version 240129g (per /ft version) - Functionality update

New functionality

-- Added preliminary support for having "favorite" pets (as part of the petswap option)
  • This inadvertently also gives players the ability to mark favorite pets and to call
    them up whenever via the "/ft petnow" command (Or GUI equivalent "Gimme a random pet!" button)

  • Using the GUI (if available), players can mark which pets are favorites. Once
    defined, the petswap routines will draw only from "favorited" pets. If unset,
    the original behavior of choosing from all available pets will be used.

  • The original code for this was pretty much ripped and replaced.
    (By the way, for those pet-collectors out there, the current interface is a bit clunky: it groups available pets in blocks of 50 (alphabetically, though). This is due to a bug either in my code or my misunderstanding how LibAddonMenu2.0 deals with larger lists. Everything works but I'm still working on a more elegant solution.)

  • New chat commands to show the current favorite petlist: /ft fpet, /ft fpets, /ft favpets, /ft favepets
    (I couldn't make up my mind and just went with what I was typing in the most often. For now.)

-- Added functionality for controlling frequency of Pet Swaps upon ReminderCount items farmed
  • I really need to figure a way to explain this better.

    Every "ReminderCount" items farmed results in a celebration (sound + message).
    If the PetSwap function is enabled, there is a chance that a random pet will be swapped in as part of the celebration.
    Previously, this was hard-coded to 33%, it can now be controlled by a chat command or within the GUI (if LAM2 is available)

  • New chat command: "/ft petfrequency NNN" will set the percentage (between 1-100)

-- Started work on additional functions / on screen buttons
  • You may (should) ignore any on-screen icons that suggest settings, etc. for now - they are in test mode
  • On deck: ability to call up config from a button in the GUI

Minor changes / enhancements
-- Changed the on-screen presentation for daily/weekly endeavors
  • The weeklies for 2/12/24 were all marked difficulty level 4 which prevented them from showing on the screen
    (They weren't that hard but ... whatever). Changed the code to ignore the difficulty setting in endeavors
    Now, entries marked "difficult" (level 4) will show up in a different font color.

  • On-screen endeavors will also now be grouped as dailies and weeklies instead of interspersing

-- Tweaked "/ft fl2" to now also show at least one bag where an item is stored (Inventory, Bank, Craft Bag)

-- Also added indicator if there is stolen loot in your bags (count will not show unless you do)

-- Oh! Found / Fixed a typo in the version from last update - ignore any 020724 or 240207 references. Sorry about that. We're on 240219g (February 19, 2024 - Version G = 7 updates so far this year).

Bug Fixes
-- Bug report 2/11/24 by Azhdeen:
user:/AddOns/FarmersToolkit/Startup.lua:1910: operator + is not supported for nil + number
Fixed: Modified code to better handle FarmersToolkit.Lootable array (resolved erroneous international language reference)

- General code cleanup, removed extraneous routines and (some) extraneous variables, typos corrected / created.

Note: Everything is still very much in development, further code improvements (e.g, config via GUI) underway.


Version 240130d (per /ft version) - Minor update


- Added command line support for farming targets (aka, shopping lists)
- /ft showtargets - Shows items on the target/shopping list along with target # and current farming #

- /ft savetargets = Save current list of targetted items and their goals (not the progress)
Note: savetargets does not overlap with savedata command nor vice versa

- /ft loadtargets = Load previous list of targetted items and their goals (not the progress)
Note: loadtargets does not overlap with the loaddata command nor vice versa

- /ft settarget [item] NNN - Set a target of NNN for item [Item] where:
- Item can be a linked as a reference from chat
- If NNN is set to 0, system will simply celebrate every find (sound/chat msg)
- If LibCustomMenu is available, item can also be right clicked in inventory
(Right click, choose "Set Farming target in chat" and enter the NNN target in chat)

- /ft settarget [item] delete - Removes [item] from the farming / shopping list

- /ft showfarmlist - Display a second, movable, configurable on-sctreen display
of current non-zero, unmet targets

- /ft hidefarmlist - Suppress showing of farmlist(see /ft showfarmlist)

- Added initial GUI support for farming targets (aka, shopping lists)
- Fonts are configurable via GUI of LibAddonMenu library is present
- Targets in inventory may be set by right-clicking an item if LibCustomMenu library is present
- Option exists to have on-screen reminder of any non-zero, unmet targets

Minor changes

- Changed default font for Inventory line to ZoFontBookTablet

- Modified Open bags line to reflect total bag slots as well (Instead of 4 open, now shows 4/ 100)

- Modified inventory line to show number of stolen items (if applicable)

-- Bug fixes

- Corrected a chat bug where blue text appeared even though the item had been peviously farmed





Version 240130d (per /ft version) - Minor update

- Fixed an error in gold counting (no longer counting bank transfers)

- Added optional support for GUI to adjust configurable variables
- Note: This only applies if LibAppMenu-2.0 is available
- Set fonts individually for Daily Endeavors and Inventory lines
- Adjust frequency of farming celebrations (ReminderCount)

- Cleaned up misc routines around Companions (reporting rapport)

- Added more support for debugging (no player affecting changes though)

- General code cleanup, removed extraneous routines and (some) extraneous variables

Note: Everything is still very much in development, further code improvements (e.g, config via GUI) underway.

-----------------------------------------------------------------------------------

Version 240129b (per /ft version) - Minor update

- Reworked scoping of most variables to be local (main focus)
- Fixed typo in the name of the Addon (duh!)
- Corrected minor typos, no functional impact
- Fixed bank retrievals to no longer count as farming (bugfix)
- Improved code on ReplenishedItems (aka, restocks) reporting (bugfix)
- General code cleanup, removed extraneous routines and (some) debug lines
- On-screen totals now update after book reads (still work to be done here)
Optional Files (0)


Archived Files (5)
File Name
Version
Size
Uploader
Date
240229h
51kB
Vilkasmanga
02/29/24 02:35 PM
240219g
46kB
Vilkasmanga
02/19/24 01:43 AM
240219g
38kB
Vilkasmanga
02/07/24 11:56 PM
240130d
29kB
Vilkasmanga
02/01/24 04:44 PM
240129b
25kB
Vilkasmanga
01/29/24 01:05 AM


Post A Reply Comment Options
Unread 02/13/24, 05:59 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: Re: bug on lockpick success ?

Originally Posted by Vilkasmanga
Originally Posted by Azhdeen
Hi,

I get an error message when I finish lock picking treasure chests or doors.

For example:


It looks like "FarmersToolkit.Lootable[interactionData.name]" is not initialized, but I do not know Lua enough yet to attempt a bugfix.

in the event data, "Déverrouiller" is "Unlock" in French, and "Coffre" is Chest.
but I don't know if the error could come from using a transleted value.
Thanks for the report ! Let me look into this, I seem to recall this bug popping up under unique conditions (there was an event involving chests that popped an error, I'd forgotten about it.)

I think this error message is more about FarmersToolkit.Lootable more than interactionData.name but will dig into it.

-V
Still looking into it this but some level of a fix should be in the next update. I fixed this bug (I think) but it has opened up a can of multi-lingual worms since the (current) "chest" count relies on the English word (index) "chests" which obviously isn't the case for you.

The problem was relying on the English index "Chest" everywhere except within FarmersToolkit.LockpickSuccess, where the code relied upon interactionData.name
- which is fine if the language is English, since it matched "Chest" as an index that was used everywhere else. If the language isn't English. then the index is not initialized (thus the pop-up error) and the other references don't work (because they still index to "Chest", not "Coffre" for French, for example.)

So, I think the following re-write should fix things:


Code:
if (type(interactionData.name) ~= "nil" ) then
           if ( type(FarmersToolkit.Lootable["Chest"]) == "nil" ) then
	      FarmersToolkit.Lootable["Chest"]=1;
	   else
	      FarmersToolkit.Lootable["Chest"]=FarmersToolkit.Lootable["Chest"]+1
	   end
         end
I will test and fold into the next update - Thanks again for your report!

-V
Last edited by Vilkasmanga : 02/13/24 at 09:50 PM.
Report comment to moderator  
Reply With Quote
Unread 02/12/24, 08:05 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: bug on lockpick success ?

Originally Posted by Azhdeen
Hi,

I get an error message when I finish lock picking treasure chests or doors.

For example:


It looks like "FarmersToolkit.Lootable[interactionData.name]" is not initialized, but I do not know Lua enough yet to attempt a bugfix.

in the event data, "Déverrouiller" is "Unlock" in French, and "Coffre" is Chest.
but I don't know if the error could come from using a transleted value.
Thanks for the report ! Let me look into this, I seem to recall this bug popping up under unique conditions (there was an event involving chests that popped an error, I'd forgotten about it.)

I think this error message is more about FarmersToolkit.Lootable more than interactionData.name but will dig into it.

-V
Report comment to moderator  
Reply With Quote
Unread 02/11/24, 12:37 PM  
Azhdeen
 
Azhdeen's Avatar

Forum posts: 0
File comments: 4
Uploads: 0
Re: bug on lockpick success ?

quick and dirty fix, it removes the error for me:
adding this before line 1910:
if (tonumber(FarmersToolkit.Lootable[interactionData.name]) == nil) then
FarmersToolkit.Lootable[interactionData.name]=0
end
for a more general fix, I would look at making incrementing a value in that table a function that handles the nil values.

Originally Posted by Azhdeen
Hi,

I get an error message when I finish lock picking treasure chests or doors.

...
Report comment to moderator  
Reply With Quote
Unread 02/11/24, 12:25 PM  
Azhdeen
 
Azhdeen's Avatar

Forum posts: 0
File comments: 4
Uploads: 0
bug on lockpick success ?

Hi,

I get an error message when I finish lock picking treasure chests or doors.

For example:
user:/AddOns/FarmersToolkit/Startup.lua:1910: operator + is not supported for nil + number
stack traceback:
user:/AddOns/FarmersToolkit/Startup.lua:1910: in function 'FarmersToolkit.LockpickSuccess'
<Locals> event = 131533, interactionData = [table:1]{action = "Déverrouiller", name = "Coffre", blockedNode = F, isOwned = F} </Locals>
It looks like "FarmersToolkit.Lootable[interactionData.name]" is not initialized, but I do not know Lua enough yet to attempt a bugfix.

in the event data, "Déverrouiller" is "Unlock" in French, and "Coffre" is Chest.
but I don't know if the error could come from using a transleted value.
Report comment to moderator  
Reply With Quote
Unread 02/08/24, 07:28 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Originally Posted by Vilkasmanga
Originally Posted by NeuroticPixels
Patiently waiting for some screenshots to show the addon in action.
Ha! Ok, I will gen some up, easier now that there are actually graphic aspects to it
First pass screenshots as well as a longer description / how to / help guide posted - feedback welcome!
Report comment to moderator  
Reply With Quote
Unread 02/08/24, 11:48 AM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Originally Posted by NeuroticPixels
Patiently waiting for some screenshots to show the addon in action.
Ha! Ok, I will gen some up, easier now that there are actually graphic aspects to it
Report comment to moderator  
Reply With Quote
Unread 02/08/24, 03:32 AM  
NeuroticPixels
Addon Addict
 
NeuroticPixels's Avatar
Premium Member

Forum posts: 211
File comments: 868
Uploads: 0
Patiently waiting for some screenshots to show the addon in action.
Report comment to moderator  
Reply With Quote
Unread 02/01/24, 04:47 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: Re: Re: Re: Re: Re: Leaking globals no more

Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
One thing that might be tripping you up with local, is that for local variables, the location in the file matters. If you try to use it in the file before the local varName statement, it will cause an error.
Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
You can also always throw the leaking variables into your addon's main table. That makes them non global, but also means you don't need to worry about where it is declared.


Also, you can modify the addon name from the addon management page, no need to take it down.
Thanks for the advice on local variable scoping. I've reworked / resubmitted (and renamed!) the previous submission. By and large, I moved things into local space, predominantly through one large structure (FarmersToolkit). In a few places, I used your suggestion to declare things up top to avoid a chicken-and-egg scoping issue - feels like a hack but it works, which is the best kind of hack I suppose. Preliminary testing suggests I didn't break anything / too much though I'm sure the efficiency of the hopefully-now-local variables can use some work.

The next major task, assuming this version is more palatable, will likely be to broach some form of GUI interface for settings. There are tons of examples, I'm just at the starting point / flat end of the learning curve.

Thanks again for all your help and feedback, always welcome and appreciated.

-V


From what I can see with a quick check, you did seem to get everything. Thanks for making the changes!


Few notes:
local FarmersToolkit = {} -> This actually doesn't need to be local, as the addon table is an exception to the 'don't make globals' rule. There's nothing wrong with it being local; but if you split up the addon into multiple files, then this should be global. That will allow you to 'communicate' between different files. I actually do highly suggest splitting up the addon into multiple more modular files. It makes it a lot easier to navigate files, especially when they start getting very large.



You kind of noticed it was weird already But you don't need local DailyClaimed = "N" at line 400. (or line 1906) You're only using a 'DailyClaimed' in another function, where it is separately initialized and declared as local, and thus different from the other two DailyClaimed. So the local variable created on those two lines are never actually used anywhere.

Code:
local exampleVar = 1
local function exampleFun()
  local exampleVar = 2
  d(exampleVar) -> outputs 2, the exampleVar outside of the function is hidden
end
local function exampleFun2(exampleVar)
   d(exampleVar) -> outputs whatever is passed to the function as a parameter, 
                        the exampleVar outside of the function is hidden here too
end
d(exampleVar) -> outputs 1, the exampleVar inside of the function does not exist outside of the function
Thanks. Early on, I did try to separate into different files in order to break things up for efficiency but scored higher on the "breaking" than the "efficiency" - scoping was probably a big reason why. I'll try it again and make other changes you suggest.... including cleaning up the whole daily gift mess, I'm just gonna fold my tent on that one and run with what I have, I think.

-V
FYI - Updated version posted (2 updates, actually, the first one still had debug lines, the second one... shouldn't...) This update attempts to add a GUI configuration component by making use of LibAddMenu-2.0 if it exists, otherwise things behave pretty much the same. More details in the Change log.
Report comment to moderator  
Reply With Quote
Unread 01/30/24, 08:38 AM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: Re: Re: Re: Re: Leaking globals no more

Originally Posted by Dolgubon
Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
One thing that might be tripping you up with local, is that for local variables, the location in the file matters. If you try to use it in the file before the local varName statement, it will cause an error.
Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
You can also always throw the leaking variables into your addon's main table. That makes them non global, but also means you don't need to worry about where it is declared.


Also, you can modify the addon name from the addon management page, no need to take it down.
Thanks for the advice on local variable scoping. I've reworked / resubmitted (and renamed!) the previous submission. By and large, I moved things into local space, predominantly through one large structure (FarmersToolkit). In a few places, I used your suggestion to declare things up top to avoid a chicken-and-egg scoping issue - feels like a hack but it works, which is the best kind of hack I suppose. Preliminary testing suggests I didn't break anything / too much though I'm sure the efficiency of the hopefully-now-local variables can use some work.

The next major task, assuming this version is more palatable, will likely be to broach some form of GUI interface for settings. There are tons of examples, I'm just at the starting point / flat end of the learning curve.

Thanks again for all your help and feedback, always welcome and appreciated.

-V


From what I can see with a quick check, you did seem to get everything. Thanks for making the changes!


Few notes:
local FarmersToolkit = {} -> This actually doesn't need to be local, as the addon table is an exception to the 'don't make globals' rule. There's nothing wrong with it being local; but if you split up the addon into multiple files, then this should be global. That will allow you to 'communicate' between different files. I actually do highly suggest splitting up the addon into multiple more modular files. It makes it a lot easier to navigate files, especially when they start getting very large.



You kind of noticed it was weird already But you don't need local DailyClaimed = "N" at line 400. (or line 1906) You're only using a 'DailyClaimed' in another function, where it is separately initialized and declared as local, and thus different from the other two DailyClaimed. So the local variable created on those two lines are never actually used anywhere.

Code:
local exampleVar = 1
local function exampleFun()
  local exampleVar = 2
  d(exampleVar) -> outputs 2, the exampleVar outside of the function is hidden
end
local function exampleFun2(exampleVar)
   d(exampleVar) -> outputs whatever is passed to the function as a parameter, 
                        the exampleVar outside of the function is hidden here too
end
d(exampleVar) -> outputs 1, the exampleVar inside of the function does not exist outside of the function
Thanks. Early on, I did try to separate into different files in order to break things up for efficiency but scored higher on the "breaking" than the "efficiency" - scoping was probably a big reason why. I'll try it again and make other changes you suggest.... including cleaning up the whole daily gift mess, I'm just gonna fold my tent on that one and run with what I have, I think.

-V
Report comment to moderator  
Reply With Quote
Unread 01/29/24, 10:49 PM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 408
File comments: 888
Uploads: 21
Re: Re: Re: Re: Leaking globals no more

Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
One thing that might be tripping you up with local, is that for local variables, the location in the file matters. If you try to use it in the file before the local varName statement, it will cause an error.
Originally Posted by Vilkasmanga
Originally Posted by Dolgubon
You can also always throw the leaking variables into your addon's main table. That makes them non global, but also means you don't need to worry about where it is declared.


Also, you can modify the addon name from the addon management page, no need to take it down.
Thanks for the advice on local variable scoping. I've reworked / resubmitted (and renamed!) the previous submission. By and large, I moved things into local space, predominantly through one large structure (FarmersToolkit). In a few places, I used your suggestion to declare things up top to avoid a chicken-and-egg scoping issue - feels like a hack but it works, which is the best kind of hack I suppose. Preliminary testing suggests I didn't break anything / too much though I'm sure the efficiency of the hopefully-now-local variables can use some work.

The next major task, assuming this version is more palatable, will likely be to broach some form of GUI interface for settings. There are tons of examples, I'm just at the starting point / flat end of the learning curve.

Thanks again for all your help and feedback, always welcome and appreciated.

-V


From what I can see with a quick check, you did seem to get everything. Thanks for making the changes!


Few notes:
local FarmersToolkit = {} -> This actually doesn't need to be local, as the addon table is an exception to the 'don't make globals' rule. There's nothing wrong with it being local; but if you split up the addon into multiple files, then this should be global. That will allow you to 'communicate' between different files. I actually do highly suggest splitting up the addon into multiple more modular files. It makes it a lot easier to navigate files, especially when they start getting very large.



You kind of noticed it was weird already But you don't need local DailyClaimed = "N" at line 400. (or line 1906) You're only using a 'DailyClaimed' in another function, where it is separately initialized and declared as local, and thus different from the other two DailyClaimed. So the local variable created on those two lines are never actually used anywhere.

Code:
local exampleVar = 1
local function exampleFun()
  local exampleVar = 2
  d(exampleVar) -> outputs 2, the exampleVar outside of the function is hidden
end
local function exampleFun2(exampleVar)
   d(exampleVar) -> outputs whatever is passed to the function as a parameter, 
                        the exampleVar outside of the function is hidden here too
end
d(exampleVar) -> outputs 1, the exampleVar inside of the function does not exist outside of the function
Last edited by Dolgubon : 01/29/24 at 10:51 PM.
Report comment to moderator  
Reply With Quote
Unread 01/29/24, 11:17 AM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: Re: Re: Leaking globals galore

Originally Posted by Dolgubon
Originally Posted by Vilkasmanga
Awesome feedback, really appreciate it - will make take down the mis-named version and make the necessary corrections. As you can probably tell, this is my first attempt and there's a fair amount of learning-along-the-way code (and, so, a lot of commented out code and things like zo_callater...)

I'll work on the local / scoping issues. Every time I tried to do it "the right way", it bit me but I may be smarter now, we shall see.

Thanks also for tricks like Lootable = {["Chest"] = 0}, those are extremely helpful. I spend way too much time testing whether a variable exists before referring to it (part of the reason I got wrapped around the axle on remindercount, I suspect)

Anyway - thanks again, your feedback is really helpful.

-V
One thing that might be tripping you up with local, is that for local variables, the location in the file matters. If you try to use it in the file before the local varName statement, it will cause an error.
You can also always throw the leaking variables into your addon's main table. That makes them non global, but also means you don't need to worry about where it is declared.


Also, you can modify the addon name from the addon management page, no need to take it down.
Thanks for the advice on local variable scoping. I've reworked / resubmitted (and renamed!) the previous submission. By and large, I moved things into local space, predominantly through one large structure (FarmersToolkit). In a few places, I used your suggestion to declare things up top to avoid a chicken-and-egg scoping issue - feels like a hack but it works, which is the best kind of hack I suppose. Preliminary testing suggests I didn't break anything / too much though I'm sure the efficiency of the hopefully-now-local variables can use some work.

The next major task, assuming this version is more palatable, will likely be to broach some form of GUI interface for settings. There are tons of examples, I'm just at the starting point / flat end of the learning curve.

Thanks again for all your help and feedback, always welcome and appreciated.

-V
Report comment to moderator  
Reply With Quote
Unread 01/23/24, 09:45 PM  
Dolgubon
 
Dolgubon's Avatar
AddOn Author - Click to view AddOns

Forum posts: 408
File comments: 888
Uploads: 21
Re: Re: Leaking globals galore

Originally Posted by Vilkasmanga
Awesome feedback, really appreciate it - will make take down the mis-named version and make the necessary corrections. As you can probably tell, this is my first attempt and there's a fair amount of learning-along-the-way code (and, so, a lot of commented out code and things like zo_callater...)

I'll work on the local / scoping issues. Every time I tried to do it "the right way", it bit me but I may be smarter now, we shall see.

Thanks also for tricks like Lootable = {["Chest"] = 0}, those are extremely helpful. I spend way too much time testing whether a variable exists before referring to it (part of the reason I got wrapped around the axle on remindercount, I suspect)

Anyway - thanks again, your feedback is really helpful.

-V
One thing that might be tripping you up with local, is that for local variables, the location in the file matters. If you try to use it in the file before the local varName statement, it will cause an error.
You can also always throw the leaking variables into your addon's main table. That makes them non global, but also means you don't need to worry about where it is declared.


Also, you can modify the addon name from the addon management page, no need to take it down.
Report comment to moderator  
Reply With Quote
Unread 01/23/24, 09:44 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Baertram - Thanks for your feedback and suggestions- these look like great references. I'll review these links as well as Dolgubon's email and take another swing at it. It is probably easiest if I pull the (misnamed/typo'd) submission down in the meantime, yes?

-V

Originally Posted by Baertram
Hi and welcome to ESO addon development.

As Dolgubon already said please make variables local where global ones are not needed.
Please read this e.g. about lua
https://www.esoui.com/forums/forumdisplay.php?f=172

->

and this about new ESO addons
https://www.esoui.com/forums/forumdisplay.php?f=170
Report comment to moderator  
Reply With Quote
Unread 01/23/24, 09:38 PM  
Vilkasmanga
AddOn Author - Click to view AddOns

Forum posts: 0
File comments: 12
Uploads: 1
Re: Leaking globals galore

Awesome feedback, really appreciate it - will make take down the mis-named version and make the necessary corrections. As you can probably tell, this is my first attempt and there's a fair amount of learning-along-the-way code (and, so, a lot of commented out code and things like zo_callater...)

I'll work on the local / scoping issues. Every time I tried to do it "the right way", it bit me but I may be smarter now, we shall see.

Thanks also for tricks like Lootable = {["Chest"] = 0}, those are extremely helpful. I spend way too much time testing whether a variable exists before referring to it (part of the reason I got wrapped around the axle on remindercount, I suspect)

Anyway - thanks again, your feedback is really helpful.

-V

Originally Posted by Dolgubon
First, might want to double check the name on esoui.

Also, you'll want to make the zip file contain the folder, rather than directly having the files.
You should make all your variables local, or stick them in the FarmersToolkit table. Pretty much all of your variable atm are not local, which can cause problems. E.g. tvalue, ReminderCount, function dft, replenishedItems (this one also does not seem to be initialized to 0)
Note that making stuff local may necessitate moving the declarations to the start of the file or function, possibly without an initial value
Iirc there is a event for currency updates, so you might want to use that. I see filters for the inventory slot update but they are commented out. I suggest using them. If you need, you can make multiple different inventory slot update listeners, giving them a different reference name, and different filters. It'll make each individual listener simpler.
Rather than using a long zo callater for the welcome message, you can use the player activated event, and check the 'is first time' parameter it passes.




Lootable={}
Lootable["Chest"]=0
Same as Lootable = {["Chest"] = 0}
Also, make it local
Report comment to moderator  
Reply With Quote
Unread 01/22/24, 01:34 AM  
Baertram
Super Moderator
 
Baertram's Avatar
ESOUI Super Moderator
AddOn Author - Click to view AddOns

Forum posts: 4957
File comments: 6022
Uploads: 78
Hi and welcome to ESO addon development.

As Dolgubon already said please make variables local where global ones are not needed.
Please read this e.g. about lua
https://www.esoui.com/forums/forumdisplay.php?f=172

->

and this about new ESO addons
https://www.esoui.com/forums/forumdisplay.php?f=170
Last edited by Baertram : 01/22/24 at 09:00 AM.
Report comment to moderator  
Reply With Quote
Post A Reply



Category Jump: