I cannot seem to post a code reply so I'll use a pastebin!
https://pastebin.com/4AZqcmmp
If I am wrong, please correct me ^^
I cannot seem to post a code reply so I'll use a pastebin!
https://pastebin.com/4AZqcmmp
If I am wrong, please correct me ^^
i think this is what you want
-you start with this so if no startswith('finishing move') is found it will not error on nilCode:local fm_count = 0
tonumber() changes a number string("0011997") into a number (0011997) in luaCode:if tostring(i):startswith('finishing move') or tostring(i):startswith('フィニシングムーブ') then fm_count = tonumber(string.match(i, '%d+')) or 1 end
string.match(i, '%d+') '%d+' is how you tell it to only grab the number or numbers in order
-https://www.lua.org/pil/20.2.html
the or 1 tells it that if it is nil to use a 1 instead
-this is an error catch
yes you got it rightCode:if spell.type == 'Step' and fm_count < 6 then --- --- --- end
I happen to have another question! Based on that function you made. I am trying to make something that displays number of finishing moves in chat.
Right now this is what I have! The +1 could account for presto (when I add that part) but I've been getting odd results. Any step over 6 always returns as 6 (+ the number modifying the count). How would someone account for that or is there a way around that?
https://pastebin.com/r2ZaFYzt
edit:
I added the following to simplify and possibly prevent more errors xD I still have the 6+ problem tho :<
edit2: Sowwi for so many edit :> I managed to put the presto check in and the correct math for the first presto from 0Code:local prestoed = fm_count + 1
https://pastebin.com/3cvinA4n
this is pointless because of the fact that there is no way to see if you have more then 6 FM's(5 FM's in Jap) without heavy chat watching
if you want that you have to do it on your own i will not help because it
-it would require about this much code: https://github.com/smd111/Gearswap/b...red_Events.lua
--with out watching chat everything over 6 will always be inaccurate
if you came up with a 100% accurate way to do this then i would be able and willing to help but otherwise your on your own
i was thinking about this issue while sitting around
you could try this if you want
just create a new file call test.lua then paste this in and save it in your gearswap file folder with all your other gearswap job files
then use this command in ffxi's chat to load it to testCode:fm_test = 0 function buff_change(name,gain,buff_table) if name:startswith('Finishing Move') then if gain then if buffactive('Presto') fm_test = fm_test+2 else fm_test= fm_test+1 end print('current FM count = '..fm_test) end end end function aftercast(spell) if spell.interrupted then return end if spell.type:startswith('Flourish') then local fm_for_flourishes = {['Animated Flourish']={m=2}, ['Desperate Flourish']=1, ['Violent Flourish']=1, ['Reverse Flourish']={m=5}, ['Building Flourish']={m=3}, ['Wild Flourish']=2, ['Climactic Flourish']={m=5}, ['Striking Flourish']=2, ['Ternary Flourish']=3,} if type(fm_for_flourishes[spell.name]) == 'number' then fm_test = fm_test-fm_for_flourishes[spell.name] else if fm_for_flourishes[spell.name].m >= fm_test then fm_test = 0 else fm_test = fm_test-fm_for_flourishes[spell.name].m end end print('current FM count = '..fm_test) end end
//gs l test.lua
if it counts past 6 and is accurate let me know
Is it possible to make some kind of internal timer in gearswap code, where if it passes a certain point, it'll equip a refresh feet? But if it detects my character moving, it'll jump back to movement gear?
yes and no
let me explain:
no you cant equip gear outside of any function called by gearswap the normal way
yes you can set a timer but its harder then you think
yes you can equip gear outside of gearswaps called functions by calling your own function through gearswap
here is some quick things i put together to help you get started:
Code:function out_of_GS_func () --put your timer and such here --you can do normal equips from here as well --the rest you're on your own end windower.raw_register_event('prerender', function local player = windower.ffxi.get_player() if not windower.ffxi.get_info().logged_in or not player then -- stops prender if not loged in yet return end if frame_count%30 == 0 then gearswap.equip_sets('out_of_GS_func',nil,1) end frame_count = frame_count + 1 end)
I figured it would have been troublesome... oh well.
On another note, is there a way to code a method to randomize the mount I want to use? Let's say I have 3 mounts I like, and I want to do something like "//gs c mount" to let it randomly pick one of the 3. Is that doable or is that a pain to code in gearswap as well?
I'm having an issue where my gearswap is no longer canceling stoneskin.
This is how my code currently looks:
Did the buff change from 37?Code:function precast(spell) if (spell.type == 'BloodPactRage' or spell.type == 'BloodPactWard') and not buffactive['Astral Conduit'] then equip(sets.BPDelay) elseif spell.type == 'SummonerPact' then if spell.name == 'Dark Spirit' then if world.weather_element == 'Dark' then equip(sets.Summoning) elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element])) elseif world.day_element == 'Dark' then equip(sets.Summoning) else cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.day_element])) end elseif (spell.name == 'Alexander' or spell.name == 'Odin') and not pet.isvalid and not buffactive['Astral Flow'] and windower.ffxi.get_ability_recasts()[0] then cast_delay(1) send_command('input /ja "Astral Flow" <me>') else equip(sets.Summoning) end elseif spell.type == 'WhiteMagic' then if spell.name == 'Stoneskin' then windower.ffxi.cancel_buff(37) equip(sets.Stoneskin) elseif spell.skill == 'Enhancing Magic' then if spell.name == 'Sneak' then windower.ffxi.cancel_buff(71) end equip(sets.Summoning) elseif spell.name:match('Cure') then equip(sets.Healing) end elseif spell.name == 'Elemental Siphon' then equip(sets.Siphon) elseif spell.name == 'Mana Cede' then equip(sets.ManaCede) elseif spell.name == 'Astral Flow' then equip(sets.AstralFlow) end end
i dont use windower.ffxi.cancel_buff(id) i use the addon cancel and send_command i.e. send_command('cancel 71') for Sneak
for Stoneskin you would use send_command('cancel 37')Code:if spell.en == 'Spectral Jig' then send_command('cancel 71') end
edit:
also i do not understand why you do this:
and not this:Code:if world.weather_element == 'Dark' then equip(sets.Summoning) elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element])) elseif world.day_element == 'Dark' then equip(sets.Summoning) else cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.day_element])) end
Code:if world.weather_element == 'Dark' or world.day_element == 'Dark' then equip(sets.Summoning) elseif world.weather_element ~= 'None' and spirit_conflict[world.day_element] ~= world.weather_element then cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.weather_element])) else cancel_spell() send_command('input /ma "%s" <me>':format(spirit_element[world.day_element])) end
It's an old script I copied from someone else.
A while back i asked for the same thing and the guys helped me come up with this ADDON.
They had it look at key items but it needed to be updated when new mounts became available and i dont have the know how to find those IDs or whatever (so i altered it to use a list i made of the mounts available) and i also had the problem i wanted to use it for 2 characters who at the time didnt have all the same mounts available. So in order to not have situations where one char summons a mount the other didnt have where the other just stood there cause he didnt have it, i made two mount array tables, one for each, and somewhere else i made a per character line like "if player.name == name then" to to point to either mountarray for the two characters. I think i removed that now they have all the same mount list though, but feel free to alter it if you like. I also made a self command in my job luas that would look if im on a mount or chocobo already and makes me dismount if so, and if not on a chobo to summon a mount but thats just how i likes it.
the command to use is "mu usemount"
Just alter the mount array to only list the mounts you like, or i supose you can list alot more, but repeat some to "add some weight" to the choice so it might more likely get picked. Also since its an addon make a folder in "addons" called "MountUp" and make a "MountUp.lua" in that folder and load it like an addon "lua l mountup" I usually add that line to my init file or something so its always loaded.Code:_addon.name = 'MountUp' _addon.version = '1.00' _addon.author = 'Trumpy (Shiva)' _addon.command = 'mu' require 'luau' packets = require('packets') --mountarray = T{} -- mount table mountarray = T{"Raptor","Tiger","Crab","Red Crab","Bomb","Ram","Morbol","Crawler","Fenrir","Beetle","Moogle","Magic Pot","Tulfaire","Warmachine","Xzomit"} -- mount table function random_mount() --randomly selects mount local select_mount = 0 while select_mount < 1 do select_mount = math.ceil(math.random(0,#mountarray)) end return mountarray[select_mount] end function UseMount() --main function if #mountarray >= 1 then --varifies you have at lest one mount windower.send_command('input /mount "'..random_mount()..'"') windower.send_command('timers c Mount 60 up') end end windower.register_event('addon command', function() UseMount() end)
Hella neat, thanks.
So I'm starting anew and am deeply sad Spellcast is no longer a thing. So I need to learn this Gearswap thing. I've poked around for beginners guides and saw a few, but was wondering if there are any BG'ers would recommend? One thing I loved about Spellcast is say you wanted to use Dodge on Monk you could just do //dodge. Is there similar with GS?
Spellcasts functionality was broken into 3 different addons. Shortcuts does teh part you're referring to with the short spell aliases.
Gearswap handles gear, and inforeplacer does the thing where you could say %targethpp etc, in chat and it'd replace that value with your targets HP percent.
As for guides.. sorry I don't really know any good ones.
Hello all
https://pastebin.com/1HyVnxZL
My gearswap for smn isn't swapping back the lucidity sash. I can't figure out for the life of me why. It's spelled right, but just not working.
if any of these are true that is the reason as far as i can tell
1.player MP less then 51%
2.pet is active and still in combat
if you get lag on the packet for your pet leavening combat this can happen
to check put this:
print("yup pet is still in combat")
above:
idleSet = set_combine(idleSet, sets.idle.Avatar.Melee)
-if any of the above are the case there is nothing we can do to help you
I tried switching to send_command('cancel 37') and it's still not canceling stoneskin, likewise 71 and sneak. What's going on?