|
Gearswap Support Thread
Asura.Aragan
Guildwork Premium
By Asura.Aragan 2023-04-19 02:50:34
Hi everyone.
I am trying to put a toggle in my lua's which will switch between 2 Cure casting modes. I would love to be able to cast cures for highest potency and have an option to cast cures with enmity gear in the midcast sets. (for when playing rdm/run for example)
adding a ('Tank') option in:
state.CastingMode:options('Normal', 'MB', 'Resistant','Tank')
and then creating a sets.midcast.cure.Tank = {} will not work sadly.
Anyone have any idea about this if I need to change something in the functions or in the mote_include etc?
Hope someone more experienced in writing lua's sees this post and can help out!
You have mistake .. you need to add a space betwen this ، and 'tank' to become
state.CastingMode:options('Normal', 'MB', 'Resistant', 'Tank')
Bismarck.Xurion
Server: Bismarck
Game: FFXI
Posts: 694
By Bismarck.Xurion 2023-04-19 02:54:39
That space is syntactically correct - the issue must be elsewhere.
Shiva.Mewtwo
Server: Shiva
Game: FFXI
Posts: 52
By Shiva.Mewtwo 2023-04-19 04:14:20
state.CastingMode:options('Normal', 'MB', 'Resistant','Tank')
and then creating a sets.midcast.cure.Tank = {} will not work sadly.
The "C" in "cure" needs to be uppercase.
So like
sets.midcast.Cure.Tank = {}
[+]
Server: Odin
Game: FFXI
Posts: 21
By Odin.Wyclef 2023-04-19 06:32:14
Thank you for the explanation Sechs. i understand most of what you are saying there, now to teach myself to implement a sollution and create a keybind toggle to switch cure modes.
I had been looking around in pld and whm lua's to see if there was an existing code i could copy allready.
I'll aim for the simple suggestion and implement the midcast check.
On the next page after my original post ppl have been telling me to check the syntax on my previously used code, so i will have to double check that to make sure i didnt just make a simple spelling or space mistake.
update:
just tried adding lines 14 and 15 to the code but it conflicts in the functions Code
-- Run after the default midcast() is done.
-- eventArgs is the same one used in job_midcast, in case information needs to be persisted.
function job_post_midcast(spell, action, spellMap, eventArgs)
if spell.skill == 'Enfeebling Magic' and state.Buff.Saboteur then
equip(sets.buff.Saboteur)
elseif spell.skill == 'Enhancing Magic' and classes.NoSkillSpells:contains(spell.english) then
equip(sets.midcast.EnhancingDuration)
elseif spell.skill == 'Enhancing Magic' and spell.target.type == 'PLAYER' then
if buffactive.composure then
equip(sets.buff.ComposureOther)
end
elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
elseif spellMap == 'Cure' and state.CastingMode:options == 'Tank' then
equip(sets.midcast.Cure.Tank)
elseif spell.skill == 'Elemental Magic' then
if state.MagicBurst.value and spell.english ~= 'Death' then
equip(sets.magic_burst)
if spell.english == "Impact" then
equip(sets.midcast.Impact)
end
end
if (spell.element == world.day_element or spell.element == world.weather_element) then
equip(sets.Obi)
end
end
end
By drakefs 2023-04-20 11:28:34
Quote: Code elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf)
elseif spellMap == 'Cure' and state.CastingMode:options == 'Tank' then
If you want to have a tank selfcure set, this setup will never equip a tank-cure set. Also you are checking the value of CastingMode incorrectly. Below is code that would do so:
Code
elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
if state.CastingMode.value == 'Tank'
equip(sets.midcast.CureSelf.Tank)
else
equip(sets.midcast.CureSelf)
end
elseif spellMap == 'Cure' and state.CastingMode.value == 'Tank' then
equip(sets.midcast.Cure.Tank)
Shiva.Mewtwo
Server: Shiva
Game: FFXI
Posts: 52
By Shiva.Mewtwo 2023-04-20 16:35:00
If you're using Mote's include (which I'm going to assume you are from the code which looks familiar from a Mote WHM lua) You don't need to do any of that. If what you posted was accurate then I have already explained why it didn't work. You simply forgot to uppercase a letter on a case sensitive name.
If you have the casting mode 'Tank' then this Should work: Code
sets.midcast.Cure.Tank = {}
Cure is the name of the variable in Motes-Mappings.lua. You can find it there to see that all the single target cure spells are mapped to "Cure" and again it is case sensitive just as 'Tank' is case sensitive.
[+]
Server: Odin
Game: FFXI
Posts: 21
By Odin.Wyclef 2023-04-22 16:11:04
So i've been away from the game for a few days and finally had time to work on my Lua.
What i found out after an extensive check for Uppercases and other spelling mistakes etc. that GS wouldn't use my 'midcast.Cure.Tank' set ever.
My sollution which seems to work for me so far is changing the 'castingmode' Code elseif spellMap == 'Cure' and state.CastingMode.value == 'Tank' then
equip(sets.midcast.CureTank)
into Code elseif spellMap == 'Cure' and state.OffenseMode.value == 'Tank' then
equip(sets.midcast.CureTank)
so that whenever I change my offense mode into 'Tank' it will use 'midcast.CureTank' whenever I use a Cure in general.
The only thing I needed to do was remove the Code elseif spellMap == 'Cure' and spell.target.type == 'SELF' then
equip(sets.midcast.CureSelf) out of lua which always seemed to take priority over the desired midcast.Cure.Tank set
going to test this out for a while, thank you all who cared to help me out on my issue!
Server: Asura
Game: FFXI
Posts: 22
By Asura.Kurdtray 2023-05-14 08:20:56
I don't know if this has been addressed yet or not, i couldn't find the thread if it has, but My gearswap won't let me use macro books 21+.
By drakefs 2023-05-14 15:54:31
I don't know if this has been addressed yet or not, i couldn't find the thread if it has, but My gearswap won't let me use macro books 21+.
What do you mean by, "won't let you use"?
Are you saying it will not let you change over to or that it is ignoring macros in 21+?
If the former and the lua is a motes based lua, Code set_macro_page(page#,book#)
for example:
set_macro_page(3,40)
would set book 40 on page 3 has been updated to use books 1-40. So if not working, delete GS ( do not delete your data folder) and pull it back down from windower.
If it is not a motes based lua, how are you setting the book and page?
It is pretty simple to set your book and page, for example Code send_command('@input /macro book 40;wait 1.1;input /macro set 3'
would set book 40 page 3.
Server: Ragnarok
Game: FFXI
Posts: 43
By Ragnarok.Iamarealgirl 2023-05-18 20:20:33
is there a way to have gearswap reload each time i zone or get raised?
i would like it so it will reload my lockstyle so everytime i get hit with an equipment removing ability and i dont realize that i'm running around in my random equipped gear (i mean the whole point of lockstyle is for the S.T.Y.L.E. right?), the gearswap will have fixed the problem after zoning.
also i'm playing summoner again for the first time in several years and am using a GS file i didnt have before. so now when i die and get raised, i instantly try to use a macro that calls a new avatar and i'm smashing away at the buttons but nothing happens and i realize its because i'm still on my former avatars macro set not back to my idle set. so i was hoping there was a way to have my macro sets reset to my idle set, after death/being raised.
By drakefs 2023-05-19 19:07:47
Ragnarok.Iamarealgirl said: »so i was hoping there was a way to have my macro sets reset to my idle set, after death/being raised.
Is this a motes based lua, does it have Code include('Mote-Include.lua') in it?
if not try adding this: Code if player.hp == 0 then
send_command('@input /macro book 40;wait 1.1;input /macro set 3')
end
to your Code function status_change(new,old)
You can also try adding this: Code windower.register_event('zone change',function()
send_command('wait 5;input /lockstyleset 17')
end)
to the end of your lua to do a lockstyle every time you zone(doesnt matter if motes based of not).
cannot test atm.
Server: Ragnarok
Game: FFXI
Posts: 43
By Ragnarok.Iamarealgirl 2023-05-19 20:10:10
it seems to be working tyvm for the help
Phoenix.Evolved
Server: Phoenix
Game: FFXI
Posts: 67
By Phoenix.Evolved 2023-05-25 09:26:46
Hello all again,
I play through the menus on my Scholar, and am trying to automatically cast Accession and then the spell name when I do my protect, shell, and regen V.
When I use this code, it just casts all 3 over and over. I only want it if I cast Regen V through the menus, then cast accession and regen V ONLY, not protect and shell. And if I need to refresh Protect, then the same thing, not cast all 3. I guess I am confused with the syntax of the ifs and elseifs. Here is the code:
Code function precast(spell,action)
if spell.english == "Regen V" then
cast_delay(2)
send_command('input /ja "accession" <me>; wait 2; input /ma "Regen V" <me>')
elseif spell.english == "Protect V" then
cast_delay(2)
send_command('input /ja "accession" <me>; wait 2; input /ma "Protect V" <me>')
elseif spell.english == "Shell V" then
--if not buffactive['Accession'] and not buffactive['Amnesia'] then
cast_delay(2)
send_command('input /ja "accession" <me>; wait 2; input /ma "Shell V" <me>')
end
end
(I commented out the if not buffactive, that I copied from someone else's lua. For some reason when I have that in the code, it throws errors saying I need to add or remove "end"s. When it's not there, it works perfect)
What am I doing wrong here?
Bismarck.Tyconus
Server: Bismarck
Game: FFXI
Posts: 35
By Bismarck.Tyconus 2023-05-25 10:43:56
You need to do a cancel_spell()
Code function precast(spell,action)
if spell.english == "Regen V" and not buffactive['Accession'] then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Regen V" <me>')
elseif spell.english == "Protect V" then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Protect V" <me>')
elseif spell.english == "Shell V" then
--if not buffactive['Accession'] and not buffactive['Amnesia'] then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Shell V" <me>')
end
end
I personally wouldn't do Protect/Shell, as one person might die and don't need to cast it on everybody in the party.
Phoenix.Evolved
Server: Phoenix
Game: FFXI
Posts: 67
By Phoenix.Evolved 2023-05-25 14:48:57
That is a good point. I can still use it to streamline at the beginning of an event, or if everyone is missing.
BTW: You need to add the "and not buffactive accession" part to each else if, otherwise it could get stuck and be in an endless loop. And that's a *** to cancel without closing out the client.
I'm an older player and forget ***all the time, so I primarily wanted this for things like this, but also hasso, meditate, endark ii, etc.
[+]
By drakefs 2023-05-25 15:47:50
BTW: You need to add the "and not buffactive accession" part to each else if, otherwise it could get stuck and be in an endless loop. And that's a *** to cancel without closing out the client.
Just nest the accession logic under a check for accession:
Code function precast(spell,action)
if not buffactive['Accession'] then
if spell.english == "Regen V" then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Regen V" <me>')
elseif spell.english == "Protect V" then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Protect V" <me>')
elseif spell.english == "Shell V" then
--if not buffactive['Accession'] and not buffactive['Amnesia'] then
cancel_spell()
send_command('input /ja "accession" <me>; wait 2; input /ma "Shell V" <me>')
end
end
Bismarck.Tyconus
Server: Bismarck
Game: FFXI
Posts: 35
By Bismarck.Tyconus 2023-05-25 15:49:35
I didn't care about the Protect and Shell, so I just left them as is. For Hasso/Seigan reapplication, I have this in my lua; below is a list of things to reapply or tell me something wore for SAM/PLD/Magey.
Code function buff_change(n, gain, buff_table)
local name
name = string.lower(n)
if S{"hasso"}:contains(name) then
if gain then
else
if player.status == "Engaged" and not buffactive['Seigan'] then
send_command('@input /ja "Hasso" <me>')
end
end
elseif S{"seigan"}:contains(name) then
if gain then
else
if player.status == "Engaged" and not buffactive['Hasso'] then
send_command('@input /ja "Seigan" <me>')
end
end
elseif S{"doom"}:contains(name) then
if gain then
send_command('@input /p Cursna - Doomed')
else
send_command('@input /p Doom - Off')
end
elseif S{"phalanx"}:contains(name) then
if gain then
else
if player.hp ~= 0 then
add_to_chat(123, 'Phalanx: [lost]')
end
end
elseif S{"silence"}:contains(name) then
if gain then
--send_command('@input /item "Echo Drops" <me>')
send_command('@input /item "Remedy" <me>')
end
elseif S{"reraise"}:contains(name) then
if gain then
else
if player.hp ~= 0 then
add_to_chat(123, 'Reraise: [lost]')
end
end
elseif S{"sublimation: activated"}:contains(name) then
if gain then
equip({waist="Embla Sash"})
else
if player.mpp <= 45 then
equip({waist="Fucho-no-Obi"})
else
equip({wait="Shinjutsu-no-obi"})
end
end
elseif S{"afflatus solace"}:contains(name) then
if gain then
else
if player.hp ~= 0 then
add_to_chat(123, 'Afflatus Solace: [lost]')
end
end
elseif S{"afflatus misery"}:contains(name) then
if gain then
else
if player.hp ~= 0 then
add_to_chat(123, 'Afflatus Misery: [lost]')
end
end
elseif S{"sleep"}:contains(name) then
if player.status == "Idle" then
if gain then
if buffactive["Stoneskin"] then
send_command('cancel Stoneskin')
end
equip({main="Caliburnus",})
else
equip({main="Daybreak"})
end
end
end
end
Phoenix.Evolved
Server: Phoenix
Game: FFXI
Posts: 67
By Phoenix.Evolved 2023-05-25 16:25:14
That's cool stuff, thank you!
Bahamut.Leonof
Server: Bahamut
Game: FFXI
Posts: 32
By Bahamut.Leonof 2023-05-31 00:23:14
How do i create a toggle for whether or not a function will take effect?
Since corsair rolls are inconsistent, i want to be able to toggle this Code
function update_melee_groups()
classes.CustomMeleeGroups:clear()
if buffactive["Samurai Roll"] then
classes.CustomMeleeGroups:append('Sam')
end
if buffactive["Fighter's Roll"] then
classes.CustomMeleeGroups:append('War')
end
end
when i try to use "if state.Roll.value == true then" it says nil value
when i try to use "if Roll == true then" it just doesnt do anything
By drakefs 2023-05-31 19:38:31
Is the point of this to account for poor rolls for Samurai\Warrior roll?
How are you setting state.Roll or Roll (these are different variables)?
The easiest way would be to use a value that you can manually toggle:
Code function user_setup()
state.CorBuffs = M(false)
send_command('bind @` gs c toggle CorBuffs') -- Set the bound key to whatever you like, this is currently windows+~
end
function update_melee_groups()
classes.CustomMeleeGroups:clear()
if state.CorBuffs.value then
if buffactive["Samurai Roll"] then
classes.CustomMeleeGroups:append('Sam')
end
if buffactive["Fighter's Roll"] then
classes.CustomMeleeGroups:append('War')
end
end
end
Bahamut.Leonof
Server: Bahamut
Game: FFXI
Posts: 32
By Bahamut.Leonof 2023-06-01 10:16:07
Quote: Is the point of this to account for poor rolls for Samurai\Warrior roll? yes
Quote: How are you setting state.Roll or Roll (these are different variables)? With a toggle command. i tried gs c toggle Roll and gs c Roll:toggle(). They are different variables, as far as i know there are two different ways to create modes in gearswap and they were my attempt at trying both.
Quote: The easiest way would be to use a value that you can manually toggle: thats what i was trying b4. adding your suggestion to my lua still gives "attempt to index field 'CorBuffs' (a nil value)"
By drakefs 2023-06-01 15:12:51
This is a motes based lua, correct?
Quote: thats what i was trying b4. adding your suggestion to my lua still gives "attempt to index field 'CorBuffs' (a nil value)" Weird, I got the same error initially. I moved the "state.CorBuffs = m(false)" to the "function job_steup()" and the error went away. However if I moved it back to "function user_setup()" it didn't throw the error anymore.
Try moving the state declaration to "function job_steup()"
Code function job_setup()
state.CorBuffs = M(false)
end
function job_setup()
send_command('bind @` gs c toggle CorBuffs') -- Set the bound key to whatever you like, this is currently windows+~
end
function update_melee_groups()
classes.CustomMeleeGroups:clear()
if state.CorBuffs.value then
if buffactive["Samurai Roll"] then
classes.CustomMeleeGroups:append('Sam')
end
if buffactive["Fighter's Roll"] then
classes.CustomMeleeGroups:append('War')
end
end
end
Bahamut.Leonof
Server: Bahamut
Game: FFXI
Posts: 32
By Bahamut.Leonof 2023-06-01 16:37:37
Quote: This is a motes based lua, correct? yes
Quote: Try moving the state declaration to "function job_steup() I tried moving it to function job_setup, it still gave the same error. I tried moving it back to user_setup and still gave the same error.
Weirdly though, i removed those and moved it to my global lua under the function define_global_sets() and it started working, not just loading correctly but functioning correctly as well.
Im only good at tinkering with luas, only know a bit about coding.
So i dont know what is going on with this.
By drakefs 2023-06-02 23:39:49
If I had to guess, somehow, "state.CorBuffs" (or whatever you are using) is being declared before "state" (which is declared in mote libs).
Phoenix.Evolved
Server: Phoenix
Game: FFXI
Posts: 67
By Phoenix.Evolved 2023-06-20 15:42:27
I'm not sure if the following syntax is correct with what I want it to do. It checks out fine, however when I use Sublimation I get an error (I'll put arrows on the line).
The error message I'm getting is: "attempt to index field 'name' (a nil value)
I'm trying to set it so if any of the target.names are targetted, AND I use any black magic spell, I will equip my burst set. If none of those names are targetted, then I'll just use my regular nuke set. So I have all of the "OR"s with the names, and then finally an "AND" to ensure I'm actually casting a black magic spell against them.
Code function midcast(spell)
-- player.target.name
if spell.name == "Burn" then
equip(sets.midcast.enfeeble)
add_to_chat(207,' '..spell.name..' Enfeebling Set')
elseif ((player.target.name == "Abject Acuex") or
(player.target.name == "Esurient Botulus") or
(player.target.name == "Ghatjot") or
(player.target.name == "Dhartok") or
(player.target.name == "Leshonn") or
(player.target.name == "Gartell") or
(player.target.name == "Locus Dire Bat") or
--->>-->(player.target.name:contains("Elemental")) and (spell.type == 'BlackMagic')) then
equip(sets.midcast.burst)
add_to_chat(207,' '..player.target.name..' Burst Set')
end
end
I'm pretty sure the syntax is correct? the player.target.name:contains, but maybe I'm a little confused with the paranthesis? It seems to work on on the bosses, but haven't tried it on the elementals yet.
I'm still new at Lua and just found the Gearswap Userscript reference, so a new world has opened to me. :) If anyone has a suggestion on how to clean this up a bit also, I'm all ears as well.
Phoenix.Evolved
Server: Phoenix
Game: FFXI
Posts: 67
By Phoenix.Evolved 2023-06-20 16:16:43
I went up to sky, and it does work fine. Just confused at the error.
I did change the word elemental to be in single quotes instead of double, but nothing changed.
Just looking for someone to explain this addon a bit for me. It looks like it is an alternative to Spellcast.
Is it going to be replacing Spellcast? In which ways is it better or worse. I don't know any programming but I've slowly learned more and more about spellcast and the 'language' used in gearswap is confusing to me.
It says it uses packets so it potentially could be more detectable? but does that also eliminate any lag that spellcast may encounter?
I plan on redoing my PUP xml to include pet casting sets thanks to the new addon petschool. I'm just not sure if it's worth it to just wait until gearswap gets more popular or to go ahead and do it in spellcast.
If anyone could give me more info I'd greatly appreciate it.
|
|