Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- include('how_about_no.lua')
- include('organizer-lib.lua')
- include('no_interruptions.lua')
- include('spam_protection.lua')
- include('spell_stack.lua')
- include('common_commands.lua')
- valid_controllers = alt_names
- --Duration of non JA songs
- songDuration = 250
- --Duration of JA songs
- songDurationJA = 540
- --self_status_fix
- totalSongs = 3
- currentMaxSongs = totalSongs
- dummySongs = T{'Fire Carol II', 'Ice Carol II'}
- threnodies = I{'Ice Threnody', 'Lightning Threnody', 'Earth Threnody', 'Wind Threnody', 'Ice Threnody', 'Light Threnody', 'Dark Threnody', 'Fire Threnody'}
- function get_sets()
- currentThrenody = 'Fire Threnody'
- songMode = 'Gjallarhorn'
- mythicTries = 0
- lastSongs = 0
- lastChat = 0
- doCures = true
- allianceCheck = true
- allianceHeal = false
- autoJA = false
- auto1hr = false
- autoSS = false
- lastx = 0
- lasty = 0
- songs = T{}
- doingSV = false
- replaceSong = "Sentinel's Scherzo"
- dtMode = false
- justUsedJA = false
- send_command('input /macro book 10;')
- if file_exists('gear/'..player.name..'_BRD.lua') then
- include('gear/'..player.name..'_BRD.lua')
- elseif file_exists('gear/'..player.name..'_brd.lua') then
- include('gear/'..player.name..'_brd.lua')
- elseif file_exists('gear/'..player.name:lower()..'_BRD.lua') then
- include('gear/'..player.name:lower()..'_BRD.lua')
- elseif file_exists('gear/'..player.name:lower()..'_brd.lua') then
- include('gear/'..player.name:lower()..'_brd.lua')
- elseif file_exists('gear/'..player.name:upper()..'_BRD.lua') then
- include('gear/'..player.name:upper()..'_BRD.lua')
- elseif file_exists('gear/'..player.name:upper()..'_brd.lua') then
- include('gear/'..player.name:upper()..'_brd.lua')
- elseif file_exists('gear/brd.lua') then
- include('gear/brd.lua')
- elseif file_exists('gear/BRD.lua') then
- include('gear/BRD.lua')
- else
- windower.add_to_chat(028,'Error: Gear file is missing. Please add gear file in /gearswap/data/gear/ named as '..player.name..'_BRD.lua')
- end
- if sets['ExtraSong']['PrecastSet'].range == 'Daurdabla' then
- totalSongs = 4
- end
- currentMaxSongs = totalSongs
- end
- function pretarget(spell)
- local validSpell = true
- --Determine if spell is castable, cancel if not and don't add to spellStack queue
- if spell.target.type == 'SELF' then
- thisTarget = player.name
- if spell.targets['Self'] == false then
- cancel_spell()
- validSpell = false
- end
- elseif spell.target.type == 'PLAYER' then
- thisTarget = spell.target.name
- --Check if the spell target is a party member, and if so make sure the spell is castable on party members, otherwise check if castable on general players
- if checkPartyName(spell.target.name) then
- if spell.targets['Party'] == false then
- cancel_spell()
- validSpell = false
- end
- else
- if spell.targets['Player'] == false then
- cancel_spell()
- validSpell = false
- end
- end
- elseif spell.target.type == 'MONSTER' then
- if spell.target.raw == '<bt>' then
- thisTarget = 'bt'
- else
- thisTarget = 't'
- end
- if spell.targets['Enemy'] == false then
- cancel_spell()
- validSpell = false
- end
- else
- validSpell = false
- end
- if spell.prefix == '/magic' then
- thisPrefix = 'ma'
- elseif spell.prefix == '/weaponskill' then
- thisPrefix = 'ws'
- elseif spell.prefix == '/jobability' then
- thisPrefix = 'ja'
- elseif spell.prefix == '/song' then
- thisPrefix = 'song'
- end if spell.english == 'Horde Lullaby' or spell.english == 'Horde Lullaby II' or spell.english == 'Foe Lullaby' or spell.english == 'Foe Lullaby II' then
- if thisTarget ~= 'bt' and thisTarget ~= 't' then
- thisTarget = 't'
- end
- end
- --Ensure the spell was castable, spellStack has a queue and the spell isn't already in it, if so then add to front of spellStack queue to allow players to add to queue by using macros in emergencies
- if validSpell and #spellStack > 0 and spell.prefix ~= '/item' and not checkInQueue(spell.english,thisTarget,thisPrefix) then
- windower.add_to_chat(050,'Added '..spell.english..' on '..thisTarget..' to front of queue')
- add_to_front(spell.english, thisTarget, false, thisPrefix)
- end
- if spell.english == 'Sneak' and spell.target.name == player.name and player.sub_job == 'DNC' and is_ability_ready('Spectral Jig') then
- cancel_spell()
- windower.send_command('input /ja "Spectral Jig" <me>;')
- end
- end
- function precast(spell,action)
- if check_ready(spell) then
- if spell.type == 'WeaponSkill' then
- if spell.target.distance > 10 or player.tp < 900 then
- cancel_spell()
- return
- end
- if sets[spell.english] then
- if buffactive['Reive Mark'] then
- equip(sets[spell.english],sets['Reive'])
- else
- equip(sets[spell.english])
- end
- end
- windower.add_to_chat(050, '['..spell.name..'] '..spell.target.name..' <'..player.tp..'%>')
- elseif spell.english == "Spectral Jig" and is_ability_ready('Spectral Jig') then
- send_command('cancel 71;')
- elseif spell.type == "JobAbility" then
- if sets[spell.english] then
- equip(sets[spell.english])
- end
- if spell.english == "Clarion Call" then
- currentMaxSongs = totalSongs + 1
- end
- elseif spell.type == "BardSong" then
- if buffactive["clarion call"] then
- currentMaxSongs = totalSongs+1
- end
- if buffactive['pianissimo'] and (spell.english =='Horde Lullaby' or spell.english == 'Horde Lullaby II') then
- send_command('cancel 409;')
- end
- if dummySongs:contains(spell.english) then
- songMode = 'ExtraSong'
- else
- songMode = 'Gjallarhorn'
- end
- if buffactive['Nightingale'] and buffactive['Troubadour'] then
- if spell.english:sub(1,13) == "Mage's Ballad" then
- equip(sets[songMode]['BalladMidcast'])
- elseif spell.english == "Sentinel's Scherzo" then
- equip(sets[songMode]['Scherzo'])
- elseif spell.english == 'Horde Lullaby' or spell.english == 'Horde Lullaby II' then
- equip(sets['Horde Lullaby'])
- elseif spell.english == 'Foe Lullaby' or spell.english == 'Foe Lullaby II' then
- equip(sets['Lullaby'])
- elseif spell.english:sub(1,12) == "Army's Paeon" then
- equip(sets[songMode]['Paeon'])
- else
- equip(sets[songMode]['MidcastSet'])
- end
- else
- equip(sets[songMode]['PrecastSet'])
- end
- elseif spell.type == "WhiteMagic" then
- if player.sub_job == "DNC" and spell.english == 'Sneak' then
- cancel_spell()
- send_command('input /ja "Spectral Jig" <me>;')
- elseif spell.english:sub(1,4) == 'Cure' or spell.english:sub(1,4) == 'Cura' then
- equip(sets['PreCureSet'])
- else
- equip(sets['PrecastSpell'])
- end
- elseif spell.english == "Spectral Jig" and is_ability_ready('Spectral Jig') then
- send_command('cancel 71;')
- end
- spam_protection_on(spell)
- else
- cancel_spell()
- end
- end
- function midcast(spell,action)
- if spell.type == "BardSong" then
- if dummySongs:contains(spell.english) then
- songMode = 'ExtraSong'
- else
- songMode = 'Gjallarhorn'
- end
- if spell.english:sub(1,13) == "Mage's Ballad" then
- equip(sets[songMode]['BalladMidcast'])
- elseif spell.english:sub(-8) == "Madrigal" then
- equip(sets[songMode]['Madrigal'])
- elseif spell.english:sub(-7) == "Prelude" then
- equip(sets[songMode]['Prelude'])
- elseif spell.english == "Sentinel's Scherzo" then
- equip(sets[songMode]['Scherzo'])
- elseif spell.english == 'Horde Lullaby' or spell.english == 'Horde Lullaby II' then
- equip(sets['Horde Lullaby'])
- elseif spell.english == 'Foe Lullaby' or spell.english == 'Foe Lullaby II' then
- equip(sets['Lullaby'])
- elseif spell.english:sub(1,12) == "Army's Paeon" then
- equip(sets[songMode]['Paeon'])
- elseif spell.english == "Maiden's Virelai" or spell.english == 'Pining Nocturne' or spell.english:sub(-5) == 'Elegy' or spell.english:sub(-11) == 'Threnody II' or spell.english:sub(-8) == 'Threnody' or spell.english == 'Magic Finale' or spell.english:sub(0,7) == 'Foe Req' then
- equip(sets['MaccSet'])
- else
- equip(sets[songMode]['MidcastSet'])
- end
- elseif spell.type == "WhiteMagic" then
- if spell.english:sub(1,4) == 'Cure' or spell.english:sub(1,4) == 'Cura' then
- equip(sets['CureSet'])
- else
- equip(sets['PrecastSpell'])
- end
- end
- end
- function aftercast(spell,action)
- if spam_protection_off(spell)then
- if spell.english == 'Troubadour' or spell.english == 'Nightingale' then
- justUsedJA = true
- end
- handle_idle()
- end
- checkAftercast(spell)
- end
- function handle_idle()
- if player.status == 'Engaged' then
- if player.sub_job == 'DNC' or player.sub_job == 'NIN' then
- equip(sets['DWMeleeSet'])
- else
- equip(sets['MeleeSet'])
- end
- elseif player.status == 'Resting' then
- equip(sets['Resting'])
- if world.area == 'NYZUL ISLE' or world.area == 'ALZADAAL UNDERSEA RUINS' or world.area == 'ZHAYOLM REMNANTS' or world.area == 'ARRAPAGO REMNANTS' or world.area == 'BHAFLAU REMNANTS' or world.area == 'SILVER SEA REMNANTS' then
- equip({ring2 = "Balrahn's Ring"})
- end
- else
- if player.mpp > 80 or dtMode then
- equipSet = sets['IdleSet']
- else
- equipSet = sets['IdleRefreshSet']
- if world.area == 'NYZUL ISLE' or world.area == 'ALZADAAL UNDERSEA RUINS' or world.area == 'ZHAYOLM REMNANTS' or world.area == 'ARRAPAGO REMNANTS' or world.area == 'BHAFLAU REMNANTS' or world.area == 'SILVER SEA REMNANTS' then
- equip({ring2 = "Balrahn's Ring"})
- end
- end
- if not dtMode then
- equipSet = set_combine(equipSet, sets['Running'])
- end
- equip(equipSet)
- end
- if buffactive['Reive Mark'] then
- equip(sets['Reive'])
- end
- end
- function filtered_action(spell,action)
- if player.sub_job == "DNC" and spell.english == 'Sneak' then
- cancel_spell()
- send_command('input /ja "Spectral Jig" <me>;')
- end
- end
- function status_change(new,old)
- if check_ready_status()then
- handle_idle(new)
- end
- end
- function buff_change(buff,gain_or_loss)
- if gain_or_loss then
- if buff == 'Aftermath: Lv.3' then
- send_command('timers c "AM3" 180 up "Aftermath"')
- elseif buff == 'Aftermath: Lv.2' then
- send_command('timers c "AM2" 180 up "Aftermath"')
- elseif buff == 'Aftermath: Lv.1' then
- send_command('timers c "AM1" 180 up "Aftermath"')
- end
- if buff == 'weakness' then
- send_command('timers c "Weakness" 300 up "Weakness"')
- end
- else
- if buff == 'Aftermath: Lv.3' then
- send_command('timers d "AM3"')
- elseif buff == 'Aftermath: Lv.2' then
- send_command('timers d "AM2"')
- elseif buff == 'Aftermath: Lv.1' then
- send_command('timers d "AM1"')
- elseif buff == 'encumbrance' then
- windower.send_command('gs c dt_end;')
- end
- if buff == 'Troubadour' or buff == 'Nightingale' then
- justUsedJA = false
- end
- if buff == 'weakness' then
- send_command('timers d "Weakness"')
- end
- end
- end
- function self_command(command)
- if command == 'heal' then
- local j = windower.ffxi.get_party() or {}
- biggestCureNeeded = 0
- playerToCure = ''
- for i,v in pairs(j) do
- if v.hp > 0 and v.hpp > 0 and v.hpp < 100 then
- if (v.hp/((v.hpp)/100))-v.hp > biggestCureNeeded then
- biggestCureNeeded = math.floor((v.hp/((v.hpp)/100))-v.hp)
- playerToCure = v.name
- end
- end
- end
- if buffactive['doom'] then
- send_command('send nekachu //cursna '..player.name..';')
- elseif biggestCureNeeded > 900 then
- send_command('send nekachu //cure5 '..playerToCure..';')
- elseif biggestCureNeeded > 650 then
- send_command('send nekachu //cure4 '..playerToCure..';')
- elseif buffactive['petrification'] then
- send_command('send nekachu //stona '..player.name..';')
- elseif buffactive['curse'] then
- send_command('send nekachu gs c castspell cursna '..player.name:lower()..';')
- elseif buffactive['paralysis'] then
- send_command('send nekachu //paralyna '..player.name:lower()..';')
- elseif buffactive['Max HP Down'] then
- send_command('send nekachu //erase '..player.name:lower()..';')
- elseif biggestCureNeeded > 300 then
- send_command('send nekachu //cure3 '..playerToCure..';')
- elseif buffactive['poison'] then
- send_command('send nekachu //poisona '..player.name:lower()..';')
- elseif buffactive['bind'] or buffactive['weight'] or buffactive['bio'] then
- send_command('send nekachu //erase '..player.name:lower()..';')
- elseif buffactive['Sleep'] then
- send_command('send nekachu //cure '..player.name:lower()..';')
- elseif buffactive['Regen'] == nil then
- send_command('send nekachu //regen4 '..player.name:lower()..';')
- else
- windower.add_to_chat(050,"Nothing to do.")
- end
- elseif command == 'buff' then
- if buffactive['Haste'] == nil then
- send_command('send nekachu //haste '..player.name:lower()..';')
- elseif buffactive['Protect'] == nil then
- send_command('send nekachu //protectrav;')
- elseif buffactive['Shell'] == nil then
- send_command('send nekachu //shellrav;')
- else
- windower.add_to_chat(050,"Nothing to do.")
- end
- elseif command == 'ws' then
- if player.status == 'Engaged' and player.tp >= 1000 then
- send_command('input /ws "Rudra\'s Storm" <t>;')
- end
- elseif command == 'step' and songs['sing'] == false then
- if player.status == 'Engaged' and player.sub_job == 'DNC' then
- send_command('input /ja "Box Step" <t>;')
- end
- elseif command == 'flourish' and songs['sing'] == false then
- if player.status == 'Engaged' and player.sub_job == 'DNC' then
- send_command('input /ja "Violent Flourish" <t>;')
- end
- elseif command:sub(1,12) == 'remove songs' then
- commandSplit = T{}
- command = command:gsub("[%w ]+","%1")
- if #command > 14 then
- command = command:sub(14,#command)
- commandSplit = string.split(command," ")
- local nameToRemove = checkName(commandSplit[#commandSplit])
- if spell_target ~= '' then
- remove_song_by_target(nameToRemove)
- end
- end
- elseif command:sub(1,12) == 'keep singing' then
- commandSplit = T{}
- command = command:gsub("[%w ]+","%1")
- if #command > 14 then
- command = command:sub(14,#command)
- commandSplit = string.split(command," ")
- table.clear(songs)
- songCount = #commandSplit-1
- spell_target = ''
- if check_for_target(commandSplit[#commandSplit]) then
- if commandSplit[#commandSplit] == 'self' then
- spell_target = 'self'
- else
- spell_target = checkName(commandSplit[#commandSplit])
- end
- songCount = songCount - 1
- end
- if spell_target == '' then
- spell_target = player.name
- end
- --Add the command to resing array for this target (only one set of songs to resing per target)
- resingSongs[spell_target] = {
- nextSing = os.clock()+1,
- fails=0,
- songs=command,
- target=spell_target
- }
- end
- elseif command:sub(1,4) == 'sing' then
- commandSplit = T{}
- command = command:gsub("[%w ]+","%1")
- if #command > 6 then
- command = command:sub(6,#command)
- commandSplit = string.split(command," ")
- table.clear(songs)
- doingSV = false
- doingJA = false
- for i=1, #commandSplit, 1 do
- if commandSplit[i] and commandSplit[i]:lower() == 'ja' then
- doingJA = true
- commandSplit:remove(i)
- end
- if commandSplit[i] and commandSplit[i]:lower() == '1hr' then
- doingSV = true
- commandSplit:remove(i)
- end
- end
- songCount = #commandSplit
- spell_target = ''
- if check_for_target(commandSplit[#commandSplit]) then
- if commandSplit[#commandSplit] == 'self' then
- spell_target = 'self'
- else
- spell_target = checkName(commandSplit[#commandSplit])
- end
- songCount = songCount - 1
- end
- if spell_target == '' then
- spell_target = player.name
- end
- if (autoJA or doingJA) and not buffactive['paralysis'] and not buffactive['amnesia'] and not buffactive['impairment'] and is_ability_ready('Troubadour') and is_ability_ready('Nightingale') then
- if (auto1hr or doingSV) and not buffactive['encumbrance'] and is_ability_ready('Soul Voice') and is_ability_ready('Clarion Call') then
- doingSV = true
- doingJA = true
- currentMaxSongs = totalSongs+1
- direct_push_front('Soul Voice', 'ja', player.name, false)
- direct_push_front('Clarion Call', 'ja', player.name, false)
- direct_push_front('Troubadour', 'ja', player.name, false)
- direct_push_front('Nightingale', 'ja', player.name, false)
- elseif is_ability_ready('Marcato') then
- doingJA = true
- direct_push_front('Troubadour', 'ja', player.name, false)
- direct_push_front('Nightingale', 'ja', player.name, false)
- direct_push_front('Marcato', 'ja', player.name, false)
- end
- end
- for i=1, currentMaxSongs, 1 do
- if commandSplit[i] ~= nil then
- if totalSongs == 3 then
- if currentMaxSongs == 3 and i == 3 and songCount > 2 then
- add_to_back(dummySongs[1], spell_target, true, 'song')
- elseif currentMaxSongs == 4 and i == 4 and songCount > 3 then
- add_to_back(dummySongs[1], spell_target, true, 'song')
- end
- elseif totalSongs == 4 then
- if currentMaxSongs == 4 then
- if i == 3 and songCount > 2 then
- add_to_back(dummySongs[1], spell_target, true, 'song')
- elseif i == 4 and songCount > 3 then
- add_to_back(dummySongs[2], spell_target, true, 'song')
- end
- elseif currentMaxSongs == 5 then
- if i == 4 and songCount > 3 then
- add_to_back(dummySongs[1], spell_target, true, 'song')
- elseif i == 5 and songCount > 4 then
- add_to_back(dummySongs[2], spell_target, true, 'song')
- end
- end
- end
- get_song_from_command(commandSplit[i], spell_target)
- end
- end
- --If this command is in the resing array, set the next sing time, and reset fail count to 0
- if type(resingSongs) == 'table' and resingSongs[spell_target] ~= nil then
- if resingSongs[spell_target].songs == command then
- if doingJA or justUsedJA or buffactive['Troubadour'] or buffactive['Nightingale'] then
- resingSongs[spell_target].nextSing = os.clock()+songDurationJA
- --resingSongs[spell_target].nextSing = os.clock()+30
- resingSongs[spell_target].fails = 0
- send_command('timers c "Songs ['..spell_target..']" '..songDurationJA..' up "Advancing March"')
- else
- resingSongs[spell_target].nextSing = os.clock()+songDuration
- --resingSongs[spell_target].nextSing = os.clock()+30
- resingSongs[spell_target].fails = 0
- send_command('timers c "Songs ['..spell_target..']" '..songDuration..' up "Advancing March"')
- end
- end
- else
- windower.add_to_chat(158,'Songs on '..spell_target..' added to queue')
- end
- if (doingSV or buffactive['Soul Voice']) and songs:contains("Victory March") and songs:contains("Advancing March") then
- --See what we can replace Advancing March with
- if songs:contains("Valor Minuet V") or songs:contains("Valor Minuet IV") or songs:contains("Valor Minuet III") or songs:contains("Valor Minuet II") or songs:contains("Valor Minuet") then
- --Melee songs, see if 4 3 2 or 1 are set
- if not songs:contains("Valor Minuet V") then
- replaceSong = 'Valor Minuet V'
- elseif not songs:contains("Valor Minuet IV") then
- replaceSong = 'Valor Minuet IV'
- elseif not songs:contains("Valor Minuet III") then
- replaceSong = 'Valor Minuet III'
- elseif not songs:contains("Valor Minuet II") then
- replaceSong = 'Valor Minuet II'
- elseif not songs:contains("Valor Minuet") then
- replaceSong = 'Valor Minuet'
- else
- replaceSong = "Sentinel's Scherzo"
- end
- elseif songs:contains("Sword Madrigal") or songs:contains("Blade Madrigal") then
- if songs:contains("Sword Madrigal") and songs:contains("Blade Madrigal") then
- --Both acc songs on, throw on minuets
- if not songs:contains("Valor Minuet V") then
- replaceSong = 'Valor Minuet V'
- elseif not songs:contains("Valor Minuet IV") then
- replaceSong = 'Valor Minuet IV'
- elseif not songs:contains("Valor Minuet III") then
- replaceSong = 'Valor Minuet III'
- elseif not songs:contains("Valor Minuet II") then
- replaceSong = 'Valor Minuet II'
- elseif not songs:contains("Valor Minuet") then
- replaceSong = 'Valor Minuet'
- end
- elseif songs:contains("Sword Madrigal") and not songs:contains("Blade Madrigal") then
- replaceSong = 'Blade Madrigal'
- elseif songs:contains("Blade Madrigal") and not songs:contains("Sword Madrigal") then
- replaceSong = 'Sword Madrigal'
- else
- replaceSong = "Sentinel's Scherzo"
- end
- elseif songs:contains("Mage's Ballad III") or songs:contains("Mage's Ballad II") or songs:contains("Mage's Ballad") then
- --Mage songs, see if all ballads are on
- if not songs:contains("Mage's Ballad III") then
- replaceSong = "Mage's Ballad III"
- elseif not songs:contains("Mage's Ballad II") then
- replaceSong = "Mage's Ballad II"
- elseif not songs:contains("Mage's Ballad") then
- replaceSong = "Mage's Ballad"
- else
- replaceSong = "Sentinel's Scherzo"
- end
- elseif songs:contains("Knight's Minne V") and songs:contains("Knight's Minne IV") and songs:contains("Knight's Minne III") and songs:contains("Knight's Minne II") and songs:contains("Knight's Minne") then
- --Tank songs, see if 4 3 2 or 1 are set
- if not songs:contains("Knight's Minne V") then
- replaceSong = "Knight's Minne V"
- elseif not songs:contains("Knight's Minne IV") then
- replaceSong = "Knight's Minne IV"
- elseif not songs:contains("Knight's Minne III") then
- replaceSong = "Knight's Minne III"
- elseif not songs:contains("Knight's Minne II") then
- replaceSong = "Knight's Minne II"
- elseif not songs:contains("Knight's Minne") then
- replaceSong = "Knight's Minne"
- else
- replaceSong = "Sentinel's Scherzo"
- end
- end
- if replaceSong ~= nil then
- spell_stack_replace('Advancing March',replaceSong)
- end
- end
- showArrayContents()
- end
- elseif command:lower() == '3song' then
- currentMaxSongs = totalSongs
- windower.add_to_chat(050,"3 song mode.")
- elseif command:lower() == '4song' then
- currentMaxSongs = totalSongs+1
- windower.add_to_chat(050,"4 song mode.")
- elseif command == 'finale' then
- if player.sub_job == "DNC" then
- threnodies:next()
- send_command('input /ma "'..threnodies:current()..'" <bt>;')
- else
- send_command('input /ma "Magic Finale" <bt>;')
- end
- elseif command == 'requiem' then
- send_command('input /ma "Foe Requiem VII" <bt>;wait 4;input /ma "Carnage Elegy" <bt>;')
- elseif command == 'melee' then
- if player.sub_job == "DNC" then
- equip(sets['dualWield'])
- windower.add_to_chat(050,"Dual Wield On")
- else
- equip(sets['dagger'])
- windower.add_to_chat(050,"Dagger On")
- end
- if player.sub_job == "DNC" and player.equipment.main == 'Taming Sari' and player.equipment.sub == 'Atoyac' then
- disable('main','sub')
- mythicTries = 0
- windower.add_to_chat(167,"Melee [ON]")
- elseif player.equipment.main == 'Taming Sari' and player.equipment.sub == "Genbu's Shield" then
- disable('main','sub')
- mythicTries = 0
- windower.add_to_chat(167,"Melee [ON]")
- elseif mythicTries > 10 then
- windower.add_to_chat(050,"Melee couldn't be equipped at this time.")
- else
- enable('main','sub')
- mythicTries = mythicTries +1
- send_command('wait 1;gs c melee;')
- end
- elseif command == 'off' then
- enable('main','sub')
- windower.add_to_chat(050,"Melee Mode [OFF]")
- equip(sets[idleSet])
- elseif command == 'ja' then
- if not buffactive['paralysis'] and not buffactive['amnesia'] and not buffactive['impairment'] and is_ability_ready('Troubadour') and is_ability_ready('Nightingale') and is_ability_ready('Marcato') then
- if world.area:find("San d'Oria") or world.area:find("Bastok") or world.area:find("Windurst") or world.area:find("Jeuno") or world.area:find("Adoulin") or world.area == "Ru'Lude Gardens" or world.area == 'Al Zahbi' or world.area == "Aht Urhgan Whitegate" or world.area == "Tavnazian Safehold" then
- else
- direct_push_front('Troubadour', 'ja', player.name, false)
- direct_push_front('Nightingale', 'ja', player.name, false)
- direct_push_front('Marcato', 'ja', player.name, false)
- end
- else
- if buffactive['paralysis'] then
- send_command('input /p Paralyzed, not using JA')
- elseif buffactive['impairment'] then
- send_command("input /p JA Locked, can't use JA")
- elseif buffactive['amnesia'] then
- send_command("input /p Amnesia, can't use JA")
- else
- send_command("input /p JA not ready")
- end
- end
- elseif command == 'sneak' then
- send_command('input /ma "Sneak" <me>')
- elseif command == 'invisible' then
- send_command('input /ma "Invisible" <me>')
- elseif command == 'tank' then
- if not dtMode then
- dtMode = true
- windower.add_to_chat(028, "Idle DT [ON]")
- else
- dtMode = false
- windower.add_to_chat(028, "Idle DT [OFF]")
- end
- handle_idle()
- elseif command == 'levi' then
- dtMode = true
- autoJA = true
- autoSS = true
- resingSongs['Mazuki'] = {
- nextSing = os.clock()+1,
- fails=0,
- songs='scherzo march march Mazuki',
- target='Mazuki'
- }
- resingSongs['Nekachu'] = {
- nextSing = os.clock()+15,
- fails=0,
- songs='bal Nekachu',
- target='Nekachu'
- }
- resingSongs['Norzu'] = {
- nextSing = os.clock()+20,
- fails=0,
- songs='bal Norzu',
- target='Norzu'
- }
- resingSongs['self'] = {
- nextSing = os.clock()+25,
- fails=0,
- songs='bal self',
- target='self'
- }
- elseif command == 'ambu' then
- dtMode = false
- autoJA = true
- auto1hr = true
- autoSS = false
- resingSongs['Mazuki'] = {
- nextSing = os.clock()+1,
- fails=0,
- songs='int bal bal march Mazuki',
- target='Mazuki'
- }
- resingSongs['Ulor'] = {
- nextSing = os.clock()+13,
- fails=0,
- songs='scherzo march bal march Ulor',
- target='Ulor'
- }
- elseif command == 'ambu2' then
- dtMode = true
- autoJA = true
- auto1hr = true
- autoSS = false
- resingSongs['Mazuki'] = {
- nextSing = os.clock()+1,
- fails=0,
- songs='bal bal march bal Mazuki',
- target='Mazuki'
- }
- resingSongs['Miang'] = {
- nextSing = os.clock()+13,
- fails=0,
- songs='mad march march min Miang',
- target='Miang'
- }
- resingSongs['Ulor'] = {
- nextSing = os.clock()+26,
- fails=0,
- songs='mad march march min Ulor',
- target='Ulor'
- }
- elseif execute_common_command(command) then
- --done
- elseif stack_command(command) then
- --done
- end
- end
- function check_if_songs_contains_carols()
- end
- function handle_ping()
- if buffactive['petrification'] and os.clock()-lastChat > 10 then
- send_command('input /p stoned')
- lastChat = os.clock()
- elseif buffactive['sleep'] and os.clock()-lastChat > 10 then
- send_command('input /p zzz')
- lastChat = os.clock()
- elseif buffactive['silence'] and os.clock()-lastChat > 2 then
- send_command('input /item "Echo Drops" <me>;')
- lastChat = os.clock()
- elseif (buffactive['doom'] or buffactive['curse']) and os.clock()-lastChat > 2 then
- send_command('input /item "Holy Water" <me>;')
- lastChat = os.clock()
- end
- if check_ready_silent() and player.x == lastx and player.y == lasty then
- if player.sub_job_level > 0 then
- if player.sub_job == 'WHM' then
- if not buffactive['reraise'] and recastData[spellIDs['Reraise']] == 0 and player.mp > spellCosts['Reraise'] then
- direct_push('Reraise', 'ma', player.name, true)
- end
- if autoSS and not buffactive['stoneskin'] and recastData[spellIDs['Stoneskin']] == 0 and player.mp > spellCosts['Stoneskin'] then
- direct_push('Stoneskin', 'ma', player.name, true)
- end
- if autoBlink and not buffactive['Blink'] and recastData[spellIDs['Blink']] == 0 and player.mp > spellCosts['Blink'] then
- direct_push('Blink', 'ma', player.name, true)
- end
- if autoAquaveil and not buffactive['Aquaveil'] and recastData[spellIDs['Aquaveil']] == 0 and player.mp > spellCosts['Aquaveil'] then
- direct_push('Aquaveil', 'ma', player.name, true)
- end
- if buffactive['paralysis'] then
- direct_push('Paralyna', 'ma', player.name, true)
- end
- if buffactive['bind'] or buffactive['weight'] or buffactive['slow'] then
- direct_push('Erase', 'ma', player.name, true)
- end
- if buffactive['poison'] then
- direct_push('Poisona', 'ma', player.name, true)
- end
- if player.max_hp-player.hp > 600 and recastData[spellIDs['Cure IV']] == 0 and player.mp > spellCosts['Cure IV'] then
- direct_push_front('Cure IV', 'ma', player.name, true)
- end
- local testhp = player.max_hp-player.hp
- elseif player.sub_job == 'RDM' then
- if autoSS and not buffactive['stoneskin'] and recastData[spellIDs['Stoneskin']] == 0 and player.mp > spellCosts['Stoneskin'] then
- direct_push('Stoneskin', 'ma', player.name, true)
- end
- if autoBlink and not buffactive['Blink'] and recastData[spellIDs['Blink']] == 0 and player.mp > spellCosts['Blink'] then
- direct_push('Blink', 'ma', player.name, true)
- end
- if autoAquaveil and not buffactive['Aquaveil'] and recastData[spellIDs['Aquaveil']] == 0 and player.mp > spellCosts['Aquaveil'] then
- direct_push('Aquaveil', 'ma', player.name, true)
- end
- if not buffactive['weakness'] and player.mp < 200 and player.hp > 1000 and is_ability_ready('Convert') then
- direct_push('Convert', 'ja', player.name, true)
- end
- if not buffactive['refresh'] and recastData[spellIDs['Refresh']] == 0 and player.mp > spellCosts['Refresh'] then
- direct_push('Refresh', 'ma', player.name, true)
- end
- if autoPhalanx and not buffactive['Phalanx'] and recastData[spellIDs['Phalanx']] == 0 and player.mp > spellCosts['Phalanx'] then
- direct_push('Phalanx', 'ma', player.name, true)
- end
- if player.max_hp-player.hp > 600 and recastData[spellIDs['Cure IV']] == 0 and player.mp > spellCosts['Cure IV'] then
- direct_push_front('Cure IV', 'ma', player.name, true)
- end
- elseif player.sub_job == 'NIN' then
- if not buffactive['Copy Image (2)'] and not buffactive['Copy Image (3)'] and not buffactive['Copy Image (4)'] then
- if is_spell_ready('Utsusemi: Ni') then
- direct_push_front('Utsusemi: Ni', 'ma', player.name, false)
- elseif is_spell_ready('Utsusemi: Ichi') then
- direct_push_front('Utsusemi: Ichi', 'ma', player.name, false)
- end
- end
- end
- end
- if doCures then
- cure_process()
- end
- check_auto_spell()
- check_songs()
- handleSpareTime()
- else
- if player.hp == 0 then
- clear_spell_stack()
- end
- lastx = player.x
- lasty = player.y
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement