Item Search
     
BG-Wiki Search
Page 228 of 302 FirstFirst ... 178 218 226 227 228 229 230 238 278 ... LastLast
Results 4541 to 4560 of 6036

Thread: Gearswap Help Thread!     submit to reddit submit to twitter

  1. #4541
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    Quote Originally Posted by Trumpy View Post
    I am not super code smart. So I might just not know it can work this way.
    to call a function (usually in a if statement in your lua) I usually do soemthing like "update_gear()" to call a self command I made i do "gs c follow". So I might not know that you can call a function in the same manner you can call a command? Is there a way to macro calling functions if it isnt the same you would use for a command? Short solution would be make a command that calls that function or convert said function into a command if possible. So if it isnt possible to call a function in the same manner u call a command Id say its failing cause you dont have a command set up.

    Code:
    function self_command(command)
    	if command == 'itemize_sets' then
    		itemize_sets()
    	end
    end
    I'm sorry, but I don't understand most of this. Basically, though, it's not working because the function isn't registered as a command, right? How do I pass arguments to a self-command like that, though?

    Well I thought it couldnt tell whether you had haste 1 or 2 on, just that you had a haste effect on. I have some things that happen when buffactive.haste is true or not and it works for both haste 1 and haste 2. I assumed flurry was the same.

    Also is there a way to tell if u have 2 marches on for example? Cause I assume buffactive.march would show true whichever one u had on (not that I have messed with these particualr buffs yet) OR for example I have been playing on PUP lately and Ive thought of things like oh i can do this if i have 2 earth maneuvers on (as an example), but I wasnt sure how to determine i have 2 of the same buff.
    Hell if I know, dude. I just know that if two versions of a status effect have different IDs, it can tell the difference when the ID is specified, and I would imagine Windower--judging from what you just said--handles it generically when it's just the name of the effect. Odds are different versions of March have different IDs too. I have no idea how the game handles things like maneuvers and runes, however.

  2. #4542
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    Quote Originally Posted by Trumpy View Post
    I am not super code smart. So I might just not know it can work this way.
    to call a function (usually in a if statement in your lua) I usually do soemthing like "update_gear()" to call a self command I made i do "gs c follow". So I might not know that you can call a function in the same manner you can call a command? Is there a way to macro calling functions if it isnt the same you would use for a command? Short solution would be make a command that calls that function or convert said function into a command if possible. So if it isnt possible to call a function in the same manner u call a command Id say its failing cause you dont have a command set up.

    Code:
    function self_command(command)
    	if command == 'itemize_sets' then
    		itemize_sets()
    	end
    end
    lua i gearswap user_env.function_name arg1 arg2 ... should work, but you should handle it through the self command function.

    Quote Originally Posted by Trumpy View Post
    Well I thought it couldnt tell whether you had haste 1 or 2 on, just that you had a haste effect on. I have some things that happen when buffactive.haste is true or not and it works for both haste 1 and haste 2. I assumed flurry was the same.

    Also is there a way to tell if u have 2 marches on for example? Cause I assume buffactive.march would show true whichever one u had on (not that I have messed with these particualr buffs yet) OR for example I have been playing on PUP lately and Ive thought of things like oh i can do this if i have 2 earth maneuvers on (as an example), but I wasnt sure how to determine i have 2 of the same buff.
    Buffs are only distinguishable if the ids in buffs.lua are distinct. Haste/Haste II are indistinguishable, but haste/geo-haste are distinguishable.
    For buffs with multiples: buffactive.march == 2, etc.

  3. #4543
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    Quote Originally Posted by trv View Post
    lua i gearswap user_env.function_name arg1 arg2 ... should work, but you should handle it through the self command function.
    How?????

    Buffs are only distinguishable if the ids in buffs.lua are distinct. Haste/Haste II are indistinguishable, but haste/geo-haste are distinguishable.
    For buffs with multiples: buffactive.march == 2, etc.
    Ah, so that's how it works.

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

    Are you usin Motes stuff Jeanne? If you are I prolly cant help you much, that shit is just way more complicated than I care to get in gearswap so I have written my own. I basically look at some others stuff and try to teach myself and write my own stuff. I have though taken to makin one universal lua and include it in my jobs lua so if i want to change how for example utsusemi is treated for all my jobs I just have to change it once and dont have to go thru all my luas changing it. I searched all the mote files i have in the libs folder in the gearswap folder and only found one that has self command in it and I have no idea what it means.

    I think he was saying you would try:

    //lua i gearswap user_env.itemize_sets arg1 arg2

    with "arg1" being an argument for example. I dunno I havent messed with Arguements. But if u just want that function to proc without anything else when u type a command (or hit macro) you would just stick that command i put in my first reply at the bottom of ur lua. and then type exactly what you were trying before. Also keep in mind for macros you have to type /console or /con at the start of it so:

    //con gs c itemize_sets

    if you were just typing it

    //gs c itemize_sets

    if you used a send_command() in your lua

    send_command('gs c itemize_sets')

  5. #4545
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    Quote Originally Posted by Trumpy View Post
    Are you usin Motes stuff Jeanne?
    Yes, and he barely documents anything. Never explains how the stuff most in need of explanation does its thing.

  6. #4546
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    This page looks like it covers self commands: https://github.com/Kinematics/GearSw.../wiki/Commands
    Before handling things on the include side, a call is made to job_self_command(commandArgs, eventArgs).

  7. #4547
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    Quote Originally Posted by trv View Post
    This page looks like it covers self commands: https://github.com/Kinematics/GearSw.../wiki/Commands
    Nice try, smartass, but if you bothered reading it, you'd see it doesn't explain how to write a self command and have it actually work--much less how to pass arguments through a self command to the function it's calling. That page and the Windower wiki are the only results actually related, and the latter explains even less. This may come as a shock to you, but you aren't the only one who knows how to use Google.

    Anyone have any useful input on how to make--and pass arguments to--a self command? An example would help immensely.

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

    Here's how to answer your question in all cases:

    Code:
    function name(...)
        local args = {...}
        for i,v in pairs(args) do
            print(i,v,type(v))
        end
    end
    It will tell you that argument 1 has value v and its data type.


    More specifically, iirc self_command is passed a string. So if you did "//gs c pants are fun" then it would be passed "pants are fun". I believe it does not respect whitespace, so "//gs c pants are unfun " would be passed as "pants are unfun"

  9. #4549
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    Quote Originally Posted by Byrthnoth View Post
    Here's how to answer your question in all cases:

    Code:
    function name(...)
        local args = {...}
        for i,v in pairs(args) do
            print(i,v,type(v))
        end
    end
    It will tell you that argument 1 has value v and its data type.[/code]
    I take it back. That example is not at all helpful. I know how to define a function to accept arguments.

    More specifically, iirc self_command is passed a string. So if you did "//gs c pants are fun" then it would be passed "pants are fun". I believe it does not respect whitespace, so "//gs c pants are unfun " would be passed as "pants are unfun"
    I know that part. Supposedly Motes libs actually split the string into an array, but in testing that doesn't seem to be the case. That's not the problem, though--I'm sick of relying on his irritating black-box BS anyway. Hell, I'm more than willing to write up my own libraries--with proper documentation (and hookers). The problem is:

    How do I wrap a function in a self command so I can actually call it as needed? Everything I've tried has resulted in failure to register anything at all.

    All I know is it gets passed a string. That isn't a whole lot to go on.

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

    did u see the edit i made to my last post?

  11. #4551
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    Quote Originally Posted by Jeanne Renault View Post
    I know that part. Supposedly Motes libs actually split the string into an array, but in testing that doesn't seem to be the case.
    As far as I remember, self_command is passed a string. From the link's description of job_self_command, I assumed the command was passed to job_self_command before any processing was done. You can split it into an array if you want to.

    Code:
    function job_self_command(commandArgs, eventArgs)
        commandArgs= commandArgs:split(' ')
    end
    You passed self_command the string 'itemize_sets(sets.Stoneskin, \'get\')', which isn't how self_command functions usually work. I guess you could do loadstring(commandArgs)() if you wanted to be unique.

    Quote Originally Posted by Jeanne Renault View Post
    How do I wrap a function in a self command so I can actually call it as needed? Everything I've tried has resulted in failure to register anything at all.
    You don't need to wrap a function in anything. Call the function from job_self_command.

    Code:
    function job_self_command(commandArgs, eventArgs)
        commandArgs= commandArgs:split(' ')
    
        if commandArgs[1] == 'itemize_sets' then
            itemize_sets(commandArgs[2], commandArgs[3])
        end
    
    end
    //gs c itemize_sets sets.Stoneskin get

    Edit: Er, keep in mind that sets.Stoneskin will be a string. You'd need to rewrite your function to convert 'sets.Stoneskin' into the actual table.
    Code:
    local t = commandArgs[2]:split('.')
    local sets = t[1]
    for i = 1, #t do
        sets = sets[t[i]]
    end

  12. #4552
    Melee Summoner
    Join Date
    Jul 2015
    Posts
    43
    BG Level
    1
    FFXI Server
    Bahamut

    I think I've got enough to go on now.

    Quote Originally Posted by Trumpy View Post
    did u see the edit i made to my last post?
    I stopped reading after you said you don't use Motes, because odds are you probably can't help me.

  13. #4553
    trv
    trv is offline
    Melee Summoner
    Join Date
    Oct 2014
    Posts
    48
    BG Level
    1

    Quote Originally Posted by Jeanne Renault View Post
    you probably can't help me.
    I'm not sure anyone can. If you stop looking for hidden barbs you'll see that at least three solutions to your problem have been posted.

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

    Can addons deal with arguments? maybe it would jsut be easier to write an addon to do whatever you like?

    Also a lil more courtesy towards those tryin to help would be nice, a couple of your replies (for this and your previous problem) have been dismissive, or acted like people are straight tryin to troll you which none of us have been. Nobody can get in your head and see exactly what you want. Obviously in all the time we have had gearswap no body has asked for your exact issue, and most the devs dont even play the game anymore so its awfully nice of them to try and help ya. Not tryin to start beef or anything, im just saying (I am not personally offended, but sometimes I read a post on here recently and think well that could have been a bit more polite).

    Also a problem with Motes stuff is he isnt around anymore to help us with new issues so it mightbe best to just start from scratch so you know what's what.

  15. #4555
    Sea Torques
    Join Date
    Jun 2007
    Posts
    522
    BG Level
    5
    FFXI Server
    Lakshmi

    He clearly doesn't like Lua and is trying to pretend that he's superior to us all because he thinks he knows how to program from his extensive python and ruby scripting.

    Edit: btw I hate Lua too~ but it's no where near as bad as you're making it sound

  16. #4556
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Trumpy View Post
    Also is there a way to tell if u have 2 marches on for example? Cause I assume buffactive.march would show true whichever one u had on (not that I have messed with these particualr buffs yet) OR for example I have been playing on PUP lately and Ive thought of things like oh i can do this if i have 2 earth maneuvers on (as an example), but I wasnt sure how to determine i have 2 of the same buff.
    actually gearswap does not use true or false for buffactive it uses a count so
    if you have one march up its (these are the same)
    buffactive.March == 1
    buffactive['March'] == 1
    buffactive[214] == 1
    for 2 marches it looks like this (these are the same)
    buffactive.March == 2
    buffactive['March'] == 2
    buffactive[214] == 2

    when you check a table you will get true if it exists false if it does not which is why if you do this it works (these are the same)
    if buffactive.March then
    if buffactive['March'] then
    if buffactive[214] then

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

    Ok Thanks very much dlsmd!

  18. #4558
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    Quote Originally Posted by Trumpy View Post
    Ok Thanks very much dlsmd!
    not to be rude but you did read GearSwap\beta_examples_and_information\Variables.x lsx
    it says
    buffactive - table - Stores the number of a given buff that is active. Keys are the buff names (case insensitive), so buffactive['light arts'] would be nil or 1 depending whether or not you have light arts up.

    all the info for most of the possible things is in there

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

    I check it frequently. Like i said i dont have any training or know how on code so ive only learned via what ive seen in other luas, and i havent really checked out anyone else's in a long time. when it says "stores a number of a given buff" i wouldnt have the know how to get that number without havin seen an example. (but now I know, assuming I can remember when my sub is active again)

    but its all good, I havent really had a need for that kind of thing in my luas yet (I dont need 4 sets of various levels of haste gear, most times i would have marches it would be from trusts and I dont have that much variety of gear that the sets would be much different). just occasional fleeting thoughts like "oh i could do that, if i could track how many of the same buff i have," none of which i could think of right now. I cant even think of what I had thought of for PUP just last week if i could have tracked 2 maneuvers. Seriously if i walk out of the room to do something, half the time i have forgotten what it was by the time i get to the room it is in.

  20. #4560
    Bagel
    Join Date
    Dec 2012
    Posts
    1,488
    BG Level
    6

    ok Trumpy
    just rember this
    in lua everything is in a table
    (what i say seems counter intuitive but its the truth)

    every table always starts with _G but you would only need this if you want to search through all tables or dynamically set a table
    these 2 tables are identical and the same one its just that in lua you do not need the _G
    tab = {}
    tab.1=1
    tab.2=4

    _G.tab = {}
    _G.tab.1=1
    _G.tab.2=4

    yes even a function is the same
    pretarget(spell)
    is the same as
    _G.pretarget(spell)

Page 228 of 302 FirstFirst ... 178 218 226 227 228 229 230 238 278 ... LastLast

Similar Threads

  1. Replies: 6547
    Last Post: 2014-07-08, 22:45