|
Gearswap Support Thread
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-03 14:01:55
Thanks it was the body that was causing the issues :)
Quetzalcoatl.Orestes
Server: Quetzalcoatl
Game: FFXI
Posts: 430
By Quetzalcoatl.Orestes 2016-06-03 15:21:08
Code if spell.english=='Warp' and player.sub_job~='BLM' then
windower.send_command('input /equip ring1 "Warp Ring"; wait 9; input /item "Warp Ring" <me>;')
cancel_spell()
return
Best I can tell this code will never return true, presumably due to however Gearswap handles spells you can't actually cast. Is there an alternative way I could write this that would work?
You could try a self_command.
Just tested this in my NIN.lua (which is based on Mote's) and it worked. equip(), and disable() didn't work in this context, so I had to make a set with Warp Ring in it, and call equip with send_command. Code
-- command is //gs c toggle UseWarp
function job_setup()
state.UseWarp = M(false, 'Use Warp')
end
function job_state_change(stateField, newValue, oldValue)
if stateField == 'Use Warp' then
add_to_chat(8, '------------WARPING-----------')
send_command('input //gs equip sets.Warp;')
send_command('input //gs disable ring1;@wait 10.0;input /item "Warp Ring" <me>;input //gs enable ring1;')
end
end
Non-Mote's would do something like this. Code
-- command would be //gs c Warp
function self_command(command)
if command == 'Warp' then
add_to_chat(8, '------------WARPING-----------')
send_command('input //gs equip sets.Warp;')
send_command('input //gs disable ring1;@wait 10.0;input /item "Warp Ring" <me>;input //gs enable ring1;')
end
end
I suspect the enable/disable commands aren't working as written, but no time to test now.
Server: Fenrir
Game: FFXI
Posts: 11681
By Fenrir.Nightfyre 2016-06-03 18:18:25
That was my next step yeah, wanted to see if I could do it with the spell first because lazy.
Server: Fenrir
Game: FFXI
Posts: 183
By Fenrir.Brimstonefox 2016-06-03 19:02:44
Can you give an example of what action you mean? I don't understand what you're trying to do.
Either way, you can sleep your currently running program using "coroutine.sleep(0.4)", but that will delay the currently processing function entirely. Instead it may be smarter to write a new function to send the command and delay that with "f:schedule(0.4)", where "f" is the function you defined.
Example usage: Code require('functions')
send_action = function()
-- Code that sends an action
end
send_action:schedule(0.4)
If you want "send_action" to always be delayed by that amount you can even build it into the function using functions.delay:
Code require('functions')
send_action = (function()
-- Code that sends an action
end):delay(0.4)
send_action()
I've tried using coroutine.sleep(2) to pause a function for 2 seconds but it doesn't appear to work at all, anyway to do this?
I tried one or two things here: http://lua-users.org/wiki/SleepFunction
I think one didn't work at all, the other pretty much crashed the game (I don't remember which was which)
I literally would be happy with: Code
add_to_chat(1, "Hello")
sleep(1)
add_to_chat(1, "World!")
And have those 2 strings appear 1 second apart is all I want (obviously I'm working more complex logic, but that is the simplest version of anything).
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-04 11:51:09
Can someone explain how I switch to idle / movement / refresh gear. Am i supposed to use a key or should this switch automatically outside of combat?
Code function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid/Stun. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
WeaponIndex = 1
WeaponArray = {"Liberator","Ragnarok","Apocalypse"} -- Default Main Weapon Is Liberator. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
IdleIndex = 1
IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
Armor = 'None'
Warp = 'None'
Twilight = 'None'
Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
Rancor = 'ON' -- Set Default Rancor ON or OFF Here --
Mekira = 'OFF' -- Set Default Mekira ON or OFF Here --
Samurai_Roll = 'OFF' -- Set Default SAM Roll ON or OFF Here --
target_distance = 5 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
sc_map = {SC1="Resolution", SC2="LastResort", SC3="Souleater"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
sets.Idle = {}
-- Idle/Town Sets --
sets.Idle.Regen = {
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs="Crimson Cuisses",
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Sanctity Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
}
sets.Idle.Regen.Liberator = set_combine(sets.Idle.Regen,{
main="Liberator"})
sets.Idle.Regen.Ragnarok = set_combine(sets.Idle.Regen,{
main="Ragnarok"})
sets.Idle.Regen.Apocalypse = set_combine(sets.Idle.Regen,{
main="Apocalypse"})
sets.Idle.Movement = set_combine(sets.Idle.Regen,{
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs="Crimson Cuisses",
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Lissome Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
})
sets.Idle.Movement.Liberator = set_combine(sets.Idle.Movement,{
main="Liberator"})
sets.Idle.Movement.Ragnarok = set_combine(sets.Idle.Movement,{
main="Ragnarok"})
sets.Idle.Movement.Apocalypse = set_combine(sets.Idle.Movement,{
main="Apocalypse"})
sets.Idle.Refresh = set_combine(sets.Idle.Regen,{
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs={ name="Odyssean Cuisses", augments={'Accuracy+25 Attack+25','Phys. dmg. taken -2%','Accuracy+13',}},
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Lissome Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
})
sets.Idle.Refresh.Liberator = set_combine(sets.Idle.Refresh,{
main="Liberator"})
sets.Idle.Refresh.Ragnarok = set_combine(sets.Idle.Refresh,{
main="Ragnarok"})
sets.Idle.Refresh.Apocalypse = set_combine(sets.Idle.Refresh,{
main="Apocalypse"})
Quetzalcoatl.Orestes
Server: Quetzalcoatl
Game: FFXI
Posts: 430
By Quetzalcoatl.Orestes 2016-06-04 12:11:31
Can someone explain how I switch to idle / movement / refresh gear. Am i supposed to use a key or should this switch automatically outside of combat?
Code function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid/Stun. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
WeaponIndex = 1
WeaponArray = {"Liberator","Ragnarok","Apocalypse"} -- Default Main Weapon Is Liberator. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
IdleIndex = 1
IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
Armor = 'None'
Warp = 'None'
Twilight = 'None'
Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
Rancor = 'ON' -- Set Default Rancor ON or OFF Here --
Mekira = 'OFF' -- Set Default Mekira ON or OFF Here --
Samurai_Roll = 'OFF' -- Set Default SAM Roll ON or OFF Here --
target_distance = 5 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
sc_map = {SC1="Resolution", SC2="LastResort", SC3="Souleater"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
sets.Idle = {}
-- Idle/Town Sets --
sets.Idle.Regen = {
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs="Crimson Cuisses",
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Sanctity Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
}
sets.Idle.Regen.Liberator = set_combine(sets.Idle.Regen,{
main="Liberator"})
sets.Idle.Regen.Ragnarok = set_combine(sets.Idle.Regen,{
main="Ragnarok"})
sets.Idle.Regen.Apocalypse = set_combine(sets.Idle.Regen,{
main="Apocalypse"})
sets.Idle.Movement = set_combine(sets.Idle.Regen,{
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs="Crimson Cuisses",
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Lissome Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
})
sets.Idle.Movement.Liberator = set_combine(sets.Idle.Movement,{
main="Liberator"})
sets.Idle.Movement.Ragnarok = set_combine(sets.Idle.Movement,{
main="Ragnarok"})
sets.Idle.Movement.Apocalypse = set_combine(sets.Idle.Movement,{
main="Apocalypse"})
sets.Idle.Refresh = set_combine(sets.Idle.Regen,{
ammo="Seeth. Bomblet +1",
head={ name="Valorous Mask", augments={'Accuracy+25 Attack+25','Weapon skill damage +3%','Accuracy+13','Attack+8',}},
body={ name="Valorous Mail", augments={'Accuracy+29','"Store TP"+4','Attack+6',}},
hands={ name="Valorous Mitts", augments={'Accuracy+30','"Store TP"+7',}},
legs={ name="Odyssean Cuisses", augments={'Accuracy+25 Attack+25','Phys. dmg. taken -2%','Accuracy+13',}},
feet={ name="Valorous Greaves", augments={'Accuracy+24 Attack+24','Crit.hit rate+3','VIT+4','Accuracy+13','Attack+14',}},
neck="Lissome Necklace",
waist="Kentarch Belt +1",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Ankou's Mantle", augments={'DEX+20','Accuracy+20 Attack+20','"Store TP"+10',}}
})
sets.Idle.Refresh.Liberator = set_combine(sets.Idle.Refresh,{
main="Liberator"})
sets.Idle.Refresh.Ragnarok = set_combine(sets.Idle.Refresh,{
main="Ragnarok"})
sets.Idle.Refresh.Apocalypse = set_combine(sets.Idle.Refresh,{
main="Apocalypse"})
The code you pasted doesn't tell us anything about how these modes are changed, since it only contains your gear sets.
It looks like you're using Bokura's gearswap though. If so, it doesn't look like he has key bindings setup, so you'd have to add that yourself if you wanted hotkeys to cycle these modes.
Otherwise, the easiest option is to setup macros for cycling the various modes.
Accuracy Mode toggle macro
Main Weapon toggle macro
Idle mode (Refresh) toggle macro
tip: if you look in the self_command() function you can find all the various toggles Bokura provides.
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-04 12:23:28
Quetzalcoatl.Orestes said: »The code you pasted doesn't tell us anything about how these modes are changed, since it only contains your gear sets.
It looks like you're using Bokura's gearswap though. If so, it doesn't look like he has key bindings setup, so you'd have to add that yourself if you wanted hotkeys to cycle these modes.
Otherwise, the easiest option is to setup macros for cycling the various modes.
Accuracy Mode toggle macro
Thanks, can you post an up to date version of your file please with gearsets in. Looks nice and would be easier to cross reference
Quetzalcoatl.Orestes
Server: Quetzalcoatl
Game: FFXI
Posts: 430
By Quetzalcoatl.Orestes 2016-06-04 12:39:16
Quetzalcoatl.Orestes said: »The code you pasted doesn't tell us anything about how these modes are changed, since it only contains your gear sets.
It looks like you're using Bokura's gearswap though. If so, it doesn't look like he has key bindings setup, so you'd have to add that yourself if you wanted hotkeys to cycle these modes.
Otherwise, the easiest option is to setup macros for cycling the various modes.
Accuracy Mode toggle macro
Thanks, can you post an up to date version of your file please with gearsets in. Looks nice and would be easier to cross reference
My latest is here. As far as gear goes, my DRK has been on the sideline for a few months, so it's a little behind on gear.
To copy it, click the "Raw" link on that page and select all + copy + paste into a .lua file.
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-04 13:09:56
Quetzalcoatl.Orestes said: »My latest is here. As far as gear goes, my DRK has been on the sideline for a few months, so it's a little behind on gear.
To copy it, click the "Raw" link on that page and select all + copy + paste into a .lua file.
Thanks looks awesome. Last point, if a combine set is used you only need to add the pieces you want to change, i.e mega simple refesh set should just have one line for bale chocker as it combines the tp set with it, correct?
Quetzalcoatl.Orestes
Server: Quetzalcoatl
Game: FFXI
Posts: 430
By Quetzalcoatl.Orestes 2016-06-04 13:23:27
Quetzalcoatl.Orestes said: »My latest is here. As far as gear goes, my DRK has been on the sideline for a few months, so it's a little behind on gear.
To copy it, click the "Raw" link on that page and select all + copy + paste into a .lua file.
Thanks looks awesome. Last point, if a combine set is used you only need to add the pieces you want to change, i.e mega simple refesh set should just have one line for bale chocker as it combines the tp set with it, correct?
Yes, set_combine(setA, setB) will make sure setB's gear overwrites setA if they share slots.
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-06-04 18:02:50
That was my next step yeah, wanted to see if I could do it with the spell first because lazy.
Spells you cant cast are caught by filtered_action function. In case you would rather type warp instead of gs c warp. You also would not need to check your subjob. (If you use Mote, he does not use this function for anything, so you can use it directly.)
Quetzalcoatl.Orestes said: »Quetzalcoatl.Orestes said: »My latest is here. As far as gear goes, my DRK has been on the sideline for a few months, so it's a little behind on gear.
To copy it, click the "Raw" link on that page and select all + copy + paste into a .lua file.
Thanks looks awesome. Last point, if a combine set is used you only need to add the pieces you want to change, i.e mega simple refesh set should just have one line for bale chocker as it combines the tp set with it, correct?
Yes, set_combine(setA, setB) will make sure setB's gear overwrites setA if they share slots.
set_combine is also recursive if that is useful information for anyone. set_combine(setA,setB,setC) will stack each set on top of the previous.
[+]
Server: Fenrir
Game: FFXI
Posts: 11681
By Fenrir.Nightfyre 2016-06-04 20:13:27
That's exactly what I was looking for, thanks.
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-05 06:47:52
Quetzalcoatl.Orestes said: »The code you pasted doesn't tell us anything about how these modes are changed, since it only contains your gear sets.
It looks like you're using Bokura's gearswap though. If so, it doesn't look like he has key bindings setup, so you'd have to add that yourself if you wanted hotkeys to cycle these modes.
Otherwise, the easiest option is to setup macros for cycling the various modes.
Accuracy Mode toggle macro
tip: if you look in the self_command() function you can find all the various toggles Bokura provides.
If I wanted to add a hotkey function for this into the file how would I do it?
Also, where abouts in the file should it be added?
Server: Asura
Game: FFXI
Posts: 334
By Asura.Krystela 2016-06-05 09:56:05
Quetzalcoatl.Orestes said: »The code you pasted doesn't tell us anything about how these modes are changed, since it only contains your gear sets.
It looks like you're using Bokura's gearswap though. If so, it doesn't look like he has key bindings setup, so you'd have to add that yourself if you wanted hotkeys to cycle these modes.
Otherwise, the easiest option is to setup macros for cycling the various modes.
Accuracy Mode toggle macro
tip: if you look in the self_command() function you can find all the various toggles Bokura provides.
If I wanted to add a hotkey function for this into the file how would I do it?
Also, where abouts in the file should it be added? At the start of your lua under function get sets like this: Code function get_sets()
-- Binds for modes
send_command('bind ^f1 gs c C1')
^f1 is for ctrl + f1, f1 would just be f1
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-05 11:14:46
Thanks
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-05 12:27:53
I tried this but it did not work, I now get this error
attempt to call global 'send_command' (a nil value)
Code function get_sets()
AccIndex = 1
AccArray = {"LowACC","MidACC","HighACC"} -- 3 Levels Of Accuracy Sets For TP/WS/Hybrid/Stun. First Set Is LowACC. Add More ACC Sets If Needed Then Create Your New ACC Below. Most of These Sets Are Empty So You Need To Edit Them On Your Own. Remember To Check What The Combined Set Is For Each Sets. --
WeaponIndex = 1
WeaponArray = {"Liberator","Ragnarok","Apocalypse"} -- Default Main Weapon Is Liberator. Can Delete Any Weapons/Sets That You Don't Need Or Replace/Add The New Weapons That You Want To Use. --
IdleIndex = 1
IdleArray = {"Movement","Regen","Refresh"} -- Default Idle Set Is Movement --
-- Binds for modes
Send_command('bind ^f9 gs c C7')
Armor = 'None'
Warp = 'None'
Twilight = 'None'
Attack = 'OFF' -- Set Default Attack Set ON or OFF Here --
Rancor = 'ON' -- Set Default Rancor ON or OFF Here --
Mekira = 'OFF' -- Set Default Mekira ON or OFF Here --
Samurai_Roll = 'OFF' -- Set Default SAM Roll ON or OFF Here --
target_distance = 5 -- Set Default Distance Here --
select_default_macro_book() -- Change Default Macro Book At The End --
sc_map = {SC1="Resolution", SC2="LastResort", SC3="Souleater"} -- 3 Additional Binds. Can Change Whatever JA/WS/Spells You Like Here. Remember Not To Use Spaces. --
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-06-05 21:33:55
Best to assume everything is case-sensitive. You need to lowercase the 's'.
[+]
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-07 01:06:29
Ragnarok.Flippant said: »Best to assume everything is case-sensitive. You need to lowercase the 's'.
Thanks all working now
Ragnarok.Flippant
Server: Ragnarok
Game: FFXI
Posts: 660
By Ragnarok.Flippant 2016-06-07 16:53:03
Fenrir.Brimstonefox said: »Can you give an example of what action you mean? I don't understand what you're trying to do.
Either way, you can sleep your currently running program using "coroutine.sleep(0.4)", but that will delay the currently processing function entirely. Instead it may be smarter to write a new function to send the command and delay that with "f:schedule(0.4)", where "f" is the function you defined.
Example usage: Code require('functions')
send_action = function()
-- Code that sends an action
end
send_action:schedule(0.4)
If you want "send_action" to always be delayed by that amount you can even build it into the function using functions.delay:
Code require('functions')
send_action = (function()
-- Code that sends an action
end):delay(0.4)
send_action()
I've tried using coroutine.sleep(2) to pause a function for 2 seconds but it doesn't appear to work at all, anyway to do this?
I tried one or two things here: http://lua-users.org/wiki/SleepFunction
I think one didn't work at all, the other pretty much crashed the game (I don't remember which was which)
I literally would be happy with: Code
add_to_chat(1, "Hello")
sleep(1)
add_to_chat(1, "World!")
And have those 2 strings appear 1 second apart is all I want (obviously I'm working more complex logic, but that is the simplest version of anything).
Sorry, was out of town and missed a few posts.
Code add_to_chat(1,"Hello")
add_to_chat:schedule(4,1,"World!")
But be sure to 'require('functions')' at some point in the file.
By Selindrile 2016-06-11 05:56:46
Anyone got a relatively easy way to determine if a player is moving for gearswap? I'm basically looking for a function that returns true if the player is moving.
Mostly looking to make it swap gear to movement+ gear when moving, but wouldn't mind having it for other checks too.
I tried to copy HealBot's isMoving() function but, tbh don't fully understand that implementation and couldn't get it to work in gearswap. I'm sure it's because I'm not copying something over right. :/
Nightfyre: I just made an alias in my init for that, //warpring as opposed to //warp, pretty basic, though I'm pretty sure that code would work if you really wanna use one macro for both, depending on how your pretarget error handling and other stuff is setup if you have any, try this:
Code function filtered_action(spell)
if spell.english=='Warp' and player.main_job ~= 'BLM' and player.sub_job~='BLM' then
windower.send_command('get "Warp Ring" satchel;wait 2;input /equip ring1 "Warp Ring";gs disable ring1;wait 9;input /item "Warp Ring" <me>;wait 15;gs enable ring1;gs c update user;put "Warp Ring" satchel')
cancel_spell()
return
end
end
By Blazed1979 2016-06-11 18:33:42
Struggling with making my first DRK.Lua
All the templates I see have too much micro-management for my liking/ability to manage. I'm really as far from code savy as is possible - I can't get windows to do ***its suppossed to. But I love my DRK and want to invest in getting a good gearswap lua for it. So help is highly appreciated.
I just want:
1.Pre-cast sets and midcast sets for all Abs spells and another for Drain1,2,3 and aspirs.
2. 4 tp sets for lib + 3 WS sets
3. 4 tp sets for apoc + 3 WS sets
4. 3 tp sets for rag + 3 ws sets
5. PDT set
6. Idle set
My blu.lua is basic but exactly what I need. Can anyone give me a simple template like the above please?
Here's my blu lua Code -------------------------------------------------------------------------------------------------------------------
-- Setup functions for this job. Generally should not be modified.
-------------------------------------------------------------------------------------------------------------------
-- Initialization function for this job file.
function get_sets()
mote_include_version = 2
-- Load and initialize the include file.
include('Mote-Include.lua')
end
-- Setup vars that are user-independent. state.Buff vars initialized here will automatically be tracked.
function job_setup()
state.Buff['Burst Affinity'] = buffactive['Burst Affinity'] or false
state.Buff['Chain Affinity'] = buffactive['Chain Affinity'] or false
state.Buff.Convergence = buffactive.Convergence or false
state.Buff.Diffusion = buffactive.Diffusion or false
state.Buff.Efflux = buffactive.Efflux or false
state.Buff['Unbridled Learning'] = buffactive['Unbridled Learning'] or false
blue_magic_maps = {}
-- Mappings for gear sets to use for various blue magic spells.
-- While Str isn't listed for each, it's generally assumed as being at least
-- moderately signficant, even for spells with other mods.
-- Physical Spells --
-- Physical spells with no particular (or known) stat mods
blue_magic_maps.Physical = S{
'Bilgestorm'
}
-- Spells with heavy accuracy penalties, that need to prioritize accuracy first.
blue_magic_maps.PhysicalAcc = S{
'Heavy Strike',
}
-- Physical spells with Str stat mod
blue_magic_maps.PhysicalStr = S{
'Battle Dance','Bloodrake','Death Scissors','Dimensional Death',
'Empty Thrash','Quadrastrike','Sinker Drill','Spinal Cleave',
'Uppercut','Vertical Cleave'
}
-- Physical spells with Dex stat mod
blue_magic_maps.PhysicalDex = S{
'Amorphic Spikes','Asuran Claws','Barbed Crescent','Claw Cyclone','Disseverment',
'Foot Kick','Frenetic Rip','Goblin Rush','Hysteric Barrage','Paralyzing Triad',
'Seedspray','Sickle Slash','Smite of Rage','Terror Touch','Thrashing Assault',
'Vanity Dive'
}
-- Physical spells with Vit stat mod
blue_magic_maps.PhysicalVit = S{
'Body Slam','Cannonball','Delta Thrust','Glutinous Dart','Grand Slam',
'Power Attack','Quad. Continuum','Sprout Smack','Sub-zero Smash'
}
-- Physical spells with Agi stat mod
blue_magic_maps.PhysicalAgi = S{
'Benthic Typhoon','Feather Storm','Helldive','Hydro Shot','Jet Stream',
'Pinecone Bomb','Spiral Spin','Wild Oats'
}
-- Physical spells with Int stat mod
blue_magic_maps.PhysicalInt = S{
'Mandibular Bite','Queasyshroom'
}
-- Physical spells with Mnd stat mod
blue_magic_maps.PhysicalMnd = S{
'Ram Charge','Screwdriver','Tourbillion'
}
-- Physical spells with Chr stat mod
blue_magic_maps.PhysicalChr = S{
'Bludgeon'
}
-- Physical spells with HP stat mod
blue_magic_maps.PhysicalHP = S{
'Final Sting'
}
-- Magical Spells --
-- Magical spells with the typical Int mod
blue_magic_maps.Magical = S{
'Blastbomb','Blazing Bound','Bomb Toss','Cursed Sphere','Dark Orb','Death Ray',
'Diffusion Ray','Droning Whirlwind','Embalming Earth','Firespit','Foul Waters',
'Ice Break','Leafstorm','Maelstrom','Rail Cannon','Regurgitation','Rending Deluge',
'Retinal Glare','Subduction','Tem. Upheaval','Water Bomb','Anvil Lightning','Spectral Floe','Tenebral Crush','Searing Tempest','Entomb','Silent Storm','Scouring Spate','Blinding Fulgor','Palling Salvo'
}
-- Magical spells with a primary Mnd mod
blue_magic_maps.MagicalMnd = S{
'Acrid Stream','Evryone. Grudge','Magic Hammer','Mind Blast'
}
-- Magical spells with a primary Chr mod
blue_magic_maps.MagicalChr = S{
'Eyes On Me','Mysterious Light'
}
-- Magical spells with a Vit stat mod (on top of Int)
blue_magic_maps.MagicalVit = S{
'Thermal Pulse'
}
-- Magical spells with a Dex stat mod (on top of Int)
blue_magic_maps.MagicalDex = S{
'Charged Whisker','Gates of Hades'
}
-- Magical spells (generally debuffs) that we want to focus on magic accuracy over damage.
-- Add Int for damage where available, though.
blue_magic_maps.MagicAccuracy = S{
'1000 Needles','Absolute Terror','Actinic Burst','Auroral Drape','Awful Eye',
'Blank Gaze','Blistering Roar','Blood Drain','Blood Saber','Chaotic Eye',
'Cimicine Discharge','Cold Wave','Corrosive Ooze','Demoralizing Roar','Digest',
'Dream Flower','Enervation','Feather Tickle','Filamented Hold','Frightful Roar',
'Geist Wall','Hecatomb Wave','Infrasonics','Jettatura','Light of Penance',
'Lowing','Mind Blast','Mortal Ray','MP Drainkiss','Osmosis','Reaving Wind',
'Sandspin','Sandspray','Sheep Song','Soporific','Sound Blast','Stinking Gas',
'Sub-zero Smash','Venom Shell','Sudden Lunge','Voracious Trunk','Yawn'
}
-- Breath-based spells
blue_magic_maps.Breath = S{
'Bad Breath','Flying Hip Press','Frost Breath','Heat Breath',
'Hecatomb Wave','Magnetite Cloud','Poison Breath','Radiant Breath','Self-Destruct',
'Thunder Breath','Vapor Spray','Wind Breath'
}
-- Stun spells
blue_magic_maps.Stun = S{
'Blitzstrahl','Frypan','Head Butt','Tail slap','Temporal Shift',
'Thunderbolt','Whirl of Rage'
}
-- Healing spells
blue_magic_maps.Healing = S{
'Healing Breeze','Magic Fruit','Plenilune Embrace','Pollen','Restoral','White Wind',
'Wild Carrot'
}
-- Buffs that depend on blue magic skill
blue_magic_maps.SkillBasedBuff = S{
'Barrier Tusk','Diamondhide','Magic Barrier','Metallic Body','Plasma Charge',
'Pyric Bulwark','Reactor Cool','Occultation','Regeneration','Nat. Meditation'
}
-- Other general buffs
blue_magic_maps.Buff = S{
'Amplification','Animating Wail','Battery Charge','Carcharian Verve','Cocoon',
'Erratic Flutter','Exuviation','Fantod','Feather Barrier','Harden Shell',
'Memento Mori','Orcish Counterstance','Refueling',
'Saline Coat','Triumphant Roar','Warm-Up','Winds of Promyvion',
'Zephyr Mantle'
}
-- Spells that require Unbridled Learning to cast.
unbridled_spells = S{
'Absolute Terror','Bilgestorm','Blistering Roar','Bloodrake','Carcharian Verve',
'Crashing Thunder','Droning Whirlwind','Gates of Hades','Harden Shell','Polar Roar',
'Pyric Bulwark','Thunderbolt','Tourbillion','Uproot'
}
end
-------------------------------------------------------------------------------------------------------------------
-- User setup functions for this job. Recommend that these be overridden in a sidecar file.
-------------------------------------------------------------------------------------------------------------------
-- Setup vars that are user-dependent. Can override this function in a sidecar file.
function user_setup()
state.OffenseMode:options('Normal', 'Acc')
state.WeaponskillMode:options('Normal', 'Acc')
state.CastingMode:options('Normal', 'Resistant')
state.IdleMode:options('Normal')
gear.macc_hagondes = {name="Leyline Gloves"}
-- Additional local binds
send_command('bind ^` input /ja "Chain Affinity" <me>')
send_command('bind !` input /ja "Efflux" <me>')
send_command('bind @` input /ja "Burst Affinity" <me>')
update_combat_form()
select_default_macro_book()
end
-- Called when this job file is unloaded (eg: job change)
function user_unload()
send_command('unbind ^`')
send_command('unbind !`')
send_command('unbind @`')
end
-- Set up gear sets.
function init_gear_sets()
--------------------------------------
-- Start defining the sets
--------------------------------------
sets.buff['Burst Affinity'] = {feet="Hashishin Basmak +1"}
sets.buff['Chain Affinity'] = {head="Hashishin Kavuk +1", feet="Assimilator's Charuqs +1"}
sets.buff.Convergence = {head="Luhlaza Keffiyeh"}
sets.buff.Diffusion = {feet="Luhlaza Charuqs"}
sets.buff.Enchainment = {body="Luhlaza Jubbah"}
sets.buff.Efflux = {legs="Hashishin Tayt +1"}
-- Precast Sets
-- Precast sets to enhance JAs
sets.precast.JA['Azure Lore'] = {hands="Luhlaza Bazubands"}
-- Waltz set (chr and vit)
sets.precast.Waltz = {ammo="Mavi Tathlum",
head="Kheper Bonnet",
body="Vanir Cotehardie",hands="Telchine Gloves",ring1="Kunaji Ring",
back="Solemnity Cape",waist="Chuq'aba Belt",legs="Telchine Braconi",feet="Telchine Pigaches"}
-- Don't need any special gear for Healing Waltz.
sets.precast.Waltz['Healing Waltz'] = {}
-- Fast cast sets for spells
sets.precast.FC = {ammo="Sapience Orb",
head="Carmine Mask +1",
body="Foppish tunica",
hands="Leyline Gloves",
legs="Lengo pants",
feet="Carmine greaves +1",
neck="Twilight Torque",
waist="Witful Belt",
left_ear="Loquac. Earring",
right_ear="Etiolation Earring",
left_ring="Prolix Ring",
right_ring="Veneficium ring",
back="Swift Cape +1"}
sets.precast.FC['Blue Magic'] = set_combine(sets.precast.FC, {body="Hashishin Mintan +1"})
-- Weaponskill sets
-- Default set for any weaponskill that isn't any more specifically defined
sets.precast.WS = {ammo="Amar cluster",
head="Adhemar Bonnet +1",
body="Adhemar Jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Herculean Boots",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Moonshade Earring",
right_ear="Brutal Earring",
left_ring="Rajas Ring",
right_ring="Epona's Ring",
back="Rosmerta's cape"}
sets.precast.WS.acc = set_combine(sets.precast.WS, {hands="Leyline Gloves"})
-- Specific weaponskill sets. Uses the base set if an appropriate WSMod version isn't found.
sets.precast.WS['Requiescat'] = set_combine(sets.precast.WS, {ring1="Rufescent Ring",feet="Telchine Pigaches"})
sets.precast.WS['Chant du Cygne'] = {ammo="Amar cluster",
head="Adhemar Bonnet +1",
body="Adhemar Jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid Greaves",
neck="Fotia Gorget",
waist="Fotia Belt",
left_ear="Moonshade Earring",
right_ear="Brutal Earring",
left_ring="Hetairoi Ring",
right_ring="Epona's Ring",
back="Rosmerta's cape"}
-- Midcast Sets
sets.midcast.FastRecast = {}
sets.midcast['Blue Magic'] = {}
-- Physical Spells --
sets.midcast['Blue Magic'].Physical = {ammo="Amar cluster",
head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back="Rosmerta's Cape",}
sets.midcast['Blue Magic'].PhysicalAcc = {ammo="Amar cluster",
head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back="Rosmerta's Cape",}
sets.midcast['Blue Magic'].PhysicalStr = set_combine(sets.midcast['Blue Magic'].Physical,
{head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back="Rosmerta's Cape",
ammo="Amar Cluster",}
sets.midcast['Blue Magic'].PhysicalDex = set_combine(sets.midcast['Blue Magic'].Physical,
[head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back="Rosmerta's Cape",
ammo="Amar Cluster",}
sets.midcast['Blue Magic'].PhysicalVit = set_combine(sets.midcast['Blue Magic'].Physical,
{ammo="Amar Cluster",
head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back="Rosmerta's Cape",}
sets.midcast['Blue Magic'].PhysicalAgi = set_combine(sets.midcast['Blue Magic'].Physical,
{head="Adhemar Bonnet +1",
body="Adhemar jacket +1",
hands="Adhemar Wristbands +1",
legs="Samnuha Tights",
feet="Thereoid greaves",
neck="Tjukurrpa Medal",
waist="Grunfeld rope",
left_ear="Brutal Earring",
right_ear="Cessance Earring",
left_ring="Petrov Ring",
right_ring="Rajas Ring",
back={ name="Rosmerta's Cape",}
sets.midcast['Blue Magic'].PhysicalInt = set_combine(sets.midcast['Blue Magic'].Physical,
{head="Amalric coif",
body="Amalric doublet +1",
hands="Amalric gages +1",
legs="Amalric slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan stone",
left_ear="Friomisi earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
sets.midcast['Blue Magic'].PhysicalMnd = set_combine(sets.midcast['Blue Magic'].Physical,
{head="Amalric coif",
body="Amalric doublet +1",
hands="Amalric gages +1",
legs="Amalric slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan stone",
left_ear="Friomisi earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
sets.midcast['Blue Magic'].PhysicalChr = set_combine(sets.midcast['Blue Magic'].Physical,
{head="Amalric coif",
body="Amalric doublet +1",
hands="Amalric gages +1",
legs="Amalric slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan stone",
left_ear="Friomisi earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
-- Magical Spells --
sets.midcast['Blue Magic'].Magical = {ammo="Pemphredo Tathlum",
{head="Amalric coif",
body="Amalric doublet +1",
hands="Amalric gages +1",
legs="Amalric slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan stone",
left_ear="Friomisi earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
sets.midcast['Blue Magic'].Magical.Resistant = set_combine(sets.midcast['Blue Magic'].Magical,
{ammo="Pemphredo Tathlum",
head="Herculean Helm",
body="Amalric Doublet +1",
hands="Amalric Gages +1",
legs="Amalric Slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan Stone",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
sets.midcast['Blue Magic'].MagicAccuracy = {ammo="Pemphredo Tathlum",
head="Carmine Mask +1",
body="Amalric Doublet +1",
hands="Amalric Gages +1",
legs="Amalric slops +1",
feet="Amalric Nails",
neck="Eddy Necklace",
waist="Eschan Stone",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw cape +1",}
-- Breath Spells --
sets.midcast['Blue Magic'].Breath = {ammo="Pemphredo Tathlum",
head="Herculean Helm",
body="Amalric Doublet +1",
hands="Amalric Gages +1",
legs="Amalric Slops +1",
feet="Amalric nails",
neck="Eddy Necklace",
waist="Eschan Stone",
left_ear="Friomisi Earring",
right_ear="Hecate's Earring",
left_ring="Shiva Ring +1",
right_ring="Shiva Ring +1",
back="Seshaw Cape +1",}
-- Other Types --
sets.midcast['Blue Magic'].Stun = set_combine(sets.midcast['Blue Magic'].MagicAccuracy,
{waist="Eschan Stone"})
sets.midcast['Blue Magic']['White Wind'] = {ammo="Impatiens",
head=name="Carmine Mask +1",
body="Chelona blazer",
hands=name="Serpentes Gloves",
legs="Gyve Trousers",
feet=name="Serpentes sabots",
neck="Phalaina Locket",
waist="Witful belt",
left_ear="Mendi. Earring",
right_ear="Loquacious Earring",
left_ring="Kunaji Ring",
right_ring="Asklepian Ring",
back="Tempered Cape",}
sets.midcast['Blue Magic'].Healing = {ammo="Impatiens",
head=name="Carmine Mask +1",
body="Chelona blazer",
hands=name="Serpentes Gloves",
legs="Gyve Trousers",
feet=name="Serpentes sabots",
neck="Phalaina Locket",
waist="Witful belt",
left_ear="Mendi. Earring",
right_ear="Loquacious Earring",
left_ring="Kunaji Ring",
right_ring="Asklepian Ring",
back="Tempered Cape",}
sets.midcast['Blue Magic'].SkillBasedBuff = {ammo="Mavi Tathlum",
head="Luhlaza Keffiyeh",
body="Assimilator's Jubbah +1","Rawhide Gloves",
back="Cornflower Cape",legs="Hashishin Tayt +1",feet="Luhlaza Charuqs"}
sets.midcast['Blue Magic'].Buff = {}
sets.midcast.Protect = {ring1="Sheltered Ring"}
sets.midcast.Protectra = {ring1="Sheltered Ring"}
sets.midcast.Shell = {ring1="Sheltered Ring"}
sets.midcast.Shellra = {ring1="Sheltered Ring"}
-- Sets to return to when not performing an action.
-- Gear for learning spells: +skill and AF hands.
sets.Learning = {ammo="Mavi Tathlum",hands="Assimilator's Bazubands +1",body="Assimilator's Jubbah +1",
legs="Hashishin Tayt +1",back="Cornflower Cape"}
--head="Luhlaza Keffiyeh",
--body="Assimilator's Jubbah",hands="Assimilator's Bazubands +1",
--back="Cornflower Cape",legs="Mavi Tayt +2",feet="Luhlaza Charuqs"}
sets.latent_refresh = {waist="Fucho-no-obi"}
-- Resting sets
sets.resting = {ammo="Impatiens",
head="Rawhide Mask",
body="Amalric doublet +1",
hands="Serpentes cuffs",
legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
feet={ name="Hag. Sabots +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -4%',}},
neck="Bathy Choker",
waist="Fucho-no-Obi",
left_ear="Infused Earring",
right_ear="Dawn Earring",
left_ring="Defending Ring",
right_ring={ name="Dark Ring", augments={'Phys. dmg. taken -6%','Magic dmg. taken -4%','Breath dmg. taken -5%',}},
back="Xucau Mantle"}
-- Idle sets
sets.idle = {ammo="Ginsen",
head="Rawhide Mask",
body="Vrikodara Jupon",
hands={ name="Iuitl Wristbands +1", augments={'Phys. dmg. taken -4%','Attack+9',}},
legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
feet={ name="Hag. Sabots +1", augments={'Phys. dmg. taken -4%','Magic dmg. taken -4%',}},
neck="Bathy Choker",
waist="Fucho-no-Obi",
left_ear="Infused Earring",
right_ear="Dawn Earring",
left_ring="Sheltered Ring",
right_ring="Paguroidea Ring",
back="Xucau Mantle"}
sets.idle.PDT = {}
sets.idle.Town = {}
sets.idle.Learning = set_combine(sets.idle, sets.Learning)
-- Defense sets
sets.Kiting = {legs="Carmine Cuisses +1"}
-- Engaged sets
-- Variations for TP weapon and (optional) offense/defense modes. Code will fall back on previous
-- sets if more refined versions aren't defined.
-- If you create a set with both offense and defense modes, the offense mode should be first.
-- EG: sets.engaged.Dagger.Accuracy.Evasion
-- Normal melee group
sets.engaged = {ammo="Ginsen",
head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
body="Adhemar Jacket",
hands={ name="Herculean Gloves", augments={'Accuracy+11','"Triple Atk."+3','AGI+9','Attack+10',}},
legs={ name="Samnuha Tights", augments={'STR+8','DEX+9','"Dbl.Atk."+3','"Triple Atk."+2',}},
feet={ name="Herculean Boots", augments={'Accuracy+10','"Triple Atk."+4','Attack+15',}},
neck="Asperity Necklace",
waist="Windbuffet Belt +1",
left_ear="Cessance Earring",
right_ear="Suppanomimi",
left_ring="Petrov Ring",
right_ring="Epona's Ring",
back="Rosmerta's cape"}
sets.engaged.Acc = {ammo="Mantoptera Eye",
head={ name="Dampening Tam", augments={'DEX+10','Accuracy+15','Mag. Acc.+15','Quadruple Attack +3',}},
body="Adhemar Jacket",
hands={ name="Leyline Gloves", augments={'Accuracy+14','Mag. Acc.+13','"Mag.Atk.Bns."+13','"Fast Cast"+2',}},
legs={ name="Carmine Cuisses +1", augments={'Accuracy+20','Attack+12','"Dual Wield"+6',}},
feet="Rawhide Boots",
neck="Clotharius Torque",
waist="Kentarch Belt",
left_ear="Zennaroi Earring",
right_ear="Digni. Earring",
left_ring="Epona's Ring",
right_ring="Petrov Ring",
back="Rosmerta's cape"}
sets.self_healing = {ammo="Hydrocera",
head="Telchine cap",
body="Vrikodara Jupon",
hands={ name="Buremte Gloves", augments={'Phys. dmg. taken -2%','Magic dmg. taken -2%','MND+8',}},
legs="Gyve Trousers",
feet={ name="Medium's Sabots", augments={'MP+45','MND+9','"Conserve MP"+5','"Cure" potency +4%',}},
neck="Phalaina Locket",
waist="Chuq'aba belt",
left_ear="Mendi. Earring",
right_ear="Lifestorm Earring",
left_ring="Lebeche Ring",
right_ring="Kunaji Ring",
back="Oretania's Cape"}
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for standard casting events.
-------------------------------------------------------------------------------------------------------------------
-- Set eventArgs.handled to true if we don't want any automatic gear equipping to be done.
-- Set eventArgs.useMidcastGear to true if we want midcast gear equipped on precast.
function job_precast(spell, action, spellMap, eventArgs)
if unbridled_spells:contains(spell.english) and not state.Buff['Unbridled Learning'] then
eventArgs.cancel = true
windower.send_command('@input /ja "Unbridled Learning" <me>; wait 1.5; input /ma "'..spell.name..'" '..spell.target.name)
end
end
-- 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)
-- Add enhancement gear for Chain Affinity, etc.
if spell.skill == 'Blue Magic' then
for buff,active in pairs(state.Buff) do
if active and sets.buff[buff] then
equip(sets.buff[buff])
end
end
if spellMap == 'Healing' and spell.target.type == 'SELF' and sets.self_healing then
equip(sets.self_healing)
end
end
-- If in learning mode, keep on gear intended to help with that, regardless of action.
if state.OffenseMode.value == 'Learning' then
equip(sets.Learning)
end
end
-------------------------------------------------------------------------------------------------------------------
-- Job-specific hooks for non-casting events.
-------------------------------------------------------------------------------------------------------------------
-- Called when a player gains or loses a buff.
-- buff == buff gained or lost
-- gain == true if the buff was gained, false if it was lost.
function job_buff_change(buff, gain)
if state.Buff[buff] ~= nil then
state.Buff[buff] = gain
end
end
-------------------------------------------------------------------------------------------------------------------
-- User code that supplements standard library decisions.
-------------------------------------------------------------------------------------------------------------------
-- Custom spell mapping.
-- Return custom spellMap value that can override the default spell mapping.
-- Don't return anything to allow default spell mapping to be used.
function job_get_spell_map(spell, default_spell_map)
if spell.skill == 'Blue Magic' then
for category,spell_list in pairs(blue_magic_maps) do
if spell_list:contains(spell.english) then
return category
end
end
end
end
-- Modify the default idle set after it was constructed.
function customize_idle_set(idleSet)
if player.mpp < 51 then
set_combine(idleSet, sets.latent_refresh)
end
return idleSet
end
-- Called by the 'update' self-command, for common needs.
-- Set eventArgs.handled to true if we don't want automatic equipping of gear.
function job_update(cmdParams, eventArgs)
update_combat_form()
end
-------------------------------------------------------------------------------------------------------------------
-- Utility functions specific to this job.
-------------------------------------------------------------------------------------------------------------------
function update_combat_form()
-- Check for H2H or single-wielding
if player.equipment.sub == "Genbu's Shield" or player.equipment.sub == 'empty' then
state.CombatForm:reset()
else
state.CombatForm:set('DW')
end
end
-- Select default macro book on initial load or subjob change.
function select_default_macro_book()
-- Default macro set/book
if player.sub_job == 'DNC' then
set_macro_page(5, 4)
else
set_macro_page(5, 4)
end
end
Server: Odin
Game: FFXI
Posts: 177
By Odin.Speedyjim 2016-06-11 18:42:18
Looks like you're using Motenten's LUA's, the most complex LUA's out there, far from basic.
Can just grab any DRK one and add what you need.
By Blazed1979 2016-06-11 18:51:44
Do you have a link to one please?
Bismarck.Speedyjim
Server: Bismarck
Game: FFXI
Posts: 516
By Bismarck.Speedyjim 2016-06-11 19:00:48
Do you have a link to one please? I believed I did, but upon further checking it appears Motenten never made a DRK one. Can peruse the DRK thread for one, I'm sure you can find one there. http://www.ffxiah.com/forum/topic/35174/dont-fear-the-reaper-a-dark-knight-guide/
By Selindrile 2016-06-12 04:33:02
Jim, you may be thinking of mine, I have ones for all the jobs based on Motenten's work, though they're not all up to date, and are probably way too much for what Blazed is looking for.
Server: Siren
Game: FFXI
Posts: 101
By Siren.Bloodlusty 2016-06-12 05:00:54
By Blazed1979 2016-06-12 07:27:17
Yeah I searched Mont's Lua's, no DRK.
I think a member of my LS did the lua that everyone else seems to be using so will just wait for him to get on discord tonight to ask for help. thanks all.
Server: Fenrir
Game: FFXI
Posts: 183
By Fenrir.Brimstonefox 2016-06-13 08:20:52
Ragnarok.Flippant said: »Sorry, was out of town and missed a few posts.
Code add_to_chat(1,"Hello")
add_to_chat:schedule(4,1,"World!")
But be sure to 'require('functions')' at some point in the file.
This sort of worked...the problem is I need it to pause and run the code serially it seems to delay that one command but not everything after it. I suppose I could wrap the logic in if/elseif block and have it block called serialized scheduled functions, but seems like there should be a better way to do this. The logic is basically:
Code if foo
do stuff
delay
end
if bar
do stuff
delay
end
if abc
do stuff
delay
end
and my problem is adding that bar is executing before foo finishes which is my initial problem.
By Selindrile 2016-06-13 18:44:07
Brimstone, coroutine.sleep doesn't work in gearswap that I'm aware of, maybe schedule does, but I've not tried it though I will now after reading the comments, but, here's a couple ideas I've used if these work better for you:
Instead of using a proper delay, use a send_command so you can use windower's wait with a self_command to pick it up:
Code windower.send_command('wait 4;gs c bar')
function job_self_command(commandArgs, eventArgs)
if commandArgs[1] == 'bar' then
if bar then
do stuff
end
end
Use aftercast to check the next part of the command:
Code function job_aftercast(spell, action, spellMap, eventArgs)
if spell.english == 'foo' and not spell.interrupted then
if bar then
do stuff
end
end
end
The third is to write a little clock that checks thing on a list.
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.
|
|