Advertisement
FalownPSA

Faloun_PUP

Nov 6th, 2015
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 20.46 KB | None | 0 0
  1. -------------------------------------------------------------------------------------------------------------------
  2. -- Setup functions for this job.  Generally should not be modified.
  3. -------------------------------------------------------------------------------------------------------------------
  4.  
  5. include('organizer-lib')
  6. -- Initialization function for this job file.
  7. function get_sets()
  8.     mote_include_version = 2
  9.  
  10.     -- Load and initialize the include file.
  11.     include('Mote-Include.lua')
  12. end
  13.  
  14. Burden = 0
  15. BurdenLimit = 30+50
  16. Mane = {"Wind", "Light", "Thunder"}
  17. ManeRound = 1
  18.  
  19. TypeM = S{"Fire", "Water", "Earth", "Wind", "Dark", "Light", "Ice", "Thunder" }
  20.  
  21. Colors = {}
  22. Colors["Fire"] = "\\cs(102, 0, 0)"
  23. Colors["Water"] = "\\cs(0, 51, 102)"
  24. Colors["Wind"] = "\\cs(51, 102, 0)"
  25. Colors["Dark"] = "\\cs(0, 0, 0)"
  26. Colors["Light"] = "\\cs(255, 255, 255)"
  27. Colors["Earth"] = "\\cs(139, 69, 19)"
  28. Colors["Ice"] = "\\cs(0, 204, 204)"
  29. Colors["Thunder"] = "\\cs(51, 0, 102)"
  30.  
  31. tb_name = "puphelp"
  32. visible = true
  33. textinbox = ''
  34.  
  35.     textinbox = textinbox..' \\cs(0, 0, 0) Maneuvers :\\cr '..Colors[Mane[1]]..Mane[1]..'\\cr-'..Colors[Mane[2]]..Mane[2]..'\\cr-'..Colors[Mane[3]]..Mane[3]..' \\cr \n'
  36.     textinbox = textinbox..' \\cs(0, 0, 0) Burden : '..Burden..'('..BurdenLimit..')\\cr \n'
  37.    
  38.    
  39.  
  40.     windower.text.create(tb_name)
  41.     windower.text.set_location(tb_name, 700, 150)
  42.     windower.text.set_bg_color(tb_name, 200, 96, 96, 96)
  43.     windower.text.set_color(tb_name, 255, 147, 161, 161)
  44.     windower.text.set_font(tb_name, "Arial")
  45.     windower.text.set_font_size(tb_name, 10)
  46.     windower.text.set_bold(tb_name, true)
  47.     windower.text.set_italic(tb_name, false)
  48.     windower.text.set_text(tb_name, textinbox)
  49.     windower.text.set_bg_visibility(tb_name, visible)
  50.  
  51.     local player = windower.ffxi.get_player()
  52.  
  53. function refresh()
  54.     textinbox = ''
  55.    
  56.     -- GEO SPELL
  57.     if (pet) then
  58.     textinbox = textinbox..' \\cs(0, 0, 0) '..pet.name..' \n- HP :'..pet.hp..'/'..pet.max_hp..' \n- MP : '..pet.mp..'/'..pet.max_mp..' \n- TP : '..tostring(pet.tp)..' \\cr \n'
  59.     end
  60.     textinbox = textinbox..' \\cs(0, 0, 0) Maneuvers :\\cr '..Colors[Mane[1]]..Mane[1]..'\\cr-'..Colors[Mane[2]]..Mane[2]..'\\cr-'..Colors[Mane[3]]..Mane[3]..' \\cr \n'
  61.     if (pet) and Burden <= BurdenLimit then
  62.     textinbox = textinbox..' \\cs(0, 0, 0) Burden : '..Burden..'('..BurdenLimit..')\\cr \n'
  63.     elseif (pet) and Burden > BurdenLimit then
  64.     textinbox = textinbox..' \\cs(255, 0, 0) Burden : '..Burden..'('..BurdenLimit..') - COOLDOWN ASAP\\cr \n'
  65.     risk = Burden - BurdenLimit + 5
  66.     textinbox = textinbox..' \\cs(255, 0, 0) Overload risk estimated = '..risk..'%\\cr \n'
  67.     end
  68.  
  69.     windower.text.set_text(tb_name, textinbox)
  70. end
  71.    
  72. -- Setup vars that are user-independent.  state.Buff vars initialized here will automatically be tracked.
  73. function job_setup()
  74.     -- List of pet weaponskills to check for
  75.     petWeaponskills = S{"Slapstick", "Knockout", "Magic Mortar",
  76.         "Chimera Ripper", "String Clipper",  "Cannibal Blade", "Bone Crusher", "String Shredder",
  77.         "Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  78.    
  79.     -- Map automaton heads to combat roles
  80.     petModes = {
  81.         ['Harlequin Head'] = 'Melee',
  82.         ['Sharpshot Head'] = 'Ranged',
  83.         ['Valoredge Head'] = 'Tank',
  84.         ['Stormwaker Head'] = 'Magic',
  85.         ['Soulsoother Head'] = 'Heal',
  86.         ['Spiritreaver Head'] = 'Nuke'
  87.         }
  88.  
  89.     -- Subset of modes that use magic
  90.     magicPetModes = S{'Nuke','Heal','Magic'}
  91.    
  92.     -- Var to track the current pet mode.
  93.     state.PetMode = M{['description']='Pet Mode', 'None', 'Melee', 'Ranged', 'Tank', 'Magic', 'Heal', 'Nuke'}
  94. end
  95.  
  96. -------------------------------------------------------------------------------------------------------------------
  97. -- User setup functions for this job.  Recommend that these be overridden in a sidecar file.
  98. -------------------------------------------------------------------------------------------------------------------
  99.  
  100. -- Setup vars that are user-dependent.  Can override this function in a sidecar file.
  101. function user_setup()
  102.     state.OffenseMode:options('Normal', 'Acc', 'Fodder')
  103.     state.HybridMode:options('Normal', 'DT')
  104.     state.WeaponskillMode:options('Normal', 'Acc', 'Fodder')
  105.     state.PhysicalDefenseMode:options('PDT', 'Evasion')
  106.  
  107.     -- Default maneuvers 1, 2, 3 and 4 for each pet mode.
  108.     defaultManeuvers = {
  109.         ['Melee'] = {'Fire Maneuver', 'Thunder Maneuver', 'Wind Maneuver', 'Light Maneuver'},
  110.         ['Ranged'] = {'Wind Maneuver', 'Fire Maneuver', 'Thunder Maneuver', 'Light Maneuver'},
  111.         ['Tank'] = {'Earth Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Wind Maneuver'},
  112.         ['Magic'] = {'Ice Maneuver', 'Light Maneuver', 'Dark Maneuver', 'Earth Maneuver'},
  113.         ['Heal'] = {'Light Maneuver', 'Dark Maneuver', 'Water Maneuver', 'Earth Maneuver'},
  114.         ['Nuke'] = {'Ice Maneuver', 'Dark Maneuver', 'Light Maneuver', 'Earth Maneuver'}
  115.     }
  116.  
  117.     update_pet_mode()
  118.     select_default_macro_book()
  119. end
  120.  
  121.  
  122. -- Define sets used by this job file.
  123. function init_gear_sets()
  124.    
  125.     -- Precast Sets
  126.  
  127.     -- Fast cast sets for spells
  128.     sets.precast.FC = {head="Haruspex Hat",ear2="Loquacious Earring",hands="Thaumas Gloves"}
  129.  
  130.     sets.precast.FC.Utsusemi = set_combine(sets.precast.FC, {neck="Magoraga Beads"})
  131.  
  132.    
  133.     -- Precast sets to enhance JAs
  134.     sets.precast.JA['Tactical Switch'] = {feet="Cirque Scarpe +2"}
  135.    
  136.     sets.precast.JA['Repair'] = {feet="Foire Babouches"}
  137.  
  138.     sets.precast.JA.Maneuver = {neck="Buffoon's Collar",body="Karagoz Farsetto",hands="Foire Dastanas",back="Dispersal Mantle", ear1="Burana Earring"}
  139.  
  140.  
  141.  
  142.     -- Waltz set (chr and vit)
  143.     sets.precast.Waltz = {
  144.         head="Whirlpool Mask",ear1="Roundel Earring",
  145.         body="Otronif Harness +1",hands="Otronif Gloves",ring1="Spiral Ring",
  146.         back="Iximulew Cape",legs="Nahtirah Trousers",feet="Thurandaut Boots +1"}
  147.        
  148.     -- Don't need any special gear for Healing Waltz.
  149.     sets.precast.Waltz['Healing Waltz'] = {}
  150.  
  151.        
  152.     -- Weaponskill sets
  153.     -- Default set for any weaponskill that isn't any more specifically defined
  154.     sets.precast.WS = {
  155.         head="Lilitu Headpiece",neck="Fotia Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  156.         body="Samnuha Coat",hands="Taeon Gloves",ring1="Ifrit Ring",ring2="Ifrit Ring",
  157.         back="Dispersal Mantle",waist="Fotia Belt",legs="Samnuha Tights",feet="Taeon Boots"}
  158.  
  159.     -- Specific weaponskill sets.  Uses the base set if an appropriate WSMod version isn't found.
  160.     sets.precast.WS['Stringing Pummel'] = sets.precast.WS
  161.     sets.precast.WS['Stringing Pummel'].Mod = set_combine(sets.precast.WS['Stringing Pummel'], {legs="Nahtirah Trousers"})
  162.  
  163.     sets.precast.WS['Victory Smite'] = sets.precast.WS
  164.  
  165.     sets.precast.WS['Shijin Spiral'] = sets.precast.WS
  166.  
  167.    
  168.     -- Midcast Sets
  169.  
  170.     sets.midcast.FastRecast = {
  171.         head="Haruspex Hat",ear2="Loquacious Earring",
  172.         body="Otronif Harness +1",hands="Regimen Mittens",
  173.         legs="Manibozho Brais",feet="Otronif Boots +1"}
  174.        
  175.  
  176.     -- Midcast sets for pet actions
  177.     sets.midcast.Pet.Cure = {legs="Foire Churidars"}
  178.  
  179.     sets.midcast.Pet['Elemental Magic'] = {feet="Naga Kyahan", ear1="Burana Earring", ear2="Cirque Earring"}
  180.  
  181.     sets.midcast.Pet.WeaponSkill = {head="Karagoz Capello +1", hands="Karagoz Guanti +1", legs="Kara. Pantaloni +1", feet="Naga Kyahan"}
  182.  
  183.    
  184.     -- Sets to return to when not performing an action.
  185.    
  186.     -- Resting sets
  187.     sets.resting = {head="Pitre Taj",neck="Wiglen Gorget",
  188.         ring1="Sheltered Ring",ring2="Paguroidea Ring"}
  189.    
  190.  
  191.     -- Idle sets
  192.  
  193.     sets.idle = {range="Divinator",
  194.         head="Pitre Taj",neck="Wiglen Gorget",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  195.         body="Pitre Tobe +1",hands="Regimen Mittens",ring1="Sheltered Ring",ring2="Paguroidea Ring",
  196.         back="Mecisto. Mantle",waist="Hurch'lan Sash",legs="Foire Churidars",feet="Hermes' Sandals"}
  197.  
  198.     sets.idle.Town = set_combine(sets.idle, {main="Tinhaspa"})
  199.  
  200.     -- Set for idle while pet is out (eg: pet regen gear)
  201.     sets.idle.Pet = sets.idle
  202.  
  203.     -- Idle sets to wear while pet is engaged
  204.     sets.idle.Pet.Engaged = {
  205.         head="Foire Taj",neck="Wiglen Gorget",ear1="Burana Earring",ear2="Domes. Earring",
  206.         body="Rawhide Vest",hands="Regimen Mittens",ring1="Sheltered Ring",ring2="Paguroidea Ring",
  207.         back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Kara. Pantaloni +1",feet="Rawhide Boots"}
  208.  
  209.     sets.idle.Pet.Engaged.Ranged = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1"})
  210.  
  211.     sets.idle.Pet.Engaged.Nuke = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1"})
  212.  
  213.     sets.idle.Pet.Engaged.Magic = set_combine(sets.idle.Pet.Engaged, {legs="Kara. Pantaloni +1",feet="Cirque Scarpe +2"})
  214.  
  215.  
  216.     -- Defense sets
  217.  
  218.     sets.defense.Evasion = {
  219.         head="Whirlpool Mask",neck="Twilight Torque",
  220.         body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2="Beeline Ring",
  221.         back="Ik Cape",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
  222.  
  223.     sets.defense.PDT = {
  224.         head="Whirlpool Mask",neck="Twilight Torque",
  225.         body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2=gear.DarkRing.physical,
  226.         back="Shadow Mantle",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
  227.  
  228.     sets.defense.MDT = {
  229.         head="Whirlpool Mask",neck="Twilight Torque",
  230.         body="Otronif Harness +1",hands="Otronif Gloves",ring1="Defending Ring",ring2="Shadow Ring",
  231.         back="Tuilha Cape",waist="Hurch'lan Sash",legs="Nahtirah Trousers",feet="Otronif Boots +1"}
  232.  
  233.     sets.Kiting = {feet="Hermes' Sandals"}
  234.  
  235.     -- Engaged sets
  236.  
  237.     -- Variations for TP weapon and (optional) offense/defense modes.  Code will fall back on previous
  238.     -- sets if more refined versions aren't defined.
  239.     -- If you create a set with both offense and defense modes, the offense mode should be first.
  240.     -- EG: sets.engaged.Dagger.Accuracy.Evasion
  241.    
  242.     -- Normal melee group
  243.     sets.engaged = {
  244.         head="Karagoz Capello +1",neck="Asperity Necklace",ear1="Burana Earring",ear2="Domes. Earring",
  245.         body="Rawhide Vest",hands="Taeon Gloves",ring1="Petrov Ring",ring2="Epona's Ring",
  246.         back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Samnuha Tights",feet="Rawhide Boots"}
  247.     sets.engaged.Acc = {
  248.         head="Whirlpool Mask",neck="Ej Necklace",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  249.         body="Qaaxo Harness",hands="Otronif Gloves",ring1="Rajas Ring",ring2="Epona's Ring",
  250.         back="Dispersal Mantle",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
  251.     sets.engaged.DT = {
  252.         head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  253.         body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Epona's Ring",
  254.         back="Iximulew Cape",waist="Windbuffet Belt",legs="Manibozho Brais",feet="Otronif Boots +1"}
  255.     sets.engaged.Acc.DT = {
  256.         head="Whirlpool Mask",neck="Twilight Torque",ear1="Bladeborn Earring",ear2="Steelflash Earring",
  257.         body="Otronif Harness +1",hands="Regimen Mittens",ring1="Defending Ring",ring2="Beeline Ring",
  258.         back="Iximulew Cape",waist="Hurch'lan Sash",legs="Manibozho Brais",feet="Otronif Boots +1"}
  259. end
  260.  
  261.  
  262. -------------------------------------------------------------------------------------------------------------------
  263. -- Job-specific hooks for standard casting events.
  264. -------------------------------------------------------------------------------------------------------------------
  265.  
  266. -- Called when pet is about to perform an action
  267. function job_pet_midcast(spell, action, spellMap, eventArgs)
  268.     if petWeaponskills:contains(spell.english) then
  269.         classes.CustomClass = "Weaponskill"
  270.     end
  271. end
  272.  
  273. autos= false
  274.  
  275. -------------------------------------------------------------------------------------------------------------------
  276. -- Job-specific hooks for non-casting events.
  277. -------------------------------------------------------------------------------------------------------------------
  278.  
  279. -- Called when a player gains or loses a buff.
  280. -- buff == buff gained or lost
  281. -- gain == true if the buff was gained, false if it was lost.
  282. function job_buff_change(buff, gain)
  283.  
  284. end
  285.  
  286. -- Called when a player gains or loses a pet.
  287. -- pet == pet gained or lost
  288. -- gain == true if the pet was gained, false if it was lost.
  289. function job_pet_change(pet, gain)
  290.     update_pet_mode()
  291. end
  292.  
  293. -- Called when the pet's status changes.
  294. function job_pet_status_change(newStatus, oldStatus)
  295.     if newStatus == 'Engaged' then
  296.         display_pet_status()
  297.     end
  298. end
  299.  
  300.  
  301. -------------------------------------------------------------------------------------------------------------------
  302. -- User code that supplements standard library decisions.
  303. -------------------------------------------------------------------------------------------------------------------
  304.  
  305. -- Called by the 'update' self-command, for common needs.
  306. -- Set eventArgs.handled to true if we don't want automatic equipping of gear.
  307. function job_update(cmdParams, eventArgs)
  308.     update_pet_mode()
  309. end
  310.  
  311.  
  312. -- Set eventArgs.handled to true if we don't want the automatic display to be run.
  313. function display_current_job_state(eventArgs)
  314.     display_pet_status()
  315. end
  316.  
  317.  
  318. -------------------------------------------------------------------------------------------------------------------
  319. -- User self-commands.
  320. -------------------------------------------------------------------------------------------------------------------
  321.  
  322. -- Called for custom player commands.
  323. function job_self_command(cmdParams, eventArgs)
  324.     if cmdParams[1] == 'maneuver' then
  325.         if pet.isvalid then
  326.             local man = defaultManeuvers[state.PetMode.value]
  327.             if man and tonumber(cmdParams[2]) then
  328.                 man = man[tonumber(cmdParams[2])]
  329.             end
  330.  
  331.             if man then
  332.                 send_command('input /pet "'..man..'" <me>')
  333.             end
  334.         else
  335.             add_to_chat(123,'No valid pet.')
  336.         end
  337.     end
  338. end
  339.  
  340.  
  341. -------------------------------------------------------------------------------------------------------------------
  342. -- Utility functions specific to this job.
  343. -------------------------------------------------------------------------------------------------------------------
  344.  
  345. -- Get the pet mode value based on the equipped head of the automaton.
  346. -- Returns nil if pet is not valid.
  347. function get_pet_mode()
  348.     if pet.isvalid then
  349.         return petModes[pet.head] or 'None'
  350.     else
  351.         return 'None'
  352.     end
  353. end
  354.  
  355. -- Update state.PetMode, as well as functions that use it for set determination.
  356. function update_pet_mode()
  357.     state.PetMode:set(get_pet_mode())
  358.     update_custom_groups()
  359. end
  360.  
  361. -- Update custom groups based on the current pet.
  362. function update_custom_groups()
  363.     classes.CustomIdleGroups:clear()
  364.     if pet.isvalid then
  365.         classes.CustomIdleGroups:append(state.PetMode.value)
  366.     end
  367. end
  368.  
  369. -- Display current pet status.
  370. function display_pet_status()
  371.     if pet.isvalid then
  372.         local petInfoString = pet.name..' ['..pet.head..']: '..tostring(pet.status)..'  TP='..tostring(pet.tp)..'  HP%='..tostring(pet.hpp)
  373.        
  374.         if magicPetModes:contains(state.PetMode.value) then
  375.             petInfoString = petInfoString..'  MP%='..tostring(pet.mpp)
  376.         end
  377.         add_to_chat(122,petInfoString)
  378.     end
  379. end
  380.  
  381. -- Select default macro book on initial load or subjob change.
  382. function select_default_macro_book()
  383.     -- Default macro set/book
  384.     if player.sub_job == 'DNC' then
  385.         set_macro_page(2, 9)
  386.     elseif player.sub_job == 'NIN' then
  387.         set_macro_page(3, 9)
  388.     elseif player.sub_job == 'THF' then
  389.         set_macro_page(4, 9)
  390.     else
  391.         set_macro_page(1, 9)
  392.     end
  393. end
  394.  
  395. function job_precast(spell, action, spellMap, eventArgs)
  396.     if string.find(spell.english,'Maneuver') then
  397.         if spell.english ~= Mane[ManeRound]..' Maneuver' and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
  398.             cancel_spell()
  399.             send_command('input /ja "'..Mane[ManeRound]..' Maneuver" <me>')
  400.         else
  401.             return
  402.         end
  403.     end
  404. end
  405.  
  406. function job_aftercast(spell, action, spellMap, eventArgs)
  407.     if string.find(spell.english,'Maneuver') then
  408.         if ManeRound == 1 then
  409.             ManeRound = 2
  410.         elseif ManeRound == 2 then
  411.             ManeRound = 3
  412.         else
  413.             ManeRound = 1
  414.         end
  415.         Burden = Burden +15
  416.     elseif spell.english == "Cooldown" then
  417.         Burden = round(Burden/2)
  418.     end
  419. end
  420.  
  421. fps = 1
  422. sec = 0
  423.  
  424. oldtiming = os.time()
  425.  
  426. windower.register_event('prerender', function()
  427.  
  428.     if fps < 50 then
  429.         fps = fps +1
  430.     else
  431.         fps = 1
  432.     end
  433.    
  434.     if fps == 1 then
  435.         timing = os.time()
  436.        
  437.         if(timing-oldtiming > 3) then
  438.             if Burden > 0 then
  439.                 Burden = Burden -1
  440.             end
  441.             oldtiming = os.time()
  442.         end
  443.        
  444.         --- AUTOMANEUVER
  445.         --if not buffactive[Mane[1]..' Maneuver'] and autos then
  446.         --  add_to_chat(204,"Maneuver lost")
  447.         --  send_command('input /ja "Fire Maneuver" <me>')
  448.         --elseif not buffactive[Mane[2]..' Maneuver'] and autos then
  449.         --  add_to_chat(204,"Maneuver lost")
  450.         --  send_command('input /ja "Fire Maneuver" <me>')
  451.         --elseif not buffactive[Mane[2]..' Maneuver'] and autos then
  452.         --  add_to_chat(204,"Maneuver lost")
  453.         --  send_command('input /ja "Fire Maneuver" <me>')
  454.         --end
  455.        
  456.        
  457.         refresh()
  458.     end
  459.    
  460. end)
  461.  
  462.  
  463. choosing = false       
  464. wchoos = 0     
  465.        
  466. windower.register_event('chat message', function(original, sender, mode, gm)
  467.     local match
  468.  
  469.                 if sender == player.name then
  470.                     if original == "man" or original == "Man" or original == "Maneuver" or original == "maneuver" then
  471.                         if ManeRound == 1 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
  472.                             send_command('input /ja "'..Mane[1]..' Maneuver" <me>')
  473.                         elseif ManeRound == 2 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
  474.                             send_command('input /ja "'..Mane[2]..' Maneuver" <me>')
  475.                         elseif ManeRound == 3 and windower.ffxi.get_ability_recasts()[210] and not buffactive.amnesia then
  476.                             send_command('input /ja "'..Mane[3]..' Maneuver" <me>')
  477.                         end
  478.                     elseif original == "1" and not choosing then
  479.                         wchoos = 1
  480.                         add_to_chat(204,"Choose your First maneuver :")
  481.                         choosing = true
  482.                     elseif original == "2" and not choosing then
  483.                         wchoos = 2
  484.                         add_to_chat(204,"Choose your Second maneuver :")
  485.                         choosing = true
  486.                     elseif original == "3" and not choosing then
  487.                         wchoos = 3
  488.                         add_to_chat(204,"Choose your Third maneuver :")
  489.                         choosing = true
  490.                     elseif choosing then
  491.                         if TypeM:contains(original) then
  492.                             add_to_chat(204,""..original.." Maneuver choosed")
  493.                             Mane[wchoos] = original
  494.                             wchoos = 0
  495.                             choosing = false
  496.                         end
  497.                     elseif original == "start" then
  498.                         autos= true
  499.                         add_to_chat(204,"AutoManeuver started")
  500.                         print(autos)
  501.                     elseif original == "stop" then
  502.                         autos= false
  503.                         add_to_chat(204,"AutoManeuver stoped")
  504.                     else
  505.                         comd = string.split(original, ",")
  506.                         for i=1, 3, 1 do
  507.                        
  508.                             if TypeM:contains(comd[i]) then
  509.                                 add_to_chat(204,"Maneuver "..i.." = "..comd[i].."")
  510.                                 Mane[i] = comd[i]
  511.                             end
  512.                         end
  513.                     end
  514.                 end
  515.                
  516.                
  517.  
  518.     return sender, mode, gm
  519. end)
  520.  
  521. function round(num, dec)
  522.   local mult = 10^(dec or 0)
  523.   return math.floor(num * mult + 0.5) / mult
  524. end
  525.  
  526. RWSTrigger = S{"Arcuballista", "Daze", "Armor Piercer", "Armor Shatterer"}
  527. MWSTrigger = S{"Slapstick", "Knockout", "Chimera Ripper", "String Clipper", "Cannibal Blade", "Bone Crusher", "String Shredder"}
  528. HPWSTrigger = S{"Magic Mortar"}
  529.  
  530. --- Delve Assistant
  531. windower.register_event('incoming text', function(original, modified, mode)
  532.     local match
  533.        
  534.        
  535.         -- AutoWS trigger
  536.        
  537.             match = original:match('Genta readies ([%s%w]+)%.')
  538.        
  539.             if RWSTrigger:contains(match) then
  540.                 equip(sets.midcast.Pet.WeaponSkill)
  541.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Range WSing ] *-*-*-*-*-*-*-*-*')
  542.             elseif MWSTrigger:contains(match) then
  543.                 equip(sets.midcast.Pet.WeaponSkill)
  544.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Melee WSing ] *-*-*-*-*-*-*-*-*')
  545.             elseif HPWSTrigger:contains(match) then
  546.                 equip(sets.midcast.Pet.WeaponSkill)
  547.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Genta is Magic Mortaring ] *-*-*-*-*-*-*-*-*')       
  548.             end
  549.        
  550.        
  551.     return modified, mode
  552. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement