Records of eminence addon#1585
Conversation
|
|
||
| local function save(name) | ||
| if not type(name) == "string" then | ||
| error('`save` : specify a profile name') |
There was a problem hiding this comment.
Markdown doesn't actually work here ;D If that was the intent behind using ``.
Since you're using logger it will redirect error to the FFXI log, so you can use FFXI coloring functions to highlight terms.
There was a problem hiding this comment.
I think I've avoided color codes forever because they have the rare chance to bug out the chat and I couldn't really pinpoint why
|
|
||
| settings.profiles[name] = S(_roe.active:keyset()) | ||
| settings:save('global') | ||
| notice('saved %d objectives to the profile %s':format(_roe.active:length(), name)) |
There was a problem hiding this comment.
Sometimes you start sentences with upper case and sometimes with lower case!
|
|
||
|
|
||
| local needed_quests = settings.profiles[name]:diff(_roe.active:keyset()) | ||
| local available_slots = 30 - _roe.active:length() |
There was a problem hiding this comment.
Magic number! Is that a fixed constant? Maybe put it somewhere near the top for easy adjustment, if that can be ever adjusted.
I just saw below it was the length of the packet payload, so we could derive the number from the fields.lua file. That info should be available and exposed through the packets API.
| end | ||
|
|
||
| local true_strings = S{'true','t','y','yes','on'} | ||
| local false_strings = S{'false','f','n','off'} |
There was a problem hiding this comment.
'no' is missing here, unless that was intentional.
| local function inc_chunk_handler(id,data) | ||
| if id == 0x111 then | ||
| _roe.active:clear() | ||
| for i = 1,30 do |
There was a problem hiding this comment.
The same 30 as above? I assume that's packet payload length, as indicated in fields.lua. Any reason not to use packet.parse here?
There was a problem hiding this comment.
The only reason was so I didn't have to put together a string with index i :( I hate strings :(
| return (k + 1024*data:unpack('H', 133) - 1) | ||
| end):map( | ||
| function(v) | ||
| return (v == 1 and true) or false |
There was a problem hiding this comment.
This line should be equivalent to return v == 1, no?
Since they use this type of bit field quite a bit (quests, missions, key items, maps, etc.) we should maybe introduce a specific type for it so we don't need to do manual parsing...
There was a problem hiding this comment.
Whoops. And yeah, I think it would be a good idea.
No description provided.