Item Search
     
BG-Wiki Search
+ Reply to Thread
Page 19 of 20 FirstFirst ... 9 17 18 19 20 LastLast
Results 361 to 380 of 383
  1. #361
    a p. sweet dude
    Pens win! Pens Win!!! PENS WIN!!!!!

    Join Date
    Jul 2010
    Posts
    17,958
    BG Level
    9

    Thanks for explaining, Byrth.

  2. #362

    Quote Originally Posted by Obsidian View Post
    Thanks for explaining, Byrth.
    i believe this is the issue you are having
    Code:
    Advanced string building
        when using a string value you have a choice between using '<string>' and "<string>" but there are some things you need to know
        when using a string and your string includes another "or' it will cause an error
        Example:
            "How are you" --correct
            'How are you' --correct
            "How "are" you" --incorrect
            'How 'are' you' --incorrect
        string do have special characters for use the specific situations like \
        Example:
            "How \"are\" you" --correct
            'How \'are\' you' --correct
            "How 'are' you" --correct
            'How "are" you' --correct
    when doing a spell from gearsap like
    /ma "Enlight II" <me>
    when in text these are the only valid ways
    '/ma "Enlight II" <me>'
    "/ma 'Enlight II' <me>"

  3. #363
    a p. sweet dude
    Pens win! Pens Win!!! PENS WIN!!!!!

    Join Date
    Jul 2010
    Posts
    17,958
    BG Level
    9

    In client,

    /ma 'Enlight II' <me>

    is a valid command that will cast Enlight II on yourself. The command wasn't malformed, it's just a syntax Gearswap evidently wasn't built to consider.

  4. #364
    a p. sweet dude
    Pens win! Pens Win!!! PENS WIN!!!!!

    Join Date
    Jul 2010
    Posts
    17,958
    BG Level
    9

    And since I'm asking stupid questions anyway, does anyone know what the M in front of most state variable assignments means? The LUA language documentation isn't really giving me what I'm looking for.

  5. #365
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,867
    BG Level
    6

    I would like to know if its possible to determine, within gearswap, if a specific Blue Magic spell is actually set to use.

    For example, lets say I want to make a Blue Mage sleeping macro. But I only set one of the two spells at a time, so instead of making a macro for both Sheep Song and a macro for Dream Flower, I want to make one macro which uses a command like:
    Code:
    /con gs c blusleep
    And within that command have it check:
    Code:
    if command == 'blusleep' then
    	if "dream flower is set" and "recast ready" then
    		send_command('dreamflower')
    	elseif "sheep song is set" and "recast ready" then
    		send_command('sheepsong')
    	end
    end
    is there a piece of script like how "windower.ffxi.get_spell_recasts()[678] < 1"
    determines if Dream Flower recast is ready, that will determine if a spell is set?
    Or maybe if its a better solution to make a function like blusleep_set()
    and call it at the start of the command and have it check:
    Code:
    if command == 'blusleep' then
    	blusleep_set()
    	if "dreamflower recast ready" and dreamflowerset then
    		send_command('dreamflower')
    	elseif "sheepsong recast ready" and sheepsongset then
    		send_command('sheepsong')
    	end
    end
    and the function:
    Code:
    function blusleep_set()
    	if "STUFF THAT DETERMINES DREAM FLOWER IS SET" then
    		dreamflowerset = true
    	else
    		dreamflowerset = false
    	end
    	if "STUFF THAT DETERMINES SHEEP SONG IS SET" then
    		sheepsongset = true
    	else
    		sheepsongset = false
    	end
    end
    If there is a way, I just need the part of the script that would determine if the spell is set to use. The rest I can figure out on my own. In the above code anything bold is placeholder for the actual code that works.

  6. #366
    BG Content
    Join Date
    Jul 2007
    Posts
    19,040
    BG Level
    9
    FFXI Server
    Lakshmi
    Blog Entries
    1

    For normal spells on BLU main:
    Code:
    table.contains(windower.ffxi.get_mjob_data().spells,spell.id)
    Dream Flower is spell.id 678 and sheep song is spell.id 584

    For UL spells, just check for the UL buff.

  7. #367
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,867
    BG Level
    6

    Quote Originally Posted by Byrthnoth View Post
    For normal spells on BLU main:
    Code:
    table.contains(windower.ffxi.get_mjob_data().spells,spell.id)
    Dream Flower is spell.id 678 and sheep song is spell.id 584

    For UL spells, just check for the UL buff.
    Thank you Byrthnoth! This works perfectly!

    is there a way to check if summoning a mount ability is ready or get its recast? I forgot to ask about that.

  8. #368
    BG Content
    Join Date
    Jul 2007
    Posts
    19,040
    BG Level
    9
    FFXI Server
    Lakshmi
    Blog Entries
    1

    I think mounts are technically job abilities, so:
    Code:
            local available = windower.ffxi.get_abilities().job_abilities
            if not table.contains(available,action.id) then
                bool,err = false,"Unable to execute command. You do not have access to that job ability."
            end
    I would imagine that get_abilty_recasts has the recasts.

  9. #369
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,867
    BG Level
    6

    Quote Originally Posted by Byrthnoth View Post
    I think mounts are technically job abilities, so:
    Code:
            local available = windower.ffxi.get_abilities().job_abilities
            if not table.contains(available,action.id) then
                bool,err = false,"Unable to execute command. You do not have access to that job ability."
            end
    I would imagine that get_abilty_recasts has the recasts.
    im assuming this will give me an ID of an ability when used? where do i put this code at? i put it in precast and it give me a "attempt to index global 'action' (a nil value)" error. I honestly thought it was a ability recast too, but i didnt see it in the resources ability recast file.

    My next question is: in the "function buff_change(buff,gain)" I used to have chatmon play sounds when i got certain debuffs like encumberance, silence, petrify, ect... helps when i dual box so i know to switch over to fix it or i just dont notice the debuffs. These sounds arent working anymore. I take the code and switch in the buff name haste in place of the debuff name and the sound plays properly (so the code should work). So before i continue to try and get it to work (already spent a few days), did someone disable the ability to do things when gaining a debuff only and specifically? so far any debuff from charm to sleep to hp max down doesnt give me a sound. But for buffs (like sneak attack) that i want to trigger a variable for, or like Reive Mark, it can still put on adoulin's refuge +1 and lock the neck piece when gained and unlock when lost. I dont know what im doing wrong so i just thought id check.
    Code:
    function buff_change(buff,gain)
    -- DOES NOT WORK BELOW
    	if buff == 'Charm' and gain then	send_command('chatmon play c:/chatmon/charm.wav')	end
    	if buff == 'Doom' and gain then	send_command('chatmon play c:/chatmon/doom.wav')	end
    	if buff == 'Sleep' and gain then	send_command('chatmon play c:/chatmon/sleep.wav')	end
    	if buff == 'Petrification' and gain then	send_command('chatmon play c:/chatmon/petrify.wav')	end
    	if buff == 'Paralysis' and gain then	send_command('chatmon play c:/chatmon/paralyze.wav')	end
    	if ( buff == 'Silence' or buff == 'Mute' ) and gain then	send_command('chatmon play c:/chatmon/silence.wav')	end
    	if ( buff == 'Stun' or buff == 'Terror' ) and gain then	send_command('chatmon play c:/chatmon/stun.wav')	end
    	if buff == 'Amnesia' and gain then	send_command('chatmon play c:/chatmon/amnesia.wav')	end
    	if buff == 'Encumbrance' and gain then	send_command('chatmon play c:/chatmon/encumbrance.wav')	end
    -- WORKS BELOW
    	if buff == 'Haste' and gain then	send_command('chatmon play c:/chatmon/charm.wav')	end
    	if buff == 'Dedication' and not gain then	send_command('chatmon play c:/chatmon/commitment.wav')	end
    	if buff == 'Commitment' and not gain then	send_command('chatmon play c:/chatmon/commitment.wav')	end
    	if buff == "Divine Emblem" and not gain then	emblem = 1	end
    	if buff == "Protect" and not gain then	protect = false	end
    	if buff == 'Reive Mark' then	
    		if gain then	equip(sets.reive)	send_command('gs disable neck')	send_command('timers d "Reive Mark"')
    		else	send_command('gs enable neck')	send_command('timers c "Reive Mark" 300 down')	end
    	end
    end

  10. #370
    BG Content
    Join Date
    Jul 2007
    Posts
    19,040
    BG Level
    9
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Use `spell` (or whatever you name the first argument to precast) instead of `action`

    Do the files you are trying to play exist?

  11. #371
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,867
    BG Level
    6

    Yeah they exist. Like I said I can copy and paste the code from a debuff and simply replace the name of the debuff "sleep" or whatever with "haste" and it will trigger anytime I get haste. So it feels like something debuff specific.

  12. #372
    i should really shut up
    Join Date
    Sep 2011
    Posts
    3,479
    BG Level
    7
    FFXI Server
    Asura

    Working on a THF gearswap for myself, and it broke after messing with it for awhile. Long story short, I undid every change back to the functional state it had been before I started.

    Yet I keep getting:

    GearSwap: Lua runtime error: GearSwap/refresh.lua.174: GearSwap: File failed to load:
    ... Files <my lua directory path>/THF.lua: 1377: attempt to index global 'spell' (a nil value)

    EDIT: Just in case, here is a temp paste of the lua.

  13. #373

    Quote Originally Posted by Spicyryan View Post
    Working on a THF gearswap for myself, and it broke after messing with it for awhile. Long story short, I undid every change back to the functional state it had been before I started.

    Yet I keep getting:

    GearSwap: Lua runtime error: GearSwap/refresh.lua.174: GearSwap: File failed to load:
    ... Files <my lua directory path>/THF.lua: 1377: attempt to index global 'spell' (a nil value)

    EDIT: Just in case, here is a temp paste of the lua.
    the file you posted is not the file with this error

    GearSwap: Lua runtime error: GearSwap/refresh.lua.174: GearSwap: File failed to load:
    ... Files <my lua directory path>/THF.lua: 1377: attempt to index global 'spell' (a nil value)

  14. #374
    i should really shut up
    Join Date
    Sep 2011
    Posts
    3,479
    BG Level
    7
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    the file you posted is not the file with this error

    GearSwap: Lua runtime error: GearSwap/refresh.lua.174: GearSwap: File failed to load:
    ... Files <my lua directory path>/THF.lua: 1377: attempt to index global 'spell' (a nil value)
    This THF Lua is just a copy paste and edit of my DRG Lua. Which is a copy paste of my RUN. Which is a copy paste of my BLU.

    When I get on those 3 jobs I don't get the error, which only suddenly popped up and remains despite, as far as I know, undoing any changes. When I get on THF I get that error. I keep going over a side by side view of the THF Lua with my BLU and DRG and the difference hasn't jumped out at me.

    All of those are in my Pastebin.


  15. #375
    Relic Horn
    Join Date
    Jun 2007
    Posts
    3,463
    BG Level
    7
    FFXI Server
    Odin
    WoW Realm
    Lightbringer

    Just delete the function "mc_JA" on line 1376 and line 1474 since it does nothing. Or change it from this:

    mc_JA(spell, act)

    to this:

    mc_JA(act)

  16. #376
    i should really shut up
    Join Date
    Sep 2011
    Posts
    3,479
    BG Level
    7
    FFXI Server
    Asura

    Quote Originally Posted by Seraph View Post
    Just delete the function "mc_JA" on line 1376 and line 1474 since it does nothing. Or change it from this:

    mc_JA(spell, act)

    to this:

    mc_JA(act)
    Mhm, nope, I do that and I still get the error. Additionally, those same lines are sitting in my other luas and don't throw the error.

  17. #377
    Relic Shield
    Join Date
    Jan 2013
    Posts
    1,867
    BG Level
    6

    Quote Originally Posted by Byrthnoth View Post
    Do the files you are trying to play exist?
    The files do exist, and it works with pretty much any buff name in place of the debuff. any luck or chance you might be able to look at the gearswap code if there is something preventing debuffs from triggering things in the buff_change function? it also doesnt allow for things like using opo opo necklace for sleep, gear that enhances cursna effects (one might wear while doomed for example) and other gear that does things with certain debuffs, assuming people did these things.

    But also i wanted to mention the black mage ability "Cascade" seems to be missing from the resources file for ability_recasts, maybe some other file as well. i googled "cascade ability_recast" and the first result was someone reporting it on the github for windower on Mar 17, 2019. so its been forgotten or something.

  18. #378

    Quote Originally Posted by Spicyryan View Post
    This THF Lua is just a copy paste and edit of my DRG Lua. Which is a copy paste of my RUN. Which is a copy paste of my BLU.

    When I get on those 3 jobs I don't get the error, which only suddenly popped up and remains despite, as far as I know, undoing any changes. When I get on THF I get that error. I keep going over a side by side view of the THF Lua with my BLU and DRG and the difference hasn't jumped out at me.

    All of those are in my Pastebin.

    line 1377 on each of those files is different from your thf file so there is no comparison with out seeing the same exact file you are using when you get the error we cant figure it out

  19. #379
    i should really shut up
    Join Date
    Sep 2011
    Posts
    3,479
    BG Level
    7
    FFXI Server
    Asura

    Quote Originally Posted by dlsmd View Post
    line 1377 on each of those files is different from your thf file so there is no comparison with out seeing the same exact file you are using when you get the error we cant figure it out
    Here is a paste of it exactly.

  20. #380
    BG Content
    Join Date
    Jul 2007
    Posts
    19,040
    BG Level
    9
    FFXI Server
    Lakshmi
    Blog Entries
    1

    With a superficial glance, I don't see how the error is possible. It is nominally throwing the error for mc_JA, which contains no indexing. Also, even if it was indexing in there it should be indexing the local variable spell, not the global variable spell. Given that, the only options are that either the line number in your paste / on your computer don't correspond or that the function definition itself is being interpreted as referencing the global variable.

    I'm guessing that there are some scoping problems. The only weird things I see in the paste are the:
    Code:
    do return end
    statements.

    Could you please change them to
    Code:
    return
    and see if it fixes it?

    Do blocks in Lua are not something I use frequently and while there shouldn't *really* be a problem with that code as I understand it, I'm also not entirely sure about it.

Quick Reply Quick Reply

  • Decrease Size
    Increase Size
  • Remove Text Formatting
  • Insert Link Insert Image Insert Video
  • Wrap [QUOTE] tags around selected text
  • Insert NSFW Tag
  • Insert Spoiler Tag

Similar Threads

  1. Gearswap Help Thread!
    By JSHidaka in forum FFXI: Everything
    Replies: 6035
    Last Post: 2018-05-06, 17:15
  2. Randomerest Question Thread III: This Time It's Random
    By isladar in forum FFXI: Everything
    Replies: 868
    Last Post: 2009-08-18, 12:03