Item Search
     
BG-Wiki Search
Closed Thread
Page 10 of 302 FirstFirst ... 8 9 10 11 12 20 60 ... LastLast
Results 181 to 200 of 6036

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

  1. #181
    CoP Dynamis
    Join Date
    Jul 2007
    Posts
    270
    BG Level
    4
    FFXI Server
    Asura

    Alright, thanks again.

  2. #182
    Relic Weapons
    Join Date
    Aug 2010
    Posts
    335
    BG Level
    4
    FFXI Server
    Asura

    Having trouble getting this bit of code to work... currently does nothing. I'm wondering if my syntax is incorrect

    Trying to make it activate presto automatically every time the buff is available and when a step is used.

    Code:
    	if spell.type == '*step' and not buffactive['Presto'] then
    		if not buffactive['Finishing Move*'] or buffactive['Finishing Move 2'] then
    			cancell_spell()
    			send_command('input /ja "Presto" <me>;wait 1.5;input /ja "'..spell.name..'" <t>;')
    		end
    	end

  3. #183
    First invited, last in the zone.
    Join Date
    Sep 2008
    Posts
    1,449
    BG Level
    6
    FFXI Server
    Lakshmi

    spell.type for steps is going to be JobAbility, so the condition above is never valid, which is why it's not doing anything. (I haven't looked to see if it has other problems).

    you'd want spell.name there. I'm also not sure that wildcards are valid in string literals in lua. you might need to use if string.find(spell.name:lower,'step') if spell.name=='*Step' doesn't work.

  4. #184
    Sea Torques
    Join Date
    Sep 2012
    Posts
    743
    BG Level
    5
    FFXI Server
    Leviathan

    Any of these will work fine:

    Code:
    spell.name:match('.*Step')
    windower.wc_match(spell.name, '*Step')
    spell.name:wcmatch('*Step')
    windower.regex.match(spell.name, '.*Step')

  5. #185
    Relic Weapons
    Join Date
    Aug 2010
    Posts
    335
    BG Level
    4
    FFXI Server
    Asura

    Thanks for the help guys!! :D Appreciate it.

    Code:
    	if string.find(spell.name:lower(), 'step') and not buffactive['Presto'] then
    		if not buffactive['Finishing Move*'] or buffactive['Finishing Move 2'] then
    			cancel_spell()			
    			send_command('input /ja "Presto" <me>;wait 1.5;input /ja "'..spell.name..'" <t>;')
    		end
    	end
    This ends up working but another issue has appeared. I think it has something to do with my second if statement:

    Code:
    if not buffactive['Finishing Move*'] or buffactive['Finishing Move 2'] then
    It will try to activate Presto even when there's more than 2 finishing moves.

  6. #186
    First invited, last in the zone.
    Join Date
    Sep 2008
    Posts
    1,449
    BG Level
    6
    FFXI Server
    Lakshmi

    Quote Originally Posted by Treize Kordero View Post
    This ends up working but another issue has appeared. I think it has something to do with my second if statement:

    Code:
    if not buffactive['Finishing Move*'] or buffactive['Finishing Move 2'] then
    It will try to activate Presto even when there's more than 2 finishing moves.
    Try explicit parentheses? It might be distributing the not. i.e. if (not buffactive[FM] ) or buffactive[FM2]

  7. #187
    The Syrup To Waffles's Waffle
    Join Date
    Jun 2007
    Posts
    5,053
    BG Level
    8
    FFXIV Character
    Cair Bear
    FFXIV Server
    Excalibur
    FFXI Server
    Fenrir

    You can't lookup by wildcard. 'Finishing Move*' is looking for the entry keyed to the literal string 'Finishing Move*'.

  8. #188
    Relic Weapons
    Join Date
    Aug 2010
    Posts
    335
    BG Level
    4
    FFXI Server
    Asura

    Quote Originally Posted by Foldypaws View Post
    Try explicit parentheses? It might be distributing the not. i.e. if (not buffactive[FM] ) or buffactive[FM2]
    Thanks that always gets me when coding..

    Changing it to this made it work correctly:
    Code:
    if (not buffactive['Finishing Move']) or buffactive['Finishing Move 2'] then
    Final code looks like this:
    Code:
    -- Activates Presto when a step is used.	
    	if string.find(spell.name:lower(), 'step') and not buffactive['Presto'] then
    		if (not buffactive['Finishing Move']) or buffactive['Finishing Move 2'] then
    			cancel_spell()			
    			send_command('input /ja "Presto" <me>;wait 2;input /ja "'..spell.name..'" <t>;')
    		end
    	end
    Quote Originally Posted by Cairthenn View Post
    You can't lookup by wildcard. 'Finishing Move*' is looking for the entry keyed to the literal string 'Finishing Move*'.
    Yeah I ended up figuring that out the hard way >.<

  9. #189

    Tried to do another spell table for NIN but some how mucked it up.

    Code:
    	-- Maps Ninja spell nukes for the midcast function, can change mapping as needed
    	ninjaSpells = T{'Doton: Ichi', 'Huton: Ichi', 'Hyoton: Ichi', 'Katon: Ichi', 'Raiton: Ichi', 'Suiton: Ichi',
    					'Doton: Ni', 'Huton: Ni', 'Hyoton: Ni', 'Katon: Ni', 'Raiton: Ni', 'Suiton: Ni',
    					'Doton: San', 'Huton: San', 'Hyoton: San', 'Katon: San', 'Raiton: San', 'Suiton: San'}
    Code:
        if spell.skill == 'Ninjutsu' then
            if ninjaSpells[spell.english] then
                equip(sets.midcast.Ninjutsu.Nuke)
            else
                equip(sets.midcast.Ninjutsu)
            end
    	end
    I am certain it is an easy fix but for the life of me I cant seem to get it.
    Please help.

  10. #190

    Instead of this

    Code:
    if ninjaSpells[spell.english] then
    do this

    Code:
    if ninjaSpells:contains(spell.english) then

  11. #191
    The Syrup To Waffles's Waffle
    Join Date
    Jun 2007
    Posts
    5,053
    BG Level
    8
    FFXIV Character
    Cair Bear
    FFXIV Server
    Excalibur
    FFXI Server
    Fenrir

    If you use table literal creation and do not specify keys, you are doing this:

    Code:
    T{'Doton: Ichi', 'Huton: Ichi', 'Hyoton: Ichi', 'Katon: Ichi', 'Raiton: Ichi', 'Suiton: Ichi', ... }
    
    --Is the same as
    T{[1] = 'Doton: Ichi', [2] = 'Huton: Ichi', [3] = 'Hyoton: Ichi', [4] = 'Katon: Ichi', [5] = 'Raiton: Ichi', [6] = 'Suiton: Ichi', ... }
    ninjaSpells[spell.english] will never exist because you're checking for a key as a spell name while your keys just enumerate from 1. You can use table.contains(ninjaSpells, spell.english) or construct your table differently.

    Using S{...} instead of T{...} should automatically do what you want, and it is the equivalent of doing

    Code:
    T{ ['Doton: Ichi'] = true, [Huton: Ichi'] = true, ['Hyoton: Ichi'] = true, ...}
    tl;dr --

    Change to

    Code:
    	ninjaSpells = S{'Doton: Ichi', 'Huton: Ichi', 'Hyoton: Ichi', 'Katon: Ichi', 'Raiton: Ichi', 'Suiton: Ichi',
    					'Doton: Ni', 'Huton: Ni', 'Hyoton: Ni', 'Katon: Ni', 'Raiton: Ni', 'Suiton: Ni',
    					'Doton: San', 'Huton: San', 'Hyoton: San', 'Katon: San', 'Raiton: San', 'Suiton: San'}

  12. #192

    I hope one day to really grasp this stuff, til then thank you all again for the help.
    Amazing people the whole lot of you!

  13. #193
    Old Merits
    Join Date
    Sep 2008
    Posts
    1,115
    BG Level
    6
    FFXI Server
    Leviathan

    question regarding cancelling sneak for jig, i copied this snippet from byrth's example dnc file but am not getting it to work:

    Code:
    function precast(spell,act)
    	cast_delay(0)
    	if spell.name == 'Spectral Jig' and buffactive.sneak then
    		send_command('cancel 71')
    	end
    end
    i put it into motenten's pup file right after all the sets are defined, below this part:

    Code:
    -- Called when this job file is unloaded (eg: job change)
    function file_unload()
    	--spellcast_binds_on_unload()
    end
    edit: figured it out, i think. pasted it into the mote-include at this section and it seems to work now:

    Code:
    -- Perform default equips if the job didn't handle it.
    	if not eventArgs.handled then
    		equip(get_default_precast_set(spell, action, spellMap, eventArgs))
    	end
    	
    	if spell.name == 'Spectral Jig' and buffactive.sneak then
    		send_command('cancel 71')
    	end
    	
    	-- Allow followup code to add to what was done here
    	if job_post_precast then
    		job_post_precast(spell, action, spellMap, eventArgs)
    	end

  14. #194
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    You shouldn't be modifying Mote-Include like that if you can help it. From where you put it, you could create a job_post_precast() function in your job lua and put it in there. Though really, putting it in job_precast() should also work.

  15. #195
    Relic Weapons
    Join Date
    Aug 2010
    Posts
    335
    BG Level
    4
    FFXI Server
    Asura

    Quote Originally Posted by Motenten View Post
    You shouldn't be modifying Mote-Include like that if you can help it. From where you put it, you could create a job_post_precast() function in your job lua and put it in there. Though really, putting it in job_precast() should also work.
    I was wondering is there a way to modify your refine_waltz function in your dnc lua into it's own .lua that can be called/included by other job.lua files.. similar to how you did MoteInclude?

    For Example say I have a WAR, PUP, and MNK lua files and instead of copying the function into each lua I just call or load a seperate .lua with just that refine_waltz function.

  16. #196
    Old Merits
    Join Date
    Sep 2008
    Posts
    1,115
    BG Level
    6
    FFXI Server
    Leviathan

    i don't really understand the language or structure well enough yet to do much other than copy+paste and cross my fingers, so will see if i can make sense of that later today if it will be an issue at some point.

  17. #197
    Chram
    Join Date
    Sep 2007
    Posts
    2,526
    BG Level
    7
    FFXI Server
    Fenrir

    @Gaira: Basically, you shouldn't be changing Mote-Include at all (except maybe a few variables up at the top). Ideally, when a new Include comes out with bug fixes or enhancements, you can just drop it in as a replacement for your own version and have everything continue to work. Everything it does, it allows the job files to override, so if you need anything to work differently from the default, just modify it in the job file.

    @Treize: yes, that would be doable. I can just add an extra check for if dnc is the subjob to prevent it from trying to change to waltz 4/5. Since it's just one function, I can probably put it in Mote-Include; however I may want to still keep it as an outside library for other stuff. Hmm. Will see.

  18. #198
    Relic Weapons
    Join Date
    Aug 2010
    Posts
    335
    BG Level
    4
    FFXI Server
    Asura

    Quote Originally Posted by Motenten View Post
    @Treize: yes, that would be doable. I can just add an extra check for if dnc is the subjob to prevent it from trying to change to waltz 4/5. Since it's just one function, I can probably put it in Mote-Include; however I may want to still keep it as an outside library for other stuff. Hmm. Will see.
    I think keeping it separate in it's own file would be the better way than placing it in Mote-Include. I just tried doing it myself but I kept getting error: Bad Argument #1 in Pairs (table expected, got nil). Keeping coming up for user_functions.lua line 217.

    I dunno.. thought it was a good idea but implementing it is something else lol.

  19. #199
    BG Content
    Join Date
    Jul 2007
    Posts
    21,132
    BG Level
    10
    FFXI Server
    Lakshmi
    Blog Entries
    1

    Please post all errors that you guys get in the GearSwap files to my issue tracker so I can add error handling for them. I tried to anticipate all possible errors but doubtlessly missed some.

  20. #200
    Salvage Bans
    Join Date
    Oct 2007
    Posts
    771
    BG Level
    5

    Any examples for checking to see if you have 3 runes or maneuvers up of the same type up?

Closed Thread
Page 10 of 302 FirstFirst ... 8 9 10 11 12 20 60 ... LastLast

Similar Threads

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