summaryrefslogtreecommitdiff
path: root/Data/BuiltIn/Libraries/lua-addons/addons/findAll/README.md
blob: 409d1caf6a98ce2835d6ae5ac19cf485b7503ec0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# FindAll

This addon searches items stored on all your characters. To build the initial list, you must login and either receive any item-handling packet, logout, or input the `findall` command on any character at least once with each of them.  
The list is stored on the machine on which the addon is executed, being updated everytime you look for an item, certain packets arrive, or you logout, so this will not work the best if you use multiple PCs, unless you store your Windower installation in Dropbox or somewhere.
The addon will show a warning if your entire inventory has not re-loaded since zoning, but it should still be accurate because Windower's item handling API has moved to being packet based.

It offers an on-screen tracker that keeps track of items you specify or of your used/free space in specified bags.

## Tracker

The settings file has a field that you can use to define what is being tracked in a text box on the screen.
The text supports variables denoted by curly braces preceded by a dollar sign `${}`.
Each variable consists of two parts, the bag indicator and the item name, separated by a colo `:`.
For example, to track the amount of shihei in your inventory, you would do this:
```xml
        <Track>${inventory:shihei}</Track>
```

This will merely display a number on the screen. You can add flavor text outside of the variable:
```xml
        <Track>Shihei: ${inventory:shihei}</Track>
```

You can also use wildcards for item names:
```xml
        <Track>Crystals: ${inventory:*crystal}</Track>
```

You can use any of the bag names defined [here](https://github.com/Windower/Resources/blob/master/lua/bags.lua) as well as the key word `all` to search all bags. Every variable name is case-insensitive.

There are a three variables that can be used instead of item names: `$freespace`, `$usedspace` and `$maxspace`
If those are used, the respective value will be displayed:
```xml
        <Track>Inventory: ${inventory:$freespace}, Wardrobe: ${wardrobe:$freespace}</Track>
```

### Formatting

Since the tracker uses XML for formatting and XML is shitty, this will not work:
```xml
        <Track>
Inventory: ${inventory:$freespace}
Satchel:   ${satchel:$freespace}
Sack:      ${sack:$freespace}
Case:      ${case:$freespace}
Wardrobe:  ${wardrobe:$freespace}
        </Track>
```

The spaces and new lines will all collapse into a single space and you'll get one long and unreadable line.
To make the format appear as you have it in the XML settings file you need to wrap the entire text in `<![CDATA[` and `]]>` tags:
```xml
        <Track>
<![CDATA[Inventory: ${inventory:$freespace}
Satchel:   ${satchel:$freespace}
Sack:      ${sack:$freespace}
Case:      ${case:$freespace}
Wardrobe:  ${wardrobe:$freespace}]]>
        </Track>
```

That will correctly preserve any formatting you have inside the text.
With that, you can even do something like this:
```xml
        <Track>
<![CDATA[Inventory: ${inventory:$usedspace||%2i}/${inventory:$maxspace||%2i} → ${inventory:$freespace||%2i}
Satchel:   ${satchel:$usedspace||%2i}/${satchel:$maxspace||%2i} → ${satchel:$freespace||%2i}
Sack:      ${sack:$usedspace||%2i}/${sack:$maxspace||%2i} → ${sack:$freespace||%2i}
Case:      ${case:$usedspace||%2i}/${case:$maxspace||%2i} → ${case:$freespace||%2i}
Wardrobe:  ${wardrobe:$usedspace||%2i}/${wardrobe:$maxspace||%2i} → ${wardrobe:$freespace||%2i}]]>
        </Track>
```

And it will result in this:

![Tracker example](https://picster.at/img/8/f/9/8f93097ce393a03b4196ef2602186c27.png)

## Commands

### Update ###

```
findall
```

Forces a list update

### Search ###

```
findall [:<character1> [:...]] <query> [-e<filename>|--export=<filename>]
```
* `character1`: the name of the characters to use for the search.
* `...`: variable list of character names.
* `query` the word you are looking for.
* `-e<filename>` or `--export=<filename>` exports the results to a csv file. The file will be created in the data folder.

Looks for any item whose name (long or short) contains the specified value on the specified characters.

## Examples ##

```
findall thaumas
```

Search for "thaumas" on all your characters.

```
findall :alpha :beta thaumas
```

Search for "thaumas" on "alpha" and "beta" characters.

```
findall :omega
```

Show all the items stored on "omega".

----

## TODO

- Use IPC to notify the addon about any change to the character's items list to reduce the amount of file rescans.
- Use IPC to synchronize the list between PCs in LAN or Internet (requires IPC update).

----

## Changelog

### v1.20170501
* **add**: Added a setting to stop the display of keyitems. Maybe someone will add a command toggle for it later?

### v1.20170405
* **fix**: Adjusted the conditions for updating the shared storages.json to make it more robust.
* **add**: Added key item tracking.

### v1.20150521
* **fix**: Fixed after May 2015 FFXI update
* **change**: Future proofed the addon to be less prone to breaks

### v1.20140328
* **change**: Changed the inventory structure refresh rate using packets.
* **add**: IPC usage to track changes across simultaneously active accounts.

### v1.20140210
* **fix**: Fixed bug that occasionally deleted stored inventory structures.
* **change**: Increased the inventory structure refresh rate using packets.

### v1.20131008
* **add**: Added new case storage support.

### v1.20130610
* **add**: Added slips as searchable storages for the current character.
* **add**: The search results will show the long name if the short one doesn't contain the inputted search terms.

### v1.20130605
* **fix**: Fixed weird results names in search results.

### v1.20130603
* **add**: Added export function.
* **change**: Leave the case of items' names untouched

### v1.20130529
* **fix:** Escaped patterns in search terms.
* **change**: Aligned to Windower's addon development guidelines.

### v1.20130524
* **add:** Added temp items support.

### v1.20130521
* **add:** Added characters filter.

### v1.20130520
* First release.