Item Search
     
BG-Wiki Search
Page 264 of 307 FirstFirst ... 214 254 262 263 264 265 266 274 ... LastLast
Results 5261 to 5280 of 6124
  1. #5261
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Can anybody tell me where I can find the full structure/possibilities of the "items" luacore variable?
    I know the following:

    items.inventory
    items.wardrobe

    What's the correct syntax for the other repositories? Mog Locker, Mog Safe 2, Storage etc?

  2. #5262
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    res/bags.lua

  3. #5263
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Ok thanks.
    So, referring to an old request I made some months ago, I finally found some time to check validate.lua
    Initially I was trying to add more functions (by default there's only validate_inventory and validate_sets) but after a closer look I found out that the current validate_inventory and related functions, are already written in a way that it accepts parameters, it's just that currently there's an "inventory" default parameter defined.
    So changing a few things, I allowed the valdiate_inventory function to accept an additional parameter, this should allow the function to work not only for inventory, but for every item repository, one at a time.
    Here it is, explanations after:

    Spoiler: show
    Code:
    function validate(options)
        local validateType = 'sets'
        if options and #options > 0 then
            if S{'sets','set','s'}:contains(options[1]:lower()) then
    			validateType = 'sets'
                table.remove(options,1)
            elseif S{'inventory','inv','i'}:contains(options[1]:lower()) then
                validateType = 'inventory'
                table.remove(options,1)
    		elseif S{'mogsafe','safe','ms'}:contains(options[1]:lower()) then
                validateType = 'safe'
    			table.remove(options,1)
    		elseif S{'mogsafe2','safe2','ms'}:contains(options[1]:lower()) then
    			validateType = 'safe 2'
    			table.remove(options,1)
    		elseif S{'storage','st'}:contains(options[1]:lower()) then
                validateType = 'storage'
    			table.remove(options,1)
    		elseif S{'moglocker','locker','ml'}:contains(options[1]:lower()) then
    			validateType = 'locker'
    			table.remove(options,1)
    		elseif S{'mogsatchel','satchel','sa'}:contains(options[1]:lower()) then
                validateType = 'satchel'
    			table.remove(options,1)
    		elseif S{'mogsack','sack','sk'}:contains(options[1]:lower()) then
                validateType = 'sack'
    			table.remove(options,1)
    		elseif S{'mogcase','case','c'}:contains(options[1]:lower()) then
                validateType = 'case'
    			table.remove(options,1)
    		elseif S{'wardrobe','w'}:contains(options[1]:lower()) then
                validateType = 'wardrobe'
    			table.remove(options,1)
            end
        end
        
        if validateType == 'sets' then
            validate_sets(options)
        else
            validate_inventory(options, validateType)
        end
    end
    
    
    ...
    
    
    -- Function for determining and displaying which items from a player's selected repository are not in their gear sets.
    function validate_inventory(filter, repository)
        msg.addon_msg(123,'Checking for items in '..repository..' that are not used in your gear sets.')
        
        local extra_items = search_sets_for_items_in_bag(items.repository, filter)
        
        local display_list = get_item_names(extra_items):sort(insensitive_sort)
        display_list:map(function(item) msg.add_to_chat(120, (string.gsub(item, "^%l", string.upper)) ) end)
        msg.addon_msg(123,'Final count = '..tostring(display_list:length()))
    end



    I only changed these 2 functions. The third one (search_sets_for_items_in_bag) already had an entry parameter called "bag", problem was that it was always called with "items.inventory". It should work with every repository if you actually feed the function with a different value.
    So let's see what I changed in the first function.
    I basically added parameters for all the other repositories. By default it only accepts "sets" and "inv" as options. Now it's gonna accept many other options, each for every repository type.
    Then I slightly changed how the variable "validateType" gets handled, so that I can use it later to call another function without the necessity to create a new specific variable.
    In the last "if" of this function I inverted the order. It originally used to be "if inv then ... else validate_sets", now it does the opposite. It checks if it's "sets" and then it calls validate_sets. Otherwise it calls validate_inventory with options and an additional parameter, validateType (see above).

    Next I slightly changed validate_inventory function to accept a second parameter, and this second parameter gets used within the function in those places where it had items.inventory. Now it's gonna be items.parameter.


    I'm not home so I can't test it, and I won't be home for like ~14 more hours. I would be really happy if someone could test it meanwhile :D

  4. #5264
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Oh I didn't explain the purpose of this function ><
    I created it to "clean up" my repositories.
    As I get new items and update my luas, my repositories are full of items which I no longer use, but I forget to delete them or send to mule.
    How can I spot all these items that I no longer use in any of my sets?

    validate(inv) is an useful function that checks for extra (unused) items that are currently in your inventory but not used in your current lua sets.
    What if I could use the same function to check mog locker, storage etc?
    And that's why I created it.


    Of course, it makes no sense to use this new validate function with a "normal" lua.
    You need to create a "special" lua that merges together all the sets of all your jobs' lua. You load this custom lua, and then launch validate. At that point it should work, in theory.
    Can create this lua on your own by copy-pasting whatever is inside your "sets" function, or you could use a smarter way like TRV explained in this post.

    Just manually load this lua and then launch validate, and it should work!
    Can't wait to test it and do some cleaning in my mog house...

  5. #5265
    Blue Magic is Best Magic
    Join Date
    Jul 2007
    Posts
    8,215
    BG Level
    8

    No word on Dressup in the works to being fixed? Or did I miss it.

  6. #5266
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,868
    BG Level
    6

    Gear Swap still doesnt allow you to use a /item "Item Name" <t/stnpc/ect> type macro. It jsut acts as if you did nothing at all. especially annoying trying to do the halloween event and had to jsut unload the addon (or use Zaldon or a few other things.) I am not sure but i think it allows you to macro forbidden keys still. Id have to check I havent been to abby in forever.

  7. #5267
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    That sounds more like a Shortcuts issue than a Gearswap one?

  8. #5268
    BG Content
    Join Date
    Jul 2007
    Posts
    22,371
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    No, it's an issue with specific items. There are two item usage packets and I still have no idea why the game uses one vs. the other.

  9. #5269
    Relic Weapons
    Join Date
    Dec 2009
    Posts
    318
    BG Level
    4
    FFXI Server
    Carbuncle

    Quote Originally Posted by Draylo View Post
    No word on Dressup in the works to being fixed? Or did I miss it.
    There was an update to Dressup about two days ago. It looks like it's behaving better now, at least for the brief time I tried it.

  10. #5270
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Ok, tested my customization of validate.lua and it sorta works, now you're able to use it for each repository and not just inventory, but still I encountered one major issue, I need guidance to solve it.

    Is there a way to create a "fake" lua that includes all of my other LUA files? I have one for each job and I tried to create a blank lua with "include('filename')" for each of my files. I don't get errors, but it doesn't seem to work. Otherwise, can you think of another way to create a big "function get_sets()" that includes all of my function get_sets for my other luas? Tried the method TRZ suggests in this post but it's not working for me, I get errors.

  11. #5271
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Sechs View Post
    Otherwise, can you think of another way to create a big "function get_sets()" that includes all of my function get_sets for my other luas? Tried the method TRZ suggests in this post but it's not working for me, I get errors.
    not if there not a do or with different names
    you could try to do it like this
    <jobname> = include('jobfilename')
    example:
    Warrior = include('WAR.lua')
    then you would do
    Warrior.get_sets()
    but im not sure

  12. #5272
    Sea Torques
    Join Date
    Aug 2006
    Posts
    518
    BG Level
    5
    FFXI Server
    Leviathan

    Getting an error

    extdata.lua.1878: bad argument #1 to 'match' (string expected, got table)

  13. #5273
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by stamos View Post
    Getting an error

    extdata.lua.1878: bad argument #1 to 'match' (string expected, got table)
    whats that from??

  14. #5274
    Sea Torques
    Join Date
    Aug 2006
    Posts
    518
    BG Level
    5
    FFXI Server
    Leviathan

    Gearswap I am pretty sure.

    But win/addons/libs

  15. #5275
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by dlsmd View Post
    not if there not a do or with different names
    you could try to do it like this
    <jobname> = include('jobfilename')
    example:
    Warrior = include('WAR.lua')
    then you would do
    Warrior.get_sets()
    but im not sure
    I tried two things so far, first a blank lua with:
    Spoiler: show
    Code:
        user_files = {MNK', 'RUN', 'DNC', 'PUP', 'NIN', 'THF', 'SCH', 'GEO', 'SMN', 'BRD'}
        used_gear = S{}
        sets = {}-- define the sets table, then load the contents of the user files. The gearsets defined in your files will automatically load into sets.
        for i = 1, #user_files do
            local path = windower.windower_path .. '/addons/GearSwap/data/' .. user_files[i] .. '.lua'
            loadfile(path)() -- the last set of parenthesis is very important
            if get_sets then -- check to see if you defined your gear in a get_sets function rather than outside of a function.
                get_sets()
                get_sets = nil -- wipe the get_sets function to avoid any conflict with the next files (if they don't contain a get_sets function, etc.)
            end
    function get_sets()
    end

    with this test I get an error on the line 6, says loadfile is a wrong command or returns nil, don't remember, an error related to the loadfile command though.

    Then I tried a blank file with this:
    Spoiler: show
    Code:
    function get_sets()
    include('THF')
    include('NIN')
    include('DNC')
    include('RUN')
    include('MNK')
    include('PUP')
    include('BRD')
    include('SMN')
    include('SCH')
    include('GEO')
    end

    This doesn't work either, the content of the get_sets within those luas doesn't get loaded.


    Not sure I get what it is that you're suggesting me to do D:

  16. #5276
    Sea Torques
    Join Date
    Aug 2006
    Posts
    518
    BG Level
    5
    FFXI Server
    Leviathan

    Nvm fixed it! I think

    Had an extra { on one of my augments

  17. #5277
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    if your trying to get all the sets from each of your gearsets to populate in to one setup there what i said should work but and gearsets with the same name will be overwritten
    if this is being done in geqarswap this is what you need but what i just said is true(one line up)
    Code:
        user_files = {MNK', 'RUN', 'DNC', 'PUP', 'NIN', 'THF', 'SCH', 'GEO', 'SMN', 'BRD'}
        used_gear = S{}
        sets = {}-- define the sets table, then load the contents of the user files. The gearsets defined in your files will automatically load into sets.
        for i = 1, #user_files do
            local path = windower.windower_path .. '/addons/GearSwap/data/' .. user_files[i] .. '.lua'
            include(path) -- the last set of parenthesis is very important
            if get_sets then -- check to see if you defined your gear in a get_sets function rather than outside of a function.
                get_sets()
                get_sets = nil -- wipe the get_sets function to avoid any conflict with the next files (if they don't contain a get_sets function, etc.)
            end
        end

  18. #5278
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by dlsmd View Post
    but and gearsets with the same name will be overwritten
    That's a big problem =/ A fuckton of my sets have the same names across jobs.
    Isn't there a way to rename them filename.setsname while importing them into the new file?

  19. #5279
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Sechs View Post
    That's a big problem =/ A fuckton of my sets have the same names across jobs.
    Isn't there a way to rename them filename.setsname while importing them into the new file?
    --everybodys has sets with the same name
    not that i know of

  20. #5280
    Campaign
    Join Date
    Jul 2007
    Posts
    6,633
    BG Level
    8

    Quote Originally Posted by dlsmd View Post
    --everybodys has sets with the same name
    not that i know of
    Yeah the solution would be u sing Notepad++, going into each of my jobs' sets, and using the replace function to replace "sets." with "sets.job."
    That way each set on each job lua will have a different name and the function you shared above wouldn't overwrite anything.
    Worth trying I guess.

    Atm I created a file manually with copy/paste lol.
    But it was enough to test my changes to validate.lua and they work perfectly. Cleaned my inventory from 9 items already! :D
    I won't submit it to github though, doubt anybody else would be interested.

Page 264 of 307 FirstFirst ... 214 254 262 263 264 265 266 274 ... LastLast

Similar Threads

  1. Service and Support
    By Ribeye in forum FFXI: Everything
    Replies: 8
    Last Post: 2009-10-17, 18:23
  2. Windows vista and FFXI problem
    By Takeno in forum FFXI: Everything
    Replies: 1
    Last Post: 2007-07-26, 13:36
  3. Windows Vista and Windower
    By divisortheory in forum FFXI: Everything
    Replies: 35
    Last Post: 2006-06-23, 04:19