A few questions for a couple things I've been trying to do. First off, I'm using Mote's gearswap files with everything in a sidecar file.
1 - Does Mote's gearswap automatically equip obis/zodiac ring/twilight cape?
2 - I've been trying to make the BLU.lua in "Refresh" combat mode only equip the correct piece of Serpentes during the right time of day with:
Code
function customized_melee_set(meleeSet)
if state.Buff.sleep then
meleeSet = set_combine(meleeSet, sets.buff.Sleep)
elseif state.Buff.reive then
meleeSet = set_combine(meleeSet, {neck="Arciela's Grace +1"})
end
if state.OffenseMode == "Refresh" then
if world.time >= (17*60) or world.time <= (7*60) then
meleeSet = set_combine(sets.engaged.Refresh, {hands="Serpentes Gloves"})
else
meleeSet = set_combine(sets.engaged.Refresh, {feet="Serpentes Sabots"})
end
end
return meleeSet
end
3 - I also am trying to get the neck piece to auto lock to Arciela's Grace +1 while in a reive with this code and catch when I gain the sleep buff.
None of it works. I do have the following in the job_setup function that was supposed to make the sleep gear work. I also have sets.buff.Sleep defined.
Code
state.Buff.sleep = buffactive.sleep or false"
Am I going about this the right way? Should I define sets for reives? such as sets.engaged.Reive, sets.engaged.DW.Reive?
Trying to figure all this out, any help is appreciated!
Also, big thanks to Mote for all the work he has done so far!
Mote has the default gear setup in Mote-Globals.lua. You can see what he has assigned here.
You should be able to change them, by redefining them in user or job_setup. ex: gear.default.obi_ring = "Strendu Ring"
2 - I've been trying to make the BLU.lua in "Refresh" combat mode only equip the correct piece of Serpentes during the right time of day with:
Code
function customized_melee_set(meleeSet)
if state.Buff.sleep then
meleeSet = set_combine(meleeSet, sets.buff.Sleep)
elseif state.Buff.reive then
meleeSet = set_combine(meleeSet, {neck="Arciela's Grace +1"})
end
if state.OffenseMode == "Refresh" then
if world.time >= (17*60) or world.time <= (7*60) then
meleeSet = set_combine(sets.engaged.Refresh, {hands="Serpentes Gloves"})
else
meleeSet = set_combine(sets.engaged.Refresh, {feet="Serpentes Sabots"})
end
end
return meleeSet
end
If you're using mote_include_version = 2, you'll need to correct state.OffenseMode == "Refresh" to state.OffenseMode.value == "Refresh"
3 - I also am trying to get the neck piece to auto lock to Arciela's Grace +1 while in a reive with this code and catch when I gain the sleep buff.
None of it works. I do have the following in the job_setup function that was supposed to make the sleep gear work. I also have sets.buff.Sleep defined.
Code
state.Buff.sleep = buffactive.sleep or false"
Am I going about this the right way? Should I define sets for reives? such as sets.engaged.Reive, sets.engaged.DW.Reive?
Trying to figure all this out, any help is appreciated!
Also, big thanks to Mote for all the work he has done so far!
The buff is called "Reive Mark". This should be all you need.
Code
function customize_melee_set(meleeSet)
if buffactive['Reive Mark'] then
meleeSet = set_combine(meleeSet, sets.reive)
end
return meleeSet
end
As for "sleep". Having sleep cast on you doesn't warrant any action from gearswap, since you didn't cast the spell on yourself. The customize_melee_set() function is triggered as the last step when gearswap is constructing your current gear set. So, in this instance your code isn't being executed, as being slept didn't warrant your lua to build a gear set.
If you want to catch "sleep", you can do that in job_buff_change()
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
end
end
Thanks Orestes! The reive gear is equipping and the correct Serpentes gear is equipping while engaged for refresh. Couple things that I can't rap up:
I want to be able to list equipment for spells in the main/sub slot that will change when I'm not in a melee stance. I tried adding a 'None' melee stance so that when I'm in 'None' my weapons/shields change out depending on action. And when I want to engage, I go into one of the melee stances (Normal, Acc, etc). Sadly this isn't working. It works for my RDM_gear.lua, any idea why it works in RDM and not in BLU?
Mote has the default gear setup in Mote-Globals.lua. You can see what he has assigned here.
You should be able to change them, by redefining them in user or job_setup. ex: gear.default.obi_ring = "Strendu Ring"
What you gave will let me set a default ring to equip if I put gear.ElementalRing in the set. What I'm looking for is to have a default nuking set with MAB, Magic Damage+ in each slot by default. And depending on spell, I can update the ring/back/waist slot to equip if it's the correct day (for ring), day or weather (for cape and obi). I would imagine I would need something in the customize_idle_set and customize_melee_set functions, I just don't know what exactly. Something that would compare the spell element to world.day_element and world.weather_element? Then do a set_combine(meleeSet, sets.Elemental_day) or something of the nature.
As for the sleep gear... that will work to equip it when I get put to sleep. Will it go back to my previous set when I wake? Or do I need to do something like
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
elseif string.lower(buff) == "sleep" and lost then
equip(meleeSet)
end
end
Or will gswap automatically go back to the previous set once sleep is lost?
Lastly... I have it set to equip regen gear when my hpp < 95%, which is great. But, is there a way to make it automatically go to my idle gear (with PDT gear and such) when my hp breaks 95%?
Sorry if this is coming across too demanding. I'm not a programmer by nature. Just a normal Mechanical Engineer. All help is appreciated!
recently decided to bring my GEO up to par and I can't figure out how to write a rule for a pet idle set. I would like to have a pet -dt set go on for when my luopon is out and go back into a refresh idle set when it is not. If anyone can toss an example of it on here I would appreciate it.
I'm having problems trying to get my Oneiros only equipped when I'm at or above 100mp, it never swaps back to Rajas Ring right now, sorry if my lua file is a bit messy, I've been trying to do this myself and I'm still rubbish at gearswap.
Code
function get_sets()
TP_Index = 1
Idle_Index = 1
sets.weapons = {}
sets.weapons[1] = {main="Izhiikoh"}
sets.weapons[2]={main="Sandnung"}
sets.JA = {}
sets.JA.Conspirator = {body="Raider's Vest +2"}
sets.JA.Accomplice = {head="Raid. Bonnet +2"}
sets.JA.Collaborator = {head="Raid. Bonnet +2"}
sets.JA['Perfect Dodge'] = {hands="Plun. Armlets +1"}
sets.JA.Steal = {head="Plun. Bonnet",neck="Rabbit Charm",hands="Thief's Kote",
waist="Key Ring Belt",legs="Pill. Culottes +1",feet="Pillager's Poulaines"}
sets.JA.Flee = {feet="Pillager's Poulaines"}
sets.JA.Despoil = {legs="Raid. Culottes +2",feet="Raid. Poulaines +2"}
sets.JA.Mug = {head="Plun. Bonnet"}
sets.JA["Assassin's Charge"] = {feet="Plun. Poulaines +1"}
sets.JA.Hide = {body="Pillager's Vest"}
sets.JA.Feint = {legs="Plunderer's Culottes"}
sets.WS = {}
sets.WS.SA = {}
sets.WS.TA = {}
sets.WS.SATA = {}
sets.WS.AC = {}
sets.WS.Evisceration = {head="Felistris Mask",neck="Rancor Collar",ear1="Moonshade Earring",ear2="Brutal Earring",
body="Plunderer's Vest",hands="Pill. Armlets +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Wanion Belt",legs="Pill. Culottes +1",feet="Plun. Poulaines +1"}
sets.WS["Rudra's Storm"] = {head="Felistris Mask",neck="Rancor Collar",ear1="Moonshade Earring",ear2="Brutal Earring",
body="Plunderer's Vest",hands="Pill. Armlets +1",ring1="Rajas Ring",ring2="Thundersoul Ring",
back="Atheling Mantle",waist="Wanion Belt",legs="Pill. Culottes +1",feet="Plun. Poulaines +1"}
sets.WS["Aeolian Edge"] = set_combine(sets.WS.Evisceration,{head="Thaumas Hat",legs="Raid. Culottes +2",neck="Stoicheion Medal",
ear1="Novio Earring",ear2="Hecate's Earring",waist="Breeze Belt"})
sets.WS.SA.Evisceration = {head="Pillager's Bonnet",neck="Rancor Collar",ear1="Moonshade Earring",ear2="Brutal Earring",
body="Plunderer's Vest",hands="Raid. Armlets +2",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Wanion Belt",legs="Pill. Culottes +1",feet="Plun. Poulaines +1"}
sets.WS.TA.Evisceration = {head="Pillager's Bonnet",neck="Rancor Collar",ear1="Moonshade Earring",ear2="Brutal Earring",
body="Plunderer's Vest",hands="Raid. Armlets +2",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Wanion Belt",legs="Pill. Culottes +1",feet="Plun. Poulaines +1"}
TP_Set_Names = {"Normal","TH","Evasion"}
sets.TP = {}
sets.TP['Normal'] = {range="Raider's Bmrng.",head="Felistris Mask",neck="Asperity Necklace",
ear1="Dudgeon Earring",ear2="Heartseeker Earring",body="Thaumas Coat",hands="Pill. Armlets +1",
ring1="Oneiros Ring",ring2="Epona's Ring",back="Atheling Mantle",waist="Nusku's Sash",
legs="Pill. Culottes +1",feet="Plun. Poulaines +1"}
sets.TP['TH'] = {range="Raider's Bmrng.",head="Felistris Mask",neck="Asperity Necklace",
ear1="Dudgeon Earring",ear2="Heartseeker Earring",body="Thaumas Coat",hands="Plun. Armlets +1",
ring1="Rajas Ring",ring2="Epona's Ring",back="Atheling Mantle",waist="Nusku's Sash",
legs="Pill. Culottes +1",feet="Raid. Poulaines +2"}
sets.TP.Evasion = {head="Espial Cap",body="Espial Gambison",hands="Espial Bracers",legs="Espial Hose",feet="Espial Socks",
ear1="Ethereal Earring",ear2="Elusive Earring",ring1="Rajas Ring",ring2="Heed Ring",neck="Torero Torque",back="Boxer's Mantle"}
Idle_Set_Names = {'Normal','MDT'}
sets.Idle = {}
sets.Idle.Normal = {head="Felistris Mask",neck="Asperity Necklace",ear1="Dudgeon Earring",ear2="Heartseeker Earring",
body="Thaumas Coat",hands="Pill. Armlets +1",ring1="Rajas Ring",ring2="Epona's Ring",
back="Atheling Mantle",waist="Nusku's Sash",legs="Pill. Culottes +1",feet="Skd. Jambeaux +1"}
sets.Idle.MDT = {head="Espial Cap",neck="Twilight Torque",ear1="Merman's Earring",ear2="Merman's Earring",
body="Avalon Breastplate",hands="Merman's Mittens",ring1="Minerva's Ring",ring2="Shadow Ring",legs="Espial Hose",
feet="Espial Socks"}
sets.midcast = {}
sets.midcast.Ranged = {head="Umbani Cap",body="Skadi's Cuirie +1",hands="Buremte Gloves",legs="Thur. Tights +1",feet="Pillager's Poulaines",
neck="Ej Necklace",waist="Elanid Belt",ear1="Clearview Earring",ear2="Volley Earring",ring1="Hajduk Ring",ring2="Hajduk Ring",
back="Jaeger Mantle"}
end
function precast(spell)
if sets.JA[spell.english] then
equip(sets.JA[spell.english])
elseif spell.type=="WeaponSkill" then
if sets.WS[spell.english] then equip(sets.WS[spell.english]) end
if buffactive['sneak attack'] and buffactive['trick attack'] and sets.WS.SATA[spell.english] then equip(sets.WS.SA[spell.english])
elseif buffactive['sneak attack'] and sets.WS.SA[spell.english] then equip(sets.WS.SA[spell.english])
elseif buffactive['trick attack'] and sets.WS.TA[spell.english] then equip(sets.WS.TA[spell.english]) end
end
end
function midcast(spell)
if spell.name=="Ranged" then
equip(sets.midcast.Ranged)
end
end
function aftercast(spell)
if spell.english == "Feint" and not spell.interrupted then
return
else
status_gear()
end
end
function status_change(new,old)
if T{'Idle','Resting'}:contains(new) then
equip(sets.Idle[Idle_Set_Names[Idle_Index]])
elseif new == 'Engaged' then
if player.mp >= 100 then
equip(set_combine(sets.TP[sets.TP.index[TP_Index]], {ring1="Rajas Ring"}))
else
equip(sets.TP[sets.TP.index[TP_Index]])
end
end
end
function status_change(new,old)
status_gear()
end
function status_gear()
if T{'Idle','Resting'}:contains(player.status) then
equip(sets.Idle[Idle_Set_Names[Idle_Index]])
elseif player.status == 'Engaged' then
equip(sets.TP[TP_Set_Names[TP_Index]])
if buffactive.Feint then
equip(sets.JA.Feint)
end
end
end
function buff_change(buff,gain_or_loss)
if buff=="Sneak Attack" then
soloSA = gain_or_loss
elseif buff=="Trick Attack" then
soloTA = gain_or_loss
elseif buff=="Feint" and not gain then
status_gear()
end
end
function self_command(command)
if command == 'toggle TP set' then
TP_Index = TP_Index +1
if TP_Index > #TP_Set_Names then TP_Index = 1 end
send_command('@input /echo ----- TP Set changed to '..TP_Set_Names[TP_Index]..' -----')
equip(sets.TP[TP_Set_Names[TP_Index]])
elseif command == 'toggle Idle set' then
Idle_Index = Idle_Index +1
if Idle_Index > #Idle_Set_Names then Idle_Index = 1 end
send_command('@input /echo ----- Idle Set changed to '..Idle_Set_Names[Idle_Index]..' -----')
equip(sets.Idle[Idle_Set_Names[Idle_Index]])
end
end
if player.mp >= 100 then
equip(set_combine(sets.TP[sets.TP.index[TP_Index]], {ring1="Rajas Ring"}))
else
This checks that your mp is Bigger than 100 it equips Rajas.
Code
if player.mp < 100 then
equip(set_combine(sets.TP[sets.TP.index[TP_Index]], {ring1="Rajas Ring"}))
This would then check if your mp is less than 100 it uses Rajas instead
I use mp rules like this~
Code
function get_sets()
send_command('input /macro book 7;wait .1;input /macro set 1') -- Change Default Macro Book Here --
AccIndex = 1
AccArray = {"Low","Mid","High"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
Armor = 'None'
Rings = "Oneiros Ring"
sets.tp ={ring1=Rings}
Code
if player.mp < 99 then
Rings = "Rajas Ring"
else
Rings = "Oneiros Ring"
end
Oh god damn it, I suffered with that for so long and it was something simple like that, cheers Conagh, think I'll give that a quick try.
in gearswap if what you're doing feels over complicated, you're doing it wrong :£
You could also throw in the "Oni" ring section where it changes a QUick add to chat message to let you know it monitored the change in mp
add_to_chat(9,'MP under 100 swapping to Rajas')
then you can break down if its the code or an error in the way you're handling your sets.
Code
function get_sets()
AccIndex = 1
AccArray = {"LowACC","AvgACC","MidACC","HighACC"}
sets.Idle = {}
sets.ring = {ring1="Rajas Ring"}
sets.TP = {}
sets.TP.lowACC = {} -- Gear you equip normmally including a Normal Ring
sets.TP.AvgACC = {}
sets.TP.MidACC = {}
sets.TP.HighAcc = {}
end
function status_change(new,old)
if new == 'Engaged' then
equipSet = sets.TP
if equipSet[AccArray[AccIndex]] then
equipSet = equipSet[AccArray[AccIndex]]
end
if player.mp > 100 then
equip(set_combine(equipSet,sets.ring))
end
equip(equipSet)
else
equip(sets.Idle[IdleArray[IdleIndex]])
end
end
windower.register_event('mp change', function(mp)
status_change(player.status)
end)
The 'mp change' bit I added as I believe this forces an Status_Change update and makes sure your gear changes as your MP changes.
I know this works guaranteed, been using similar code on WHM Melee and SAM for Months. Of course this would only throw out a "status change" request when MP changes so you can swap this to HP or TP instead.
So I got it working now, it seemed I had a couple functions doing essentially the same thing and I don't know if one was overwriting the other, also I had this:
So I got it working now, it seemed I had a couple functions doing essentially the same thing and I don't know if one was overwriting the other, also I had this:
There's lots of ways to do it, it helps if you try and organise your sets into Blocks makes it easier to read and then have all your "TP set rules" in once place so you can dodge that sorta stuff.
As for the sleep gear... that will work to equip it when I get put to sleep. Will it go back to my previous set when I wake? Or do I need to do something like
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
elseif string.lower(buff) == "sleep" and lost then
equip(meleeSet)
end
end
Or will gswap automatically go back to the previous set once sleep is lost?
Lastly... I have it set to equip regen gear when my hpp < 95%, which is great. But, is there a way to make it automatically go to my idle gear (with PDT gear and such) when my hp breaks 95%?
Code
if buff == "sleep" and gain and player.hpp < 95 and player.status == "Engaged" then
equip({neck="Berserker's Torque"})
else
status_change(player.status)
end
function get_sets()
send_command('input /macro book 7;wait .1;input /macro set 1') -- Change Default Macro Book Here --
AccIndex = 1
AccArray = {"Low","Mid","High"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
Armor = 'None'
Rings = "Oneiros Ring"
sets.tp ={ring1=Rings}
Code
if player.mp < 99 then
Rings = "Rajas Ring"
else
Rings = "Oneiros Ring"
end
This won't work. Rings is passed by value, not reference, at the time the table sets.tp is created. Changing the value of Rings later will not update that table, as sets.tp.ring1 is pointing to a string, not a pointer. If you want to use this method, you would have to make Rings a table, with the attribute name pointing to the string. i.e. Rings = {name="Oneiros Ring"}. Then change the name attribute, i.e. Rings.name = "Rajas Ring". That way, sets.tp.ring1 is pointing to a table, which is assigned by reference.
As for the sleep gear... that will work to equip it when I get put to sleep. Will it go back to my previous set when I wake? Or do I need to do something like
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
elseif string.lower(buff) == "sleep" and lost then
equip(meleeSet)
end
end
Or will gswap automatically go back to the previous set once sleep is lost?
Lastly... I have it set to equip regen gear when my hpp < 95%, which is great. But, is there a way to make it automatically go to my idle gear (with PDT gear and such) when my hp breaks 95%?
Code
if buff == "sleep" and gain and player.hpp < 95 and player.status == "Engaged" then
equip({neck="Berserker's Torque"})
else
status_change(player.status)
end
Is all you need
I highly do not recommend using this. It will force the status_change function during actions--so if you happen to lose or gain a buff while you're casting a spell, you'll end up in your idle/engaged gear instead of proper midcast gear. At the very least, change the 'else' to 'elseif not midaction() then'.
function get_sets()
send_command('input /macro book 7;wait .1;input /macro set 1') -- Change Default Macro Book Here --
AccIndex = 1
AccArray = {"Low","Mid","High"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid. Default ACC Set Is LowACC. The First TP Set Of Your Main Weapon Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below --
Armor = 'None'
Rings = "Oneiros Ring"
sets.tp ={ring1=Rings}
Code
if player.mp < 99 then
Rings = "Rajas Ring"
else
Rings = "Oneiros Ring"
end
This won't work. Rings is passed by value, not reference, at the time the table sets.tp is created. Changing the value of Rings later will not update that table, as sets.tp.ring1 is pointing to a string, not a pointer. If you want to use this method, you would have to make Rings a table, with the attribute name pointing to the string. i.e. Rings = {name="Oneiros Ring"}. Then change the name attribute, i.e. Rings.name = "Rajas Ring". That way, sets.tp.ring1 is pointing to a table, which is assigned by reference.
As for the sleep gear... that will work to equip it when I get put to sleep. Will it go back to my previous set when I wake? Or do I need to do something like
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
elseif string.lower(buff) == "sleep" and lost then
equip(meleeSet)
end
end
Or will gswap automatically go back to the previous set once sleep is lost?
Lastly... I have it set to equip regen gear when my hpp < 95%, which is great. But, is there a way to make it automatically go to my idle gear (with PDT gear and such) when my hp breaks 95%?
Code
if buff == "sleep" and gain and player.hpp < 95 and player.status == "Engaged" then
equip({neck="Berserker's Torque"})
else
status_change(player.status)
end
Is all you need
I highly do not recommend using this. It will force the status_change function during actions--so if you happen to lose or gain a buff while you're casting a spell, you'll end up in your idle/engaged gear instead of proper midcast gear. At the very least, change the 'else' to 'elseif not midaction() then'.
I posted a better alternative after that which works far better but it can work (it was lazy code on the fly but there's a methodology for it although I'm not an advocate of it).
The force to Status_change is a valid point, I'll take another look at my rules again when at home to do so properly and get the full code, good catch.
Hello! I'm not exactly sure where else to turn.
Does anyone have a good Corsair GS file I could download off of them? I've tried searching through multiple threads, but any I find are so old they barely work anymore. Or the download link is broken.
Hello! I'm not exactly sure where else to turn.
Does anyone have a good Corsair GS file I could download off of them? I've tried searching through multiple threads, but any I find are so old they barely work anymore. Or the download link is broken.
Any help is appreciated, thanks!
If you want a file where you can just drop your sets into a predefined file, I'd recommend Mote's. He has a COR file. You can download all of this files here
You mean to use spell.skill when comparing to all the combat skills, not spell.type. Also, use parenthesis around or comparisons (not sure how Lua processes compound expressions, but typically the and is processed first, so, for example, your first condition will cancel every Marksmanship spell, regardless of distance; I always use them just to be sure anyway).
Can shorten it a bit using S table and the contain function. Can also combine the two conditionals since your processing is identical. And lastly, we can conclude, practically speaking, that if the WS is not archery or marksmanship skill, it must be a close-range skill, so we shouldn't need to check.
Code
if spell.type:lower() == 'weaponskill' then
if (spell.target.distance > 21.2 and S{'archery','marksmanship'}:contains(spell.skill:lower())) or spell.target.distance > 4.2 then
cancel_spell()
add_to_chat(123, '**!!Canceled '..spell.name..'. '..spell.target.name..' is Too Far!!**')
eventArgs.handled = true
return handle_equipping_gear(player.status)
end
Is there a way to use a different Idle set for when a Luopan is present as compared to when one is not? I've been trying a few methods but can't seem to get it to work.
That is actually exactly what I have. I have tried this in aftercast and in function but neither one seems to do what I want it to do. I'll paste the entire thing up when I get off work and maybe someone will see something I can't.
That is actually exactly what I have. I have tried this in aftercast and in function but neither one seems to do what I want it to do. I'll paste the entire thing up when I get off work and maybe someone will see something I can't.
I couldn't get that to work for luopans, either. So I just made it a PetPDT set that's an offshoot of my normal PDT Idle.
that's the closest to a working code that i've seen but it didn't work >< i put the marksmanship and archery weaponskills in my rng lua (which is what i tested the code on) as .. = S{'..', '..'} etc too but it
Code
isn't registering the weaponskills. i've also tried contains:(spell.english) and am thinking the S{'archery','marksmanship'}:contains(spell.skill:lower()) needs more clarity.
function pretarget(spell,action)
if player.status ~= 'Engaged' then
if (spell.target.distance >5 and spell.type == 'Weaponskill' and not ranged_ws[spell.name]) or (spell.target.distance > 21 and spell.type == '/weaponskill') then
cancel_spell()
return
end
This is how I do it in mine, but I don't use motes... and I don't think I've ever actually tested it..
if spell.type:lower() == 'weaponskill' then
if (spell.target.distance > 4.2 and not ranged_ws:contains(spell.english)) or (spell.target.distance > 21.2 and ranged_ws:contains(spell.english)) then
cancel_spell()
add_to_chat(123, '**!!Canceled '..spell.name..'. '..spell.target.name..' is Too Far!!**')
eventArgs.handled = true
end
end
then i put ranged_ws = S{'..', '..'} in user_setup()
Thanks Orestes! The reive gear is equipping and the correct Serpentes gear is equipping while engaged for refresh. Couple things that I can't rap up:
I want to be able to list equipment for spells in the main/sub slot that will change when I'm not in a melee stance. I tried adding a 'None' melee stance so that when I'm in 'None' my weapons/shields change out depending on action. And when I want to engage, I go into one of the melee stances (Normal, Acc, etc). Sadly this isn't working. It works for my RDM_gear.lua, any idea why it works in RDM and not in BLU?
Mote has the default gear setup in Mote-Globals.lua. You can see what he has assigned here.
You should be able to change them, by redefining them in user or job_setup. ex: gear.default.obi_ring = "Strendu Ring"
What you gave will let me set a default ring to equip if I put gear.ElementalRing in the set. What I'm looking for is to have a default nuking set with MAB, Magic Damage+ in each slot by default. And depending on spell, I can update the ring/back/waist slot to equip if it's the correct day (for ring), day or weather (for cape and obi). I would imagine I would need something in the customize_idle_set and customize_melee_set functions, I just don't know what exactly. Something that would compare the spell element to world.day_element and world.weather_element? Then do a set_combine(meleeSet, sets.Elemental_day) or something of the nature.
As for the sleep gear... that will work to equip it when I get put to sleep. Will it go back to my previous set when I wake? Or do I need to do something like
Code
function job_buff_change(buff, gain)
if string.lower(buff) == "sleep" and gain and player.hp > 200 then
equip(sets.Berserker)
elseif string.lower(buff) == "sleep" and lost then
equip(meleeSet)
end
end
Or will gswap automatically go back to the previous set once sleep is lost?
Lastly... I have it set to equip regen gear when my hpp < 95%, which is great. But, is there a way to make it automatically go to my idle gear (with PDT gear and such) when my hp breaks 95%?
Sorry if this is coming across too demanding. I'm not a programmer by nature. Just a normal Mechanical Engineer. All help is appreciated!
I'm a little unclear on what you're trying to do with your weapon slots. Is there an example lua i can see that's already doing what you want?
As for obis, they do exactly that with the special sets I mentioned. If there's an obi in your inventory for the day matching the spell you're using, it will be used. Otherwise, the default will be used, specified in the syntax above.
The last thing you mentioned doesn't sound possible. Your changing doesn't trigger any sort of event we can piggy back on. You could check hp when your status changes from engaged to idle and vice versa. You could also check it when you use an ability, or when you hit the update button (F12).
That is actually exactly what I have. I have tried this in aftercast and in function but neither one seems to do what I want it to do. I'll paste the entire thing up when I get off work and maybe someone will see something I can't.
pet.isvalid is not updated fast enough to register your pet immediately after a Geo spell (probably something to do with pet taking a second to pop first in game). Does your code work if you trigger something else after having casted the Geo spell, or manually update your idle gear?
You could create and maintain your own variable, something like
Code
function aftercast(spell,action)
if not spell.interrupted then
if string.find(spell.english,'Geo') then
luopan = true
elseif spell.english=="Full Circle" or not pet.isvalid then
luopan = false
end
end
status_gear()
end
this samlua has this built into the code, not sure if it works beccause i dont have acc+8 ontronif but i tried use the same idea to change xaddi gauntlets based on acc differentiator between the two pairs I have but it won't work, any ideas for me to try?
what would i use to swap; say, the pre-determened augment armor (paths ABC), what would the code look like to have those different pieces swapping how one needs? is my question as best as I can ask. tough sometimes hehe
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.