FalownPSA

Faloun_COR

May 1st, 2016
2,541
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 57.11 KB | None | 0 0
  1. -- Multiple TP Sets "Normal", ACC, P/MDT, Hybrid
  2. -- Multiple WS Sets, VS(Acc, Impetus, Impetus + ACC) SS(Normal, Acc) FH(Normal, Acc) Others WS
  3. -- Impetus active, auto VS WS Gear depending on TP Set
  4. -- Impetus Wear off, Remove Impetus Gear and back to "Normal"
  5. -- Auto Boost on Certain WS.
  6. -- SE Macros /console sc c .... Commands are Normal, PDT, MDT, Impetus, Hybrid, AutoBoost
  7.  
  8. -- Opens a file in append mode
  9. require('files')
  10. packets = require('packets')
  11. res = require('resources')
  12.  
  13. ---- Accing
  14. Meleeswitch = false
  15. Meleelvl = 1
  16. WhichParse = ""
  17. Meleeacc = ""
  18.  
  19. Rangedswitch = false
  20. Rangedlvl = 1
  21. Rangedacc = ""
  22.  
  23. enfo = {}
  24.  
  25. enfo['Fire'] = {}
  26. enfo['Water'] = {}
  27. enfo['Thunder'] = {}
  28. enfo['Ice'] = {}
  29. enfo['Earth'] = {}
  30. enfo['Wind'] = {}
  31.  
  32.  
  33. enfo['Wildfire'] = {}
  34. enfo['Leaden Salute'] = {}
  35. enfo['Last Stand'] = {}
  36. enfo['Savage Blade'] = {}
  37.  
  38. include('organizer-lib')
  39.  
  40. include("COR/Wildfire/include.lua")
  41. include("COR/Leaden Salute/include.lua")
  42. include("COR/Last Stand/include.lua")
  43. include("COR/Savage Blade/include.lua")
  44.  
  45. include("COR/Fire/include.lua")
  46. include("COR_gear_include.lua")
  47. include("COR/Ice/include.lua")
  48. include("COR/Earth/include.lua")
  49. include("COR/Wind/include.lua")
  50. include("COR/Water/include.lua")
  51. include("COR/Thunder/include.lua")
  52.  
  53. LeadenObi = "Svelt. Gouriz +1"
  54.  
  55. function getGear(slot)
  56.     local equip = windower.ffxi.get_items()['equipment']
  57.     return windower.ffxi.get_items(equip[slot..'_bag'])[equip[slot]]~= nil and windower.ffxi.get_items(equip[slot..'_bag'])[equip[slot]].id or 0
  58. end
  59.  
  60. gearTable = {
  61.         [0]=getGear('main'),[1]=getGear('sub'),[2]=getGear('range'),[3]=getGear('ammo'),
  62.         [4]=getGear('head'),[9]=getGear('neck'),[11]=getGear('left_ear'),[12]=getGear('right_ear'),
  63.         [5]=getGear('body'),[6]=getGear('hands'),[13]=getGear('left_ring'),[14]=getGear('right_ring'),
  64.         [15]=getGear('back'),[10]=getGear('waist'),[7]=getGear('legs'),[8]=getGear('feet')
  65.     }
  66.  
  67. rollInfoTemp = {
  68.         -- Okay, this goes 1-11 boost, Bust effect, Effect, Lucky, +1 Phantom Roll Effect, Bonus Equipment and Effect,
  69.         ['Chaos'] = {6,8,9,25,11,13,16,3,17,19,31,"-4", '% Attack!', 4, 3},
  70.         ['Fighter\'s'] = {2,2,3,4,12,5,6,7,1,9,18,'-4','% Double-Attack!', 5, 1},
  71.         ['Wizard\'s'] = {4,6,8,10,25,12,14,17,2,20,30, "-10", ' MAB', 5, 2},
  72.         ['Evoker\'s'] = {1,1,1,1,3,2,2,2,1,3,4,'-1', ' Refresh!',5, 1},
  73.         ['Rogue\'s'] = {2,2,3,4,12,5,6,6,1,8,14,'-6', '% Critical Hit Rate!', 5, 1},
  74.         ['Corsair\'s'] = {10, 11, 11, 12, 20, 13, 15, 16, 8, 17, 24, '-6', '% Experience Bonus',5, 2},
  75.         ['Hunter\'s'] = {10,13,15,40,18,20,25,5,27,30,50,'-?', ' Accuracy Bonus',4, 5},
  76.         ['Magus\'s'] = {5,20,6,8,9,3,10,13,14,15,25,'-8',' Magic Defense Bonus',2, 2},
  77.         ['Healer\'s'] = {3,4,12,5,6,7,1,8,9,10,16,'-4','% Cure Potency',3, 1},
  78.         ['Drachen'] = {10,13,15,40,18,20,25,5,28,30,50,'-8',' Pet: Accuracy Bonus',4, 5},
  79.         ['Choral'] = {8,42,11,15,19,4,23,27,31,35,50,'+25', '- Spell Interruption Rate',2, 0},
  80.         ['Monk\'s'] = {8,10,32,12,14,15,4,20,22,24,40,'-?', ' Subtle Blow', 3, 4},
  81.         ['Beast'] = {6,8,9,25,11,13,16,3,17,19,31,'-10', '% Pet: Attack Bonus',4, 3},
  82.         ['Samurai'] = {7,32,10,12,14,4,16,20,22,24,40,'-10',' Store TP Bonus',2, 4},
  83.         ['Warlock\'s'] = {2,3,4,12,5,6,7,1,8,9,15,'-5',' Magic Accuracy Bonus',4, 1},
  84.         ['Puppet'] = {5,8,35,11,14,18,2,22,26,30,40,'-8',' Pet: Magic Attack Bonus',3, 3},
  85.         ['Gallant\'s'] = {4,5,15,6,7,8,3,9,10,11,20,'-10','% Defense Bonus', 3, 2.4},
  86.         ['Dancer\'s'] = {3,4,12,5,6,7,1,8,9,10,16,'-4',' Regen',3, 2},
  87.         ['Bolter\'s'] = {0.3,0.3,0.8,0.4,0.4,0.5,0.5,0.6,0.2,0.7,1.0,'-8','% Movement Speed',3, 0.2},
  88.         ['Caster\'s'] = {6,15,7,8,9,10,5,11,12,13,20,'-10','% Fast Cast',2, 3,{7,11140,10}},
  89.         ['Tactician\'s'] = {10,10,10,10,30,10,10,0,20,20,40,'-10',' Regain',5, 2, {5, 11100, 10}},
  90.         ['Miser\'s'] = {30,50,70,90,200,110,20,130,150,170,250,'0',' Save TP',5, 15},
  91.         ['Ninja'] = {4,5,5,14,6,7,9,2,10,11,18,'-10',' Evasion Bonus',4, 2},
  92.         ['Scholar\'s'] = {'?','?','?','?','?','?','?','?','?','?','?','?',' Conserve MP',2, 0},
  93.         ['Allies\''] = {6,7,17,9,11,13,15,17,17,5,17,'?','% Skillchain Damage',3, 1,{6,11120, 5}},
  94.         ['Companion\'s'] = {{4,20},{20, 50},{6,20},{8, 20},{10,30},{12,30},{14,30},{16,40},{18, 40}, {3,10},{30, 70},'-?',' Pet: Regen/Regain',2, {1,5}},
  95.         ['Avenger\'s'] = {'?','?','?','?','?','?','?','?','?','?','?','?',' Counter Rate',4, 0},
  96.         ['Blitzer\'s'] = {2,3.4,4.5,11.3,5.3,6.4,7.2,8.3,1.5,10.2,12.1,'-?', '% Attack delay reduction',4, 1, {4,11080, 5}},
  97.         ['Courser\'s'] = {'?','?','?','?','?','?','?','?','?','?','?','?',' Snapshot',3, 0},
  98.         ['Runeist\'s'] = {'?','?','?','?','?','?','?','?','?','?','?','?',' Magic Evasion',4, 0},
  99.         ['Naturalist\'s'] = {'?','?','?','?','?','?','?','?','?','?','?','?',' Enhancing Magic Duration',3, 0}
  100.     }
  101.  
  102.  
  103. --------------------- COUNTER RATE COUNTING ----------------------------------
  104. totalhit = 0
  105. counterhit = 0
  106. ------------------------------------------------------------------------------
  107.    
  108. RollLuckyUnlucky = {
  109.         ['Chaos Roll'] = {4,8},
  110.         ['Fighter\'s Roll'] = {5,9},
  111.         ['Wizard\'s Roll'] = {5,9},
  112.         ['Evoker\'s Roll'] = {5,9},
  113.         ['Rogue\'s Roll'] = {5,9},
  114.         ['Corsair\'s Roll'] = {5,9},
  115.         ['Hunter\'s Roll'] = {4,8},
  116.         ['Magus\'s Roll'] = {2,6},
  117.         ['Healer\'s Roll'] = {3,7},
  118.         ['Drachen Roll'] = {4,8},
  119.         ['Choral Roll'] = {2,6},
  120.         ['Monk\'s Roll'] = {3,7},
  121.         ['Beast Roll'] = {4,8},
  122.         ['Samurai Roll'] = {2,6},
  123.         ['Warlock\'s Roll'] = {4,8},
  124.         ['Puppet Roll'] = {3,7},
  125.         ['Gallant\'s Roll'] = {3,7},
  126.         ['Dancer\'s Roll'] = {3,7},
  127.         ['Bolter\'s Roll'] = {3,9},
  128.         ['Caster\'s Roll'] = {2,7},
  129.         ['Tactician\'s Roll'] = {5,8},
  130.         ['Miser\'s Roll'] = {5,7},
  131.         ['Ninja Roll'] = {4,8},
  132.         ['Scholar\'s Roll'] = {2,6},
  133.         ['Allies\' Roll'] = {3,10},
  134.         ['Companion\'s Roll'] = {2,10},
  135.         ['Avenger\'s Roll'] = {4,8},
  136.         ['Blitzer\'s Roll'] = {4,9},
  137.         ['Courser\'s Roll'] = {3,9},
  138.         ['Runeist\'s Roll'] = {4,8},
  139.         ['Naturalist\'s Roll'] = {3,7},
  140. }
  141.  
  142.  
  143. function user_setup()
  144. -- Default macro set/book
  145. set_macro_page(1, 13)
  146. end
  147.  
  148. WSN = 3
  149. WeaponSetup = {}
  150. WeaponSetup[1] = {"SuperSavage", "Fettering Blade", "Blurred Knife", "Anarchy +2"}
  151. WeaponSetup[2] = {"SuperRange", "Fettering Blade", "Blurred Knife", "Compensator"}
  152. WeaponSetup[3] = {"SuperMAB", "Fettering Blade", "Atoyac", "Doomsday"}
  153.  
  154. boo = 0
  155. prrecast=0
  156.  
  157. --- BULLETS SET :
  158. RAbullet = "Devastating Bullet"
  159. Pbullet = "Chrono Bullet"
  160. WSbullet = "Living Bullet"
  161. MAbullet = "Living Bullet"
  162. QDbullet = "Devastating Bullet"
  163. RABulletleft = 0
  164. MABulletleft = 0
  165. PBulletleft = 0
  166. TCLeft = 0
  167. HH = 0
  168. CA = 0
  169. CC = 0
  170.  
  171. --if(player.inventory[RAbullet]) then
  172. --RABulletleft = player.inventory['Living Bullet'].count
  173. --end
  174. --if(player.inventory['Living Bullet']) then
  175. --MABulletleft = player.inventory['Living Bullet'].count
  176. --end
  177. ----------------------------- TEXTBOX HELPER -----------------------------------------------------------
  178.  
  179. RollOne = "Samurai Roll"
  180. RollTwo = "Tactician's Roll"
  181. OneStatus = "Off"
  182. TwoStatus = "Off"
  183. OneValue = 0
  184. TwoValue = 0
  185.  
  186. MTP = "Normal"
  187. RATP = "Normal"
  188. MWS = "Normal"
  189. RAWS = "Normal"
  190.  
  191. tb_name = "corhelp"
  192. visible = true
  193.  
  194.  
  195. -- Check availability of file
  196. function file_check(file_name)
  197.   local file_found=io.open(file_name, "r")      
  198.  
  199.   if file_found==nil then
  200.     file_found=false
  201.   else
  202.     file_found=true
  203.   end
  204.   return file_found
  205. end
  206.  
  207. function parse(element, target, amount)
  208.  
  209. tfile = windower.addon_path.."data/COR/"..element.."/"..target..".lua"
  210. --- CHECKING IF FILE EXIST
  211.     filexist = file_check(tfile)
  212. if filexist then
  213. print(enfo[element][target])
  214. if(tonumber(amount)>enfo[element][target]) then
  215. file = io.open(windower.addon_path.."data/COR/"..element.."/"..target..".lua", "w")
  216. thetext = 'enfo["'..element..'"]["'..target..'"] = '..amount..''
  217. file:write(thetext)
  218. file:close()
  219. include("COR/"..element.."/include.lua")
  220. end
  221. else
  222. add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..target..'... recording... ] *-*-*-*-*-*-*-*-*')
  223. -- Create file
  224. file = io.open(windower.addon_path.."data/COR/"..element.."/"..target..".lua", "w")
  225. thetext = 'enfo["'..element..'"]["'..target..'"] = '..amount..''
  226. file:write(thetext)
  227. file:close()
  228.  
  229.  
  230.  
  231. -- Include it in include file
  232. file = io.open(windower.addon_path.."data/COR/"..element.."/include.lua", "r")
  233. texting = file:read("*a")
  234.    
  235.     texting = texting..'\n include("COR/'..element..'/'..target..'.lua")'
  236.    
  237.     file:close()
  238.         file = io.open(windower.addon_path.."data/COR/"..element.."/include.lua", "w")
  239.         file:write(tostring(texting))
  240.         file:close()
  241.         include("COR/"..element.."/include.lua")
  242.  
  243. end
  244.  
  245. end
  246.  
  247. function parsews(ws, target, amount)
  248.  
  249. tfile = windower.addon_path.."data/COR/"..ws.."/"..target..".lua"
  250. --- CHECKING IF FILE EXIST
  251.     filexist = file_check(tfile)
  252. if filexist then
  253. print(enfo[ws][target])
  254. if(tonumber(amount)>enfo[ws][target]) then
  255. file = io.open(windower.addon_path.."data/COR/"..ws.."/"..target..".lua", "w")
  256. thetext = 'enfo["'..ws..'"]["'..target..'"] = '..amount..''
  257. file:write(thetext)
  258. file:close()
  259. include("COR/"..ws.."/include.lua")
  260. end
  261. else
  262. add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..target..'... recording... ] *-*-*-*-*-*-*-*-*')
  263. -- Create file
  264. file = io.open(windower.addon_path.."data/COR/"..ws.."/"..target..".lua", "w")
  265. thetext = 'enfo["'..ws..'"]["'..target..'"] = '..amount..''
  266. file:write(thetext)
  267. file:close()
  268.  
  269.  
  270.  
  271. -- Include it in include file
  272. file = io.open(windower.addon_path.."data/COR/"..ws.."/include.lua", "r")
  273. texting = file:read("*a")
  274.    
  275.     texting = texting..'\n include("COR/'..ws..'/'..target..'.lua")'
  276.    
  277.     file:close()
  278.         file = io.open(windower.addon_path.."data/COR/"..ws.."/include.lua", "w")
  279.         file:write(tostring(texting))
  280.         file:close()
  281.         include("COR/"..ws.."/include.lua")
  282.  
  283. end
  284.  
  285. end
  286.  
  287. function round(num, idp)
  288.   local mult = 10^(idp or 0)
  289.   return math.floor(num * mult + 0.5) / mult
  290. end
  291.  
  292. textinbox = ''
  293. R_RA = round(125 + (125-RABulletleft*125/99))
  294. G_RA = round(125 + RABulletleft*125/99)
  295.  
  296. R_MA = round(125 + (125-MABulletleft*125/99))
  297. G_MA = round(125 + MABulletleft*125/99)
  298.    
  299.     textinbox = textinbox..' \\cs(125, 125, 125) 1-'..RollOne..'\\cr \n'
  300.     textinbox = textinbox..' \\cs(125, 125, 125) 2-'..RollTwo..'\\cr \n'
  301.     textinbox = textinbox..' \\cs(125, 125, 125) '..RAbullet..' :\\cr \\cs('..R_RA..', '..G_RA..', 125)'..RABulletleft..' \\cr \n'
  302.     textinbox = textinbox..' \\cs(125, 125, 125) '..MAbullet..' :\\cr \\cs('..R_MA..', '..G_MA..', 125)'..MABulletleft..' \\cr \n'
  303.    
  304.    
  305.    
  306.  
  307.     windower.text.create(tb_name)
  308.     windower.text.set_location(tb_name, 600, 150)
  309.     windower.text.set_bg_color(tb_name, 200, 54, 43, 0)
  310.     windower.text.set_color(tb_name, 255, 147, 161, 161)
  311.     windower.text.set_font(tb_name, "Arial")
  312.     windower.text.set_font_size(tb_name, 10)
  313.     windower.text.set_bold(tb_name, false)
  314.     windower.text.set_italic(tb_name, false)
  315.     windower.text.set_text(tb_name, textinbox)
  316.     windower.text.set_bg_visibility(tb_name, visible)
  317.  
  318.     --local player = windower.ffxi.get_player()
  319.  
  320.     higherele = ""
  321.  
  322.  
  323.  
  324. function refresh()
  325.     textinbox = ''
  326.    
  327.     if(player.inventory[RAbullet]) then
  328.        
  329.             RABulletleft = player.inventory[RAbullet].count
  330.        
  331.     end
  332.     if(player.inventory[Pbullet]) then
  333.        
  334.             PBulletleft = player.inventory[Pbullet].count
  335.        
  336.     end
  337.     if(player.inventory[MAbullet]) then
  338.         --if player.inventory[MAbullet].count > 99 then
  339.         --  MABulletleft = 99
  340.         --  else
  341.             MABulletleft = player.inventory[MAbullet].count
  342.         --end
  343.     end
  344.     if(player.inventory['Trump Card']) then
  345.         TCLeft = player.inventory['Trump Card'].count
  346.     end
  347.     if(player.inventory["Isgebind's Heart"]) then
  348.         HH = player.inventory["Isgebind's Heart"].count
  349.     end
  350.     if(player.inventory["Carabosse's Gem"]) then
  351.         CA = player.inventory["Carabosse's Gem"].count
  352.     end
  353.     if(player.inventory["Cirein. Lantern"]) then
  354.         CC = player.inventory["Cirein. Lantern"].count
  355.     end
  356.     R_RA = round(125 + (125-RABulletleft*125/99))
  357.     G_RA = round(125 + RABulletleft*125/99)
  358.     R_MA = round(125 + (125-MABulletleft*125/99))
  359.     G_MA = round(125 + MABulletleft*125/99)
  360.     R_TC = round(125 + (125-TCLeft*125/99))
  361.     G_TC = round(125 + TCLeft*125/99)
  362.    
  363.     if R_RA > 255 then R_RA = 255 end
  364.     if R_RA < 0 then R_RA = 0 end
  365.     if G_RA > 255 then G_RA = 255 end
  366.     if G_RA < 0 then G_RA = 0 end
  367.     if R_MA > 255 then R_MA = 255 end
  368.     if R_MA < 0 then R_MA = 0 end
  369.     if G_MA > 255 then G_MA = 255 end
  370.     if G_MA < 0 then G_MA = 0 end
  371.     if R_TC > 255 then R_TC = 255 end
  372.     if R_TC < 0 then R_TC = 0 end
  373.     if G_TC > 255 then G_TC = 255 end
  374.     if G_TC < 0 then G_TC = 0 end
  375.    
  376.     if buffactive[RollOne] then
  377.         OneStatus = "\\cs(125, 255, 125)On\\cr"
  378.     else
  379.         OneStatus = "\\cs(255, 125, 125)Off\\cr"
  380.         --OneValue = 0
  381.     end
  382.    
  383.     if buffactive[RollTwo] then
  384.         TwoStatus = "\\cs(125, 255, 125)On\\cr"
  385.     else
  386.         TwoStatus = "\\cs(255, 125, 125)Off\\cr"
  387.         --TwoValue = 0
  388.     end
  389.    
  390.     -- Rolls SPELL
  391.                                     --textinbox = textinbox..' \\cs(125, 125, 125) Mobtype = '..player.target.speed..' \n' ---- PARTY COUNT - DoLM = '..party[party.count].distance'
  392.                                     --textinbox = textinbox..' \\cs(125, 125, 125) DoLM = '..windower.ffxi.get_mob_by_id(party[party.count].mob.id).distance:sqrt()..' \n' ---- PARTY COUNT -
  393.     prrecast = 0
  394.     prrecast = windower.ffxi.get_ability_recasts()[193]
  395.     serecast = 0
  396.     serecast = windower.ffxi.get_ability_recasts()[197]
  397.     frecast = 0
  398.     frecast = windower.ffxi.get_ability_recasts()[198]
  399.     rdrecast = 0
  400.     rdrecast = windower.ffxi.get_ability_recasts()[196]
  401.     durecast = 0
  402.     durecast = windower.ffxi.get_ability_recasts()[194]
  403.     recasttext=""
  404.     -- Snake Eye checking
  405.     setext=""
  406.     if serecast then
  407.         if serecast == 0 then
  408.             setext="\\cs(125, 255, 125)SE\\cr"
  409.         else
  410.             setext="\\cs(255, 125, 125)SE\\cr"
  411.         end
  412.     end
  413.     -- Fold checking
  414.     ftext=""
  415.     if frecast then
  416.         if frecast == 0 then
  417.             ftext="\\cs(125, 255, 125)F\\cr"
  418.         else
  419.             ftext="\\cs(255, 125, 125)F\\cr"
  420.         end
  421.     end
  422.     -- Random Deal checking
  423.     rdtext=""
  424.     if rdrecast then
  425.         if rdrecast == 0 then
  426.             rdtext="\\cs(125, 255, 125)RD\\cr"
  427.         else
  428.             rdtext="\\cs(255, 125, 125)RD\\cr"
  429.         end
  430.     end
  431.     -- Double Up checking
  432.     dutext=""
  433.     if durecast then
  434.         if durecast == 0 then
  435.             dutext="\\cs(125, 255, 125)DU\\cr"
  436.         else
  437.             dutext="\\cs(255, 125, 125)DU\\cr"
  438.         end
  439.     end
  440.    
  441.     recasttext = dutext.." - "..setext.." - "..ftext.." - "..rdtext
  442.    
  443.     --textinbox = textinbox..' \\cs(125, 255, 125) TEST :TH '..totalhit+counterhit..'/CH '..counterhit..'/ Rate = '..counterhit/(counterhit+totalhit)..'\\cr \n'
  444.     --textinbox = textinbox..' \\cs(125, 255, 125) TEST :'..boo..'\\cr \n'
  445.     if prrecast == 0 then
  446.     textinbox = textinbox..' \\cs(125, 255, 125) Phantom Roll :\\cr ('..recasttext..') \n'
  447.     elseif prrecast then
  448.     textinbox = textinbox..' \\cs(255, 125, 125) Phantom Roll('..prrecast..'s) :\\cr ('..recasttext..') \n'
  449.     end
  450.     ----------------------- ROLL HELPER ---------------------------------------------------------------------
  451.     if OneValue ==  RollLuckyUnlucky[RollOne][1] or OneValue == 11 then
  452.         textinbox = textinbox..' \\cs(125, 125, 125) 1-\\cs(125, 255, 125)'..RollOne..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' - \\cs(125, 255, 125)'..OneValue..'\\cr \n'
  453.         textinbox = textinbox..' \\cs(200, 200, 100) ------> '..RollEffect(res.job_abilities:with('english', RollOne).id, OneValue+1)..'\\cr \n'
  454.     elseif OneValue == RollLuckyUnlucky[RollOne][2] then
  455.         textinbox = textinbox..' \\cs(125, 125, 125) 1-\\cs(2555, 125, 125)'..RollOne..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' - \\cs(255, 125, 125)'..OneValue..'\\cr  \n'
  456.         textinbox = textinbox..' \\cs(200, 200, 100) ------> '..RollEffect(res.job_abilities:with('english', RollOne).id, OneValue+1)..'\\cr \n'
  457.     elseif OneValue >= 12 then
  458.         textinbox = textinbox..' \\cs(125, 125, 125) 1-\\cs(255, 255, 125)'..RollOne..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' - \\cs(255, 125, 125)BUST\\cr  \n'
  459.     elseif OneValue == 0 then
  460.         textinbox = textinbox..' \\cs(125, 125, 125) 1-'..RollOne..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' \n'
  461.     elseif windower.ffxi.get_ability_recasts()[197] == 0 and OneValue == (RollLuckyUnlucky[RollOne][1]-1) and buffactive['Double-Up Chance'] then
  462.         textinbox = textinbox..' \\cs(125, 125, 125) 1-'..RollOne..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' - '..OneValue..' - \\cs(125, 255, 125)Snake Eye to Lucky roll \n'
  463.         textinbox = textinbox..' \\cs(200, 200, 100) ------> '..RollEffect(res.job_abilities:with('english', RollOne).id, OneValue+1)..'\\cr \n'
  464.     else
  465.         textinbox = textinbox..' \\cs(125, 125, 125) 1-'..RollOne..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollOne][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollOne][2]..'\\cr) - \\cr'..OneStatus..' - '..OneValue..' \n'
  466.         textinbox = textinbox..' \\cs(200, 200, 100) ------> '..RollEffect(res.job_abilities:with('english', RollOne).id, OneValue+1)..'\\cr \n'
  467.     end
  468.     --if TwoValue == 0 then
  469.     --textinbox = textinbox..' \\cs(125, 125, 125) 2-'..RollTwo..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' \n'
  470.     --end
  471.     if TwoValue ==  RollLuckyUnlucky[RollTwo][1] or TwoValue == 11 then
  472.         textinbox = textinbox..' \\cs(125, 125, 125) 2-\\cs(125, 255, 125)'..RollTwo..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' - \\cs(125, 255, 125)'..TwoValue..'\\cr \n'
  473.         textinbox = textinbox..' \\cs(100, 200, 200) ------> '..RollEffect(res.job_abilities:with('english', RollTwo).id, TwoValue+1)..'\\cr \n'
  474.     elseif TwoValue == RollLuckyUnlucky[RollTwo][2] then
  475.         textinbox = textinbox..' \\cs(125, 125, 125) 2-\\cs(255, 125, 125)'..RollTwo..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' - \\cs(255, 125, 125)'..TwoValue..'\\cr  \n'
  476.         textinbox = textinbox..' \\cs(100, 200, 200) ------> '..RollEffect(res.job_abilities:with('english', RollTwo).id, TwoValue+1)..'\\cr \n'
  477.     elseif TwoValue >= 12 then
  478.         textinbox = textinbox..' \\cs(125, 125, 125) 2-\\cs(255, 255, 125)'..RollTwo..'\\cr(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' - \\cs(255, 125, 125)BUST\\cr  \n'
  479.     elseif TwoValue == 0 then
  480.         textinbox = textinbox..' \\cs(125, 125, 125) 2-'..RollTwo..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' \n'
  481.     elseif windower.ffxi.get_ability_recasts()[197] == 0 and TwoValue == (RollLuckyUnlucky[RollTwo][1]-1) and buffactive['Double-Up Chance'] then
  482.         textinbox = textinbox..' \\cs(125, 125, 125) 2-'..RollTwo..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' - '..TwoValue..' - \\cs(125, 255, 125)Snake Eye to Lucky roll \n'
  483.         textinbox = textinbox..' \\cs(100, 200, 200) ------> '..RollEffect(res.job_abilities:with('english', RollTwo).id, TwoValue+1)..'\\cr \n'
  484.     else
  485.         textinbox = textinbox..' \\cs(125, 125, 125) 2-'..RollTwo..'(\\cs(125, 255, 125)L'..RollLuckyUnlucky[RollTwo][1]..'\\cr/\\cs(255, 125, 125)U'..RollLuckyUnlucky[RollTwo][2]..'\\cr) - \\cr'..TwoStatus..' - '..TwoValue..' \n'
  486.         textinbox = textinbox..' \\cs(100, 200, 200) ------> '..RollEffect(res.job_abilities:with('english', RollTwo).id, TwoValue+1)..'\\cr \n'
  487.     end
  488.     -----------------------------------------------------------------------------------------------------------------
  489.     textinbox = textinbox..' \\cs(125, 125, 125) '..RAbullet..' :\\cr \\cs('..R_RA..', '..G_RA..', 125)'..RABulletleft..' \\cr \n'
  490.     textinbox = textinbox..' \\cs(125, 125, 125) '..MAbullet..' :\\cr \\cs('..R_MA..', '..G_MA..', 125)'..MABulletleft..' \\cr \n'
  491.     textinbox = textinbox..' \\cs(125, 125, 125) '..Pbullet..' :\\cr \\cs(125, 255, 125)'..PBulletleft..' \\cr \n'
  492.     qdrecast = windower.ffxi.get_ability_recasts()[195]
  493.     if qdrecast then
  494.     if qdrecast == 0 then
  495.         textinbox = textinbox..' \\cs(125, 255, 125) Trump Cards(2QD) :\\cr \\cs('..R_TC..', '..G_TC..', 125)'..TCLeft..' \\cr \n'
  496.     elseif qdrecast <40 then
  497.         textinbox = textinbox..' \\cs(177, 177, 125) Trump Cards(1QD - '..qdrecast..'s) :\\cr \\cs('..R_TC..', '..G_TC..', 125)'..TCLeft..' \\cr \n'
  498.     else
  499.         textinbox = textinbox..' \\cs(255, 125, 125) Trump Cards(0QD - '..qdrecast..'s) :\\cr \\cs('..R_TC..', '..G_TC..', 125)'..TCLeft..' \\cr \n'
  500.     end
  501.     end
  502.    
  503.    
  504.     if MTP == "MDT" or MTP == "PDT" or MTP == "Acc" then
  505.     else
  506.         MTP = "Lvl"..Meleelvl
  507.     end
  508.     -- Empy
  509.     --textinbox = textinbox..' \\cs(125, 125, 125) --- EMPY ZONE -- \n'
  510.     --textinbox = textinbox..' \\cs(125, 125, 125) Carabosse :\\cr \\cs(55, 255, 55)'..CA..'/50 \\cr \n'
  511.     --textinbox = textinbox..' \\cs(125, 125, 125) Cirein-Croin :\\cr \\cs(255, 55, 255)'..CC..'/50 \\cr \n'
  512.     --textinbox = textinbox..' \\cs(125, 125, 125) Isgebind :\\cr \\cs(255, 55, 55)'..HH..'/75 \\cr \n'
  513.     textinbox = textinbox..' \\cs(125, 125, 125) MeleeTP :\\cr \\cs(255, 55, 55) '..MTP..' - '..Meleeacc..' \\cr \n'
  514.     textinbox = textinbox..' \\cs(125, 125, 125) RATP :\\cr \\cs(55, 55, 255)Lvl'..Rangedlvl..' - '..Rangedacc..' \\cr \n'
  515.     textinbox = textinbox..' \\cs(125, 125, 125) MeleeWS :\\cr \\cs(55, 255, 55)'..MWS..' \\cr \n'
  516.     textinbox = textinbox..' \\cs(125, 125, 125) RAWS :\\cr \\cs(255, 155, 155)'..RAWS..' \\cr \n'
  517.     ------------------------ PC in range for roll --------------------------------------------
  518.     dist = 8
  519.     if party.count > 1 then
  520.     if Luzaf == "Luzaf's Ring" then
  521.         dist = 16
  522.     else
  523.         dist = 8
  524.     end
  525.      disttext = "In Rolls range ("..dist.." yalms) "
  526.     --for i=2, party.count do
  527.     --  if party[i].mob then
  528.     --  if windower.ffxi.get_mob_by_id(party[i].mob.id).distance:sqrt() < dist then
  529.     --      disttext = disttext.." - "..party[i].name
  530.     --  end
  531.     --  end
  532.     --end
  533.    
  534.     textinbox = textinbox..'\\cs(125, 125, 125)'..disttext..'\\cr \n'
  535.     end
  536.    
  537.     ------------------------------------------------------------------------------------------
  538.    
  539.     --------------------------------------- WS PARSER --------------------------------------------------
  540.     if player.target.name and player.target.type == "MONSTER" then
  541.         if not  enfo['Savage Blade'][player.target.name] then
  542.             textinbox = textinbox..' \\cs(125, 125, 125) Savage Blade :\\cr \\cs(255, 55, 55)Missing Info \\cr \n'
  543.         else
  544.             textinbox = textinbox..' \\cs(125, 125, 125) Savage Blade :\\cr \\cs(55, 255, 55)'..enfo['Savage Blade'][player.target.name]..' \\cr \n'
  545.         end
  546.        
  547.         if not  enfo['Leaden Salute'][player.target.name] then
  548.             textinbox = textinbox..' \\cs(1, 1, 1) Leaden Salute :\\cr \\cs(255, 55, 55)Missing Info \\cr \n'
  549.         else
  550.             textinbox = textinbox..' \\cs(1, 1, 1) Leaden Salute :\\cr \\cs(55, 255, 55)'..enfo['Leaden Salute'][player.target.name]..' \\cr \n'
  551.         end
  552.        
  553.         if not  enfo['Last Stand'][player.target.name] then
  554.             textinbox = textinbox..' \\cs(55, 255, 55) Last Stand :\\cr \\cs(255, 55, 55)Missing Info \\cr \n'
  555.         else
  556.             textinbox = textinbox..' \\cs(55, 255, 55) Last Stand :\\cr \\cs(55, 255, 55)'..enfo['Last Stand'][player.target.name]..' \\cr \n'
  557.         end
  558.        
  559.         if not  enfo['Wildfire'][player.target.name] then
  560.             textinbox = textinbox..' \\cs(255, 55, 55) Wildfire :\\cr \\cs(255, 55, 55)Missing Info \\cr \n'
  561.         else
  562.             textinbox = textinbox..' \\cs(255, 55, 55) Wildfire :\\cr \\cs(55, 255, 55)'..enfo['Wildfire'][player.target.name]..' \\cr \n'
  563.         end
  564.        
  565.    
  566.     ----------------------------------------------------------------------------------------------------
  567.    
  568.    
  569.     --- TARGET WEAKNESS CHECKER ---------------------------------------------------------------
  570.    
  571.    
  572.         textinbox = textinbox..' \\cs(100, 100, 200) '..player.target.name..' \\cr \n'
  573.         --- MSG FOR NO RECORD
  574.         elementinfo = ' \\cs(255, 125, 125) No Info Element \\cr \n'
  575.         --- MSG FOR PARTIAL ELEMENT
  576.         missingele = 0
  577.         maybeadd = "\\cs(255, 125, 125) Missing Element : \\cr"
  578.         if not  enfo['Fire'][player.target.name] then
  579.             maybeadd = maybeadd.."\\cs(255, 100, 100) Fire \\cr"
  580.             missingele = missingele +1
  581.         end
  582.         if not  enfo['Water'][player.target.name] then
  583.             maybeadd = maybeadd.."\\cs(100, 100, 255) Water \\cr"
  584.             missingele = missingele +1
  585.         end
  586.         if not  enfo['Wind'][player.target.name] then
  587.             maybeadd = maybeadd.."\\cs(100, 255, 100) Wind \\cr"
  588.             missingele = missingele +1
  589.         end
  590.         if not  enfo['Ice'][player.target.name] then
  591.             maybeadd = maybeadd.."\\cs(100, 100, 180) Ice \\cr"
  592.             missingele = missingele +1
  593.         end
  594.         if not  enfo['Earth'][player.target.name] then
  595.             maybeadd = maybeadd.."\\cs(255, 255, 100) Earth \\cr"
  596.             missingele = missingele +1
  597.         end
  598.         if not  enfo['Thunder'][player.target.name] then
  599.             maybeadd = maybeadd.."\\cs(255, 100, 255) Thunder \\cr"
  600.             missingele = missingele +1
  601.         end
  602.        
  603.         if maybeadd ~= "\\cs(255, 125, 125) Missing Element : \\cr" then
  604.             elementinfo = maybeadd
  605.         end
  606.        
  607.         --- MSG FOR WINNER
  608.         if missingele == 0 then
  609.             ele_id = {"Fire","Water","Wind","Ice","Thunder","Earth"}
  610.             higherdmg = enfo['Fire'][player.target.name]
  611.             higherele = "Fire"
  612.             weakerele = "Ice"
  613.             weakerdmg = enfo['Ice'][player.target.name]
  614.             for j=1, 6 do
  615.                 if weakerdmg > enfo[ele_id[j]][player.target.name] then
  616.                     weakerdmg = enfo[ele_id[j]][player.target.name]
  617.                     weakerele = ele_id[j]
  618.                 end
  619.             end
  620.             for i=1, 6 do
  621.                 if higherdmg < enfo[ele_id[i]][player.target.name] then
  622.                     higherdmg = enfo[ele_id[i]][player.target.name]
  623.                     higherele = ele_id[i]
  624.                 end
  625.             end
  626.             if higherdmg == weakerdmg then
  627.                 elementinfo = "No Resistance - No Weakness"
  628.             else
  629.                 color = "\\cs(255, 125, 125)"
  630.                 if higherele == "Fire" then color = "\\cs(255, 100, 100)"
  631.                 elseif higherele == "Water" then color = "\\cs(100, 100, 255)"
  632.                 elseif higherele == "Wind" then color = "\\cs(100, 255, 100)"
  633.                 elseif higherele == "Ice" then color = "\\cs(100, 100, 180)"
  634.                 elseif higherele == "Earth" then color = "\\cs(255, 255, 100)"
  635.                 elseif higherele == "Thunder" then color = "\\cs(255, 100, 255)"
  636.                 end
  637.                 textele = color..""..higherele.."\\cr"
  638.                 for k=1, 6 do
  639.                     if higherdmg == enfo[ele_id[k]][player.target.name] then
  640.                         if ele_id[k] ~= higherele then
  641.                             color3 = "\\cs(255, 125, 125)"
  642.                             if ele_id[k] == "Fire" then color3 = "\\cs(255, 100, 100)"
  643.                             elseif ele_id[k] == "Water" then color3 = "\\cs(100, 100, 255)"
  644.                             elseif ele_id[k] == "Wind" then color3 = "\\cs(100, 255, 100)"
  645.                             elseif ele_id[k] == "Ice" then color3 = "\\cs(100, 100, 180)"
  646.                             elseif ele_id[k] == "Earth" then color3 = "\\cs(255, 255, 100)"
  647.                             elseif ele_id[k] == "Thunder" then color3 = "\\cs(255, 100, 255)"
  648.                             end
  649.                             textele = textele.." - "..color3..""..ele_id[k].."\\cr"
  650.                         end
  651.                     end
  652.                 end
  653.                 color2 = "\\cs(255, 125, 125)"
  654.            
  655.                 elementinfo = color.."WEAK TO : \\cr"..textele..""
  656.                 if weakerele == "Fire" then color2 = "\\cs(255, 100, 100)"
  657.                 elseif weakerele == "Water" then color2 = "\\cs(100, 100, 255)"
  658.                 elseif weakerele == "Wind" then color2 = "\\cs(100, 255, 100)"
  659.                 elseif weakerele == "Ice" then color2 = "\\cs(100, 100, 180)"
  660.                 elseif weakerele == "Earth" then color2 = "\\cs(255, 255, 100)"
  661.                 elseif weakerele == "Thunder" then color2 = "\\cs(255, 100, 255)"
  662.                 end
  663.                 elementinfo = elementinfo.." - "..color2.."STRONG TO : "..weakerele.."\\cr"
  664.             end
  665.            
  666.         end
  667.         textinbox = textinbox..elementinfo
  668.  
  669.     end
  670.  
  671.     windower.text.set_text(tb_name, textinbox)
  672. end
  673.  
  674. refresh()
  675.  
  676.  
  677. windower.register_event('unload', function()
  678.     windower.text.delete(tb_name)
  679. end)
  680.  
  681. foc = 0
  682. --Auto Boost on Certain WS
  683. function precast(spell,action)
  684.    
  685.     if NoQDWS:contains(spell.english)  then
  686.         equip({ammo=RABullet})
  687.         equip(sets.precast[spell.english])
  688.         add_to_chat(256, '*-*-*-*-*-*-*-*-* [ Living was in Ammo Slot -DD is now in Ammo, use WS ] *-*-*-*-*-*-*-*-*' )
  689.     elseif spell.action_type == 'Ranged Attack' then
  690.         if player.ammo == QDBullet then
  691.             equip({ammo=RABullet})
  692.         end
  693.         equip(sets.precast.RA)
  694.     elseif ShotsList:contains(spell.english) or spell.english == "Light Shot" or spell.english == "Dark Shot" then
  695.         equip(sets.precast.CorsairShot)
  696.     elseif sets.precast[spell.english] then
  697.         equip(sets.precast[spell.english])
  698.         -- add_to_chat(392,'*-*-*-*-*-*-*-*-* [ WS AGI = '..player.agi..' ] *-*-*-*-*-*-*-*-*')
  699.     elseif rollslist:contains(spell.english) then
  700.         equip(sets.precast.CorsairRoll)
  701.     elseif spell.type=="WeaponSkill" then
  702.             equip(sets.precast.WS)
  703.     elseif spell.english == "Utsusemi: Ichi" or spell.english == "Utsusemi: Ni" then
  704.             equip(sets.precast.FC.Utsusemi)
  705.     elseif string.find(spell.english,'Waltz') then
  706.             equip(sets.precast.Waltz)
  707.     end
  708.    
  709.     return
  710. end
  711.  
  712. nin = {"Doton", "Suiton", "Raiton", "Katon", "Futon"}
  713.  
  714. function midcast(spell,action)
  715.     if spell.action_type == 'Ranged Attack' then
  716.         if player.ammo == QDBullet then
  717.             equip({ammo=RABullet})
  718.         end
  719.         if buffactive['Triple Shot'] then
  720.             equip(sets.midcast.RATS)
  721.         else
  722.             equip(sets.midcast.RA)
  723.         end
  724.     elseif spell.english == "Yoran-Oran (UC)" then
  725.         equip({body="Yoran Unity Shirt"})
  726.     elseif spell.english == "Apururu (UC)" then
  727.         equip({body="Apururu Unity Shirt"})
  728.     elseif spell.english == "Doton: Ichi" or spell.english == "Doton: Nii" or spell.english == "Katon: Ichi" or spell.english == "Katon: Ni" or spell.english == "Suiton: Ichi" or spell.english == "Suiton: Ni" then
  729.         equip(sets.midcast.ninjutsu)
  730.     elseif sets.precast[spell.english] then
  731.         equip(sets.precast[spell.english])
  732.         -- add_to_chat(392,'*-*-*-*-*-*-*-*-* [ WS AGI = '..player.agi..' ] *-*-*-*-*-*-*-*-*')
  733.     elseif ShotsList:contains(spell.english) then
  734.         equip(sets.midcast.CorsairShot)
  735.     elseif spell.type=="WeaponSkill" then
  736.    
  737.             equip(sets.precast.WS)
  738.             -- add_to_chat(392,'*-*-*-*-*-*-*-*-* [ WS AGI = '..player.agi..' ] *-*-*-*-*-*-*-*-*')
  739.     elseif string.find(spell.english,'Waltz') then
  740.             equip(sets.precast.Waltz)
  741.     end
  742. end
  743.  
  744. function aftercast(spell,action)
  745.     refresh()
  746.     if spell.name == null then
  747.             return -- Cancel Aftercast for outofrange/unable to see.
  748.     end
  749.    
  750.    
  751.  
  752.     if player.status == 'Engaged' then
  753.             equip(sets.aftercast.TP)
  754.     else
  755.        
  756.             equip(sets.aftercast.Idle)
  757.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ Idle ] *-*-*-*-*-*-*-*-*')
  758.     end
  759. end
  760.  
  761. function status_change(new,old)
  762.     refresh()
  763.     if new == 'Engaged' then
  764.         enga = 1
  765.        
  766.        
  767.         equip(sets.aftercast.TP)
  768.     else
  769.     enga = 0
  770.     equip(sets.aftercast.Idle)
  771.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ Idle ] *-*-*-*-*-*-*-*-*')
  772.     end
  773. end
  774.  
  775. memoryset = {}
  776. function buff_change(status,gain_or_loss)
  777.     refresh()
  778.     if status == "sleep" then
  779.         if gain_or_loss then
  780.             equip({neck="Opo-opo Necklace"})
  781.         end
  782.     elseif status == "amnesia" then
  783.         if gain_or_loss then
  784.             equip({ring1="Ecphoria Ring"})
  785.         end
  786.     elseif status == 'Voidwatcher' then
  787.         if gain_or_loss then
  788.             send_command('wait 15;input /item "Fanatic\'s Drink" <me>')
  789.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ STARTING FIGHT ] *-*-*-*-*-*-*-*-*')
  790.         else
  791.             --send_command('wait 15;input /targetnpc; wait 2;lua reload vwh')
  792.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ TRADING RUBI ] *-*-*-*-*-*-*-*-*')
  793.         end
  794.     end
  795.    
  796.     --if status == "poison" then
  797.     --  if gain_or_loss then
  798.     --      send_command('input /ja "Healing Waltz" <me>')
  799.     --  end
  800.     --end
  801.    
  802.     if status == RollOne then
  803.         if not gain_or_loss then
  804.             OneValue = 0
  805.         end
  806.     end
  807.    
  808.     if status == RollTwo then
  809.         if not gain_or_loss then
  810.             TwoValue = 0
  811.         end
  812.     end
  813.    
  814.     if status == "Avenger's Roll" then
  815.         if gain_or_loss then
  816.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ START COUNTING COUNTER RATE ] *-*-*-*-*-*-*-*-*')
  817.         else
  818.             add_to_chat(392,'*-*-*-*-*-*-*-*-* [ END : Total hit : '..counterhit+totalhit..' / Countered : '..counterhit..' / rate = '..counterhit/(counterhit+totalhit)..' ] *-*-*-*-*-*-*-*-*')
  819.         end
  820.     end
  821.    
  822.     if status == "Reive Mark" then
  823.         if gain_or_loss then
  824.             equip({neck="Ygnas's Resolve +1"})
  825.             disable("neck")
  826.             add_to_chat(278, "REIVE ----------> WS+25% - Regain up")
  827.         else
  828.             enable("neck")
  829.             add_to_chat(278, "REIVE ----------> OFF")
  830.         end
  831.     end
  832.    
  833.     if status == "encumbrance" then
  834.         if not gain_or_loss then
  835.             equip({main="Hep. Sapara +1", sub="Fettering blade", range="Fomalhaut"})
  836.             add_to_chat(278, "----------> Weapons got back")
  837.         end
  838.     end
  839. end
  840.  
  841.  
  842. -- Toggles -- SE Macros: /console gs c "command" [case sensitive]
  843. function self_command(command)
  844.         if command == 'normal' then
  845.             if player.status == 'Engaged' then 
  846.                 equip(sets.engaged.Melee)
  847.                 sets.aftercast.TP = sets.engaged.Melee
  848.                 sets.precast.acclvl = sets.engaged.Melee
  849.                 sets.aftercast.Idle = sets.idle
  850.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ Normal TP ] *-*-*-*-*-*-*-*-*')
  851.             else
  852.                 equip(sets.aftercast.Idle)
  853.                 sets.aftercast.TP = sets.engaged.Melee
  854.                 sets.precast.acclvl = sets.engaged.Melee
  855.                 sets.aftercast.Idle = sets.idle
  856.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ Normal TP - Idle ] *-*-*-*-*-*-*-*-*')
  857.             end
  858.             MTP="Normal"
  859.         elseif command == 'nodt' then
  860.                 equip(sets.precast.acclvl)
  861.                 sets.aftercast.TP = sets.precast.acclvl
  862.                 sets.aftercast.Idle = sets.idle
  863.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ DT off ] *-*-*-*-*-*-*-*-*')
  864.                 MTP="Normal"
  865.         elseif command == 'acc' then
  866.                 equip(sets.engaged.Acc)
  867.                 sets.aftercast.TP = sets.engaged.Acc
  868.                 sets.precast.acclvl = sets.engaged.Acc
  869.                 sets.aftercast.Idle = sets.idle
  870.                 MTP = "Accuracy"
  871.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ Full Acc ] *-*-*-*-*-*-*-*-*')
  872.         elseif command == 'crit' then
  873.                 equip(sets.engaged.Crit)
  874.                 sets.aftercast.TP = sets.engaged.Crit
  875.                 sets.precast.acclvl = sets.engaged.Crit
  876.                 sets.aftercast.Idle = sets.idle
  877.                 MTP = "CrItIcAl HiT RaTe"
  878.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ CrItIcAl HiT RaTe ] *-*-*-*-*-*-*-*-*')
  879.         elseif command == 'PDT' then
  880.             equip(sets.defense.PDT)
  881.             sets.aftercast.TP = sets.defense.PDT
  882.             sets.aftercast.Idle = sets.defense.PDT
  883.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ PDT ] *-*-*-*-*-*-*-*-*')
  884.                 MTP = "PDT"
  885.         elseif command == 'Range' then
  886.             if sets.midcast.RA == sets.midcast.RANorm then
  887.                 sets.midcast.RA = sets.midcast.RAcc
  888.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ RACC ] *-*-*-*-*-*-*-*-*')
  889.                 RATP = "RAcc"
  890.             else
  891.                 sets.midcast.RA = sets.midcast.RANorm
  892.                 add_to_chat(455, '*-*-*-*-*-*-*-*-* [ Range Normal ] *-*-*-*-*-*-*-*-*')
  893.                 RATP = "Normal"
  894.             end
  895.         elseif command == 'MDT' then
  896.                 equip(sets.defense.MDT)
  897.                 sets.aftercast.TP = sets.defense.MDT
  898.                 sets.aftercast.Idle = sets.defense.MDT
  899.                 add_to_chat(501, '*-*-*-*-*-*-*-*-* [ MDT ] *-*-*-*-*-*-*-*-*')
  900.                 MTP="MDT"
  901.         elseif command == 'BestShot' then
  902.                 send_command('input /ja "'..higherele..' Shot" <t>')
  903.                 add_to_chat(501, '*-*-*-*-*-*-*-*-* [ Best SHOT ] *-*-*-*-*-*-*-*-*')
  904.         elseif command == 'AutoRoll' then
  905.                 if OneStatus == "\\cs(255, 125, 125)Off\\cr" then
  906.                     send_command('input /ja "'..RollOne..'" <me>')
  907.                 elseif TwoStatus == "\\cs(255, 125, 125)Off\\cr" then
  908.                     send_command('input /ja "'..RollTwo..'" <me>')
  909.                 end
  910.                 add_to_chat(501, '*-*-*-*-*-*-*-*-* [ Rolling ] *-*-*-*-*-*-*-*-*')
  911.         elseif command == "Luzaf" then
  912.             if Luzaf == "Luzaf's Ring" then
  913.                 Luzaf = ""
  914.                 add_to_chat(501, '*-*-*-*-*-*-*-*-* [ LUZAF is OFF - '..Luzaf..' ] *-*-*-*-*-*-*-*-*')
  915.             else
  916.                 Luzaf = "Luzaf's Ring"
  917.                 add_to_chat(501, '*-*-*-*-*-*-*-*-* [ LUZAF is ON ] - '..Luzaf..' *-*-*-*-*-*-*-*-*')
  918.             end
  919.         elseif command == 'regpack' then
  920.             if regpack == 1 then
  921.                 regpack = 0
  922.                 add_to_chat(167, '*-*-*-*-*-*-*-*-* [ Packet register OFF ] *-*-*-*-*-*-*-*-*')
  923.             else
  924.                 regpack = 1
  925.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Packet register ON ] *-*-*-*-*-*-*-*-*')
  926.             end
  927.         elseif command == "recordshot" then
  928.             if not  enfo['Fire'][player.target.name] then
  929.                 send_command('input /ja "Fire Shot" <t>')
  930.             elseif not  enfo['Water'][player.target.name] then
  931.                 send_command('input /ja "Water Shot" <t>')
  932.             elseif not  enfo['Wind'][player.target.name] then
  933.                 send_command('input /ja "Wind Shot" <t>')
  934.             elseif not  enfo['Ice'][player.target.name] then
  935.                 send_command('input /ja "Ice Shot" <t>')
  936.             elseif not  enfo['Earth'][player.target.name] then
  937.                 send_command('input /ja "Earth Shot" <t>')
  938.             elseif not  enfo['Thunder'][player.target.name] then
  939.                 send_command('input /ja "Thunder Shot" <t>')
  940.             else
  941.                 send_command('input /ja "'..higherele..' Shot" <t>')
  942.             end
  943.     end
  944. end
  945.  
  946.  
  947.  
  948.  
  949. windower.register_event('Zone change', function(new_id, old_id)
  950.     refresh()  
  951.     if regpack then
  952.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ New zone = '..new_id..' / Old zone = '..old_id..' ] *-*-*-*-*-*-*-*-*')
  953.     end
  954.     OneValue = 0
  955.     TwoValue = 0
  956.    
  957.     return modified, injected
  958. end)
  959.  
  960. local clock = os.clock
  961. function sleep(n)  -- seconds
  962.   local t0 = clock()
  963.   while clock() - t0 <= n do end
  964. end
  965.  
  966. function check_set()
  967.     for i=1, numberofautoset do
  968.        
  969.         send_command('input //gs equip naked;wait 0.5; input /equipset '..i..'')
  970.         sleep(2)
  971.         autoset[i] = {
  972.             main=player.equipment.main,
  973.             sub=player.equipment.sub,
  974.             range=player.equipment.range,
  975.             ammo=player.equipment.ammo,
  976.             head=player.equipment.head,
  977.             neck=player.equipment.neck,
  978.             ear1=player.equipment.left_ear,
  979.             ear2=player.equipment.right_ear,
  980.             body=player.equipment.body,
  981.             hands=player.equipment.hands,
  982.             ring1=player.equipment.left_ring,
  983.             ring2=player.equipment.right_ring,
  984.             back=player.equipment.back,
  985.             waist=player.equipment.waist,
  986.             legs=player.equipment.legs,
  987.             feet=player.equipment.feet
  988.         }
  989.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Auto Set Number '..i..' ] *-*-*-*-*-*-*-*-*')
  990.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Main : '..player.equipment.main..' ] *-*-*-*-*-*-*-*-*')
  991.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Sub : '..player.equipment.sub..' ] *-*-*-*-*-*-*-*-*')
  992.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Range : '..player.equipment.range..' ] *-*-*-*-*-*-*-*-*')
  993.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Ammo : '..player.equipment.ammo..' ] *-*-*-*-*-*-*-*-*')
  994.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Head : '..player.equipment.head..' ] *-*-*-*-*-*-*-*-*')
  995.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Neck : '..player.equipment.neck..' ] *-*-*-*-*-*-*-*-*')
  996.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Earring1 : '..player.equipment.left_ear..' ] *-*-*-*-*-*-*-*-*')
  997.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Earring2 : '..player.equipment.right_ear..' ] *-*-*-*-*-*-*-*-*')
  998.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Body : '..player.equipment.body..' ] *-*-*-*-*-*-*-*-*')
  999.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Hands : '..player.equipment.hands..' ] *-*-*-*-*-*-*-*-*')
  1000.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Ring1 : '..player.equipment.left_ring..' ] *-*-*-*-*-*-*-*-*')
  1001.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Ring2 : '..player.equipment.right_ring..' ] *-*-*-*-*-*-*-*-*')
  1002.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Back : '..player.equipment.back..' ] *-*-*-*-*-*-*-*-*')
  1003.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Waist : '..player.equipment.waist..' ] *-*-*-*-*-*-*-*-*')
  1004.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Legs : '..player.equipment.legs..' ] *-*-*-*-*-*-*-*-*')
  1005.         add_to_chat(179, '*-*-*-*-*-*-*-*-* [ Feet : '..player.equipment.feet..' ] *-*-*-*-*-*-*-*-*')
  1006.         sleep(1)
  1007.     end
  1008.     -- resetting autoset
  1009.     sets.precast.Chakra = autoset[1]
  1010.     sets.precast.Focus = autoset[2]
  1011. end
  1012.  
  1013.  
  1014.  
  1015. wscount = 0
  1016. beadk=3
  1017.  
  1018.  
  1019. --- Delve Assistant
  1020. windower.register_event('incoming text', function(original, modified, mode)
  1021.     local match
  1022.    
  1023.    
  1024.    
  1025.    
  1026.    
  1027.        
  1028.    
  1029.         if player.target.name then
  1030.             match = original:match(''..player.name..' uses ([%s%w]+)% Shot.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1031.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1032.             if EleList:contains(match) then
  1033.                 match2 = original:match(''..player.name..' uses '..match..' Shot.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1034.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1035.                 parse(match, player.target.name, match2)
  1036.             end
  1037.         end
  1038.        
  1039.        
  1040.         ------------------------------------------------------------- WS--------------------------------------------------------------------------
  1041.         if player.target.name then
  1042.             --
  1043.             match = original:match(''..player.name..' uses ([%s%w]+)%.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1044.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1045.             if WSList:contains(match) then
  1046.                 match2 = original:match(''..player.name..' uses '..match..'.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1047.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ WS = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1048.                 parsews(match, player.target.name, match2)
  1049.             end
  1050.         end
  1051.        
  1052.         if player.target.name then
  1053.             --
  1054.             match = original:match(''..player.name..' uses ([%s%w]+)%.The '..player.target.name..' take ([%s%w]+)% points of damage.')
  1055.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1056.             if WSList:contains(match) then
  1057.                 match2 = original:match(''..player.name..' uses '..match..'.The '..player.target.name..' take ([%s%w]+)% points of damage.')
  1058.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ WS = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1059.                 parsews(match, player.target.name, match2)
  1060.             end
  1061.         end
  1062.        
  1063.         if player.target.name then
  1064.             --
  1065.             match = original:match(''..player.name..' uses ([%s%w]+)%.'..player.target.name..' takes ([%s%w]+)% points of damage.')
  1066.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1067.             if WSList:contains(match) then
  1068.                 match2 = original:match(''..player.name..' uses '..match..'.'..player.target.name..' takes ([%s%w]+)% points of damage.')
  1069.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ WS = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1070.                 parsews(match, player.target.name, match2)
  1071.             end
  1072.         end
  1073.        
  1074.         --------------------------------------------------------------- SHOTS ----------------------------------------------------------------------------------
  1075.         if player.target.name then
  1076.             match = original:match(''..player.target.name..' uses ([%s%w]+)% Shot.The '..player.target.name..' take ([%s%w]+)% points of damage.')
  1077.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1078.             if EleList:contains(match) then
  1079.                 match2 = original:match(''..player.name..' uses '..match..' Shot.The '..player.target.name..' take ([%s%w]+)% points of damage.')
  1080.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1081.                 parse(match, player.target.name, match2)
  1082.             end
  1083.         end
  1084.        
  1085.         if player.target.name then
  1086.             match = original:match(''..player.target.name..' uses ([%s%w]+)% Shot.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1087.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' ] *-*-*-*-*-*-*-*-*')
  1088.             if EleList:contains(match) then
  1089.                 match2 = original:match(''..player.name..' uses '..match..' Shot.The '..player.target.name..' takes ([%s%w]+)% points of damage.')
  1090.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1091.                 parse(match, player.target.name, match2)
  1092.             end
  1093.         end
  1094.        
  1095.         if player.target.name then
  1096.             match = original:match(''..player.name..' uses ([%s%w]+)% Shot.'..player.target.name..' takes ([%s%w]+)% points of damage.')
  1097.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..'  ] *-*-*-*-*-*-*-*-*')
  1098.             if EleList:contains(match) then
  1099.                 match2 = original:match(''..player.name..' uses '..match..' Shot.'..player.target.name..' takes ([%s%w]+)% points of damage.')
  1100.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..' for '..match2..' dmg - on '..player.target.name..' ] *-*-*-*-*-*-*-*-*')
  1101.                 parse(match, player.target.name, match2)
  1102.             end
  1103.         end
  1104.        
  1105.         -- Parsing Melee Acc
  1106.         if WhichParse then
  1107.             match = original:match('Primary Accuracy: ([%s%w]+)% /')
  1108.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..'  ] *-*-*-*-*-*-*-*-*')
  1109.             if match then
  1110.             if WhichParse == "Melee" then
  1111.                 Meleeacc = tostring(match)
  1112.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..WhichParse..' Acc = '..Meleeacc..'  ] *-*-*-*-*-*-*-*-*')
  1113.                 WhichParse = ""
  1114.             end
  1115.             end
  1116.            
  1117.             match = original:match('Ranged Accuracy: ([%s%w]+)% /')
  1118.             --add_to_chat(204, '*-*-*-*-*-*-*-*-* [ SHOT = '..match..'  ] *-*-*-*-*-*-*-*-*')
  1119.             if match then
  1120.             if WhichParse == "Ranged" then
  1121.                 Rangedacc = tostring(match)
  1122.                 add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..WhichParse..' Acc = '..Rangedacc..'  ] *-*-*-*-*-*-*-*-*')
  1123.                 WhichParse = ""
  1124.             end
  1125.             end
  1126.         end
  1127.        
  1128.  
  1129. end)
  1130.  
  1131. -- MAKE A MACRO : /tell <me> check
  1132. function open_coffer()
  1133.     CofferType = "Gr. Velkk Coffer"
  1134.     if player.inventory[CofferType] then
  1135.     NCoffer = player.inventory[CofferType].count
  1136.     bag = windower.ffxi.get_bag_info(0).count
  1137.     max = windower.ffxi.get_bag_info(0).max
  1138.     spots = max-bag
  1139.     if spots > 0 then
  1140.     add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..NCoffer..'x '..CofferType..' to open - Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
  1141.     local nextcommand = ""
  1142.     for i=1, spots do
  1143.         nextcommand = nextcommand .. 'input /item "'..CofferType..'" <me>; wait 2;'
  1144.     end
  1145.     nextcommand = nextcommand .. 'input /tell '..player.name..' check'
  1146.     send_command(nextcommand)
  1147.     else
  1148.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Inventory('..bag..'/'..max..') ] *-*-*-*-*-*-*-*-*')
  1149.     end
  1150.     else
  1151.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ No '..CofferType..' in inventory ] *-*-*-*-*-*-*-*-*')
  1152.     end
  1153. end
  1154.  
  1155.  
  1156. windower.register_event('chat message', function(original, sender, mode, gm)
  1157.     local match
  1158.                
  1159.             ---- Invite checker
  1160.                 --match = original:match(') ([%w]+)%')
  1161.                
  1162.                
  1163.                
  1164.                 if sender == player.name then
  1165.                     if original == "check" then
  1166.                         open_coffer()
  1167.                     elseif original == "wtf" then
  1168.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ One = '..OneValue..' / Two = '..TwoValue..' ] *-*-*-*-*-*-*-*-*')
  1169.                     elseif wsset:contains(original) then
  1170.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Weapons Optimized for '..original..' ] *-*-*-*-*-*-*-*-*')
  1171.                         equip(wset[original])
  1172.                     elseif original == "Melee" or original == "melee" or original == "m" or original == "M" then
  1173.                         Meleeswitch = true
  1174.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Choose your melee acc lvl (1 to 5) ] *-*-*-*-*-*-*-*-*')
  1175.                     elseif original == "Range" or original == "range" or original == "Ranged" or original == "ranged" or original == "R" or original == "r" then
  1176.                         Rangedswitch = true
  1177.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Choose your ranged acc lvl (1 to 3) ] *-*-*-*-*-*-*-*-*')
  1178.                     elseif (original == "1" or original == "2" or original == "3" or original == "4" or original == "5") and Meleeswitch then
  1179.                         Meleelvl = original
  1180.                         sets.engaged.Melee = sets.engaged.M[Meleelvl]
  1181.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ So Melee Acc Lvl '..Meleelvl..' ] *-*-*-*-*-*-*-*-*')
  1182.                         WhichParse = "Melee"
  1183.                         send_command('gs equip sets.engaged.Melee; wait 1; input /checkparam <me>')
  1184.                         Meleeswitch = false
  1185.                     elseif (original == "1" or original == "2" or original == "3") and Rangedswitch then
  1186.                         Rangedlvl = original
  1187.                         sets.midcast.RA = sets.midcast.R[Rangedlvl]
  1188.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ So Ranged Acc Lvl '..Rangedlvl..' ] *-*-*-*-*-*-*-*-*')
  1189.                         WhichParse = "Ranged"
  1190.                         send_command('gs equip sets.midcast.RA; wait 1; input /checkparam <me>')
  1191.                         Rangedswitch = false
  1192.                     elseif original == "switch" or original == "Switch" then
  1193.                         switcher = RollOne
  1194.                         RollOne = RollTwo
  1195.                         RollTwo = switcher
  1196.                         switchvalue = OneValue
  1197.                         OneValue = TwoValue
  1198.                         TwoValue = switchvalue
  1199.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Switching Rolls order. ] *-*-*-*-*-*-*-*-*')
  1200.                     elseif original == "One" or original == "one" or original == "1" then
  1201.                         oneswitch = true
  1202.                         twoswitch = false
  1203.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Choose your FIRST roll. ] *-*-*-*-*-*-*-*-*')
  1204.                     elseif original == "Two" or original == "2" or original == "two" then
  1205.                         twoswitch = false
  1206.                         twoswitch = true
  1207.                         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ Choose your SECOND roll. ] *-*-*-*-*-*-*-*-*')
  1208.                     elseif oneswitch and original then
  1209.                         command=original
  1210.                         target = string.match(command, "(%a+)")
  1211.                         targeto = string.match(command, "%p")
  1212.  
  1213.                         geot = ""
  1214.  
  1215.                         if rollslist:contains(original) then
  1216.                             if RollOne ~= original then
  1217.                                 OneValue = 0
  1218.                             end
  1219.                             RollOne = original
  1220.                             add_to_chat(204,"*-*-*-*-*-*-*-*-* [FIRST Roll is "..original.."] *-*-*-*-*-*-*-*-*")
  1221.                             refresh()
  1222.                             oneswitch = false
  1223.                         end
  1224.                     elseif twoswitch and original then
  1225.                         command=original
  1226.                         target = string.match(command, "(%a+)")
  1227.                         targeto = string.match(command, "%p")
  1228.  
  1229.                         geot = ""
  1230.  
  1231.                        
  1232.                        
  1233.                         if rollslist:contains(original) then
  1234.                             if RollTwo ~= original then
  1235.                                 TwoValue = 0
  1236.                             end
  1237.                             RollTwo = original
  1238.                             add_to_chat(204,"*-*-*-*-*-*-*-*-* [SECOND Roll is "..original.."] *-*-*-*-*-*-*-*-*")
  1239.                             refresh()
  1240.                             twoswitch = false
  1241.                         end
  1242.                     end
  1243.                 end
  1244.                
  1245.                        
  1246.                        
  1247.  
  1248.            
  1249.  
  1250.     return sender, mode, gm
  1251. end)
  1252. wscolk=0
  1253.  
  1254. fps = 1
  1255. sec = 0
  1256. sav = 0
  1257. boo = {}
  1258. windower.register_event('prerender', function()
  1259.     if fps < 30 then
  1260.         fps = fps +1
  1261.     else
  1262.         fps = 1
  1263.     end
  1264.    
  1265.    
  1266.     --if fps == 1 and buffactive['silence'] then
  1267.     --      send_command('input /item "echo drops" '..player.name..'')
  1268.     --end
  1269.    
  1270.     if fps == 1 and buffactive['curse'] then
  1271.             send_command('input /item "holy water" '..player.name..'')
  1272.     end
  1273.    
  1274.     if fps == 1 then
  1275.         refresh()
  1276.        
  1277.         if player.equipment.sub == "Nusku Shield" then
  1278.             if sets.engaged.Melee == sets.engaged.single then
  1279.             else
  1280.                 sets.engaged.Melee = sets.engaged.single
  1281.                 add_to_chat(123, "Single Wield")
  1282.             end
  1283.         else
  1284.             if sets.engaged.Melee == sets.engaged.single then
  1285.                 sets.engaged.Melee = sets.engaged.M["1"]
  1286.                 add_to_chat(123, "Dual Wield")
  1287.                
  1288.             end
  1289.         end
  1290.        
  1291.         if not buffactive['Flurry'] then
  1292.             if sets.precast.RA == sets.precast.RANoFlurry then
  1293.             else
  1294.             add_to_chat(123, "No flurry Anymore")
  1295.             sets.precast.RA = sets.precast.RANoFlurry
  1296.             flurry = 0
  1297.             end
  1298.         end
  1299.        
  1300.         if player.equipment.range == "Armageddon" and buffactive['Aftermath: Lv.3'] then
  1301.             if boo == sets.midcast.RA then
  1302.                
  1303.             else   
  1304.                 add_to_chat(123, "AM3 : CRIT RANGE !!!!!")
  1305.                 boo = sets.midcast.RA
  1306.                 sets.midcast.RA = sets.midcast.RACrits
  1307.             end
  1308.         else
  1309.             if boo == sets.midcast.RA then
  1310.                 add_to_chat(123, "AM3 Off...")
  1311.                 sets.midcast.RA = boo
  1312.                 boo = {}
  1313.             end
  1314.         end
  1315.        
  1316.         -- switching between regen and normal idle
  1317.         if player.hpp < 90 then
  1318.             if sets.idle == sets.idlenormal then
  1319.                 sets.idle = sets.idleregen
  1320.                 add_to_chat(123, "Idle = Regen")
  1321.                 if player.status == "Idle" then
  1322.                     equip(sets.idle)
  1323.                     add_to_chat(123, "Equipping Idle")
  1324.                 end
  1325.             end
  1326.         else
  1327.             if sets.idle == sets.idleregen then
  1328.                 sets.idle = sets.idlenormal
  1329.                 add_to_chat(123, "Idle = Normal")
  1330.                 if player.status == "Idle" then
  1331.                     equip(sets.idle)
  1332.                     add_to_chat(123, "Equipping Idle")
  1333.                 end
  1334.             end
  1335.         end
  1336.        
  1337.         if LeadenObi == "Svelt. Gouriz +1" then
  1338.             if world.weather_element == 18 or world.weather_id == 19 or world.day == "Darksday" or buffactive["Voidstorm"] then
  1339.                 add_to_chat(123, "Anrin Obi Set for Leaden")
  1340.                 LeadenObi = "Anrin Obi"
  1341.             end
  1342.         else
  1343.             if not world.weather_id == 18 and not world.weather_id == 19 and not world.day == "Darksday" and not buffactive["Voidstorm"] then
  1344.                 add_to_chat(123, "Svelt. Gouriz +1 Set for Leaden")
  1345.                 LeadenObi = "Svelt. Gouriz +1"
  1346.             end
  1347.         end
  1348.        
  1349.        
  1350.         --if player.target.name ~= "Frigatebird" and player.target.name ~= "Undergrowth Hornet" then --player.status_id == 0 and not player.target.name or not
  1351.         --  send_command('input /targetbnpc')
  1352.         --end
  1353.        
  1354.     end
  1355.    
  1356.    
  1357.    
  1358. end)
  1359.  
  1360. --tprint(windower.ffxi.get_ability_recasts())
  1361.  
  1362. rollInfo = {}
  1363.     for key, val in pairs(rollInfoTemp) do
  1364.         rollInfo[res.job_abilities:with('english', key .. ' Roll').id] = {key, unpack(val)}
  1365.     end
  1366.  
  1367.     haste = 0
  1368.     flurry = 0
  1369.    
  1370. windower.register_event('action', function(act)
  1371.     if act.category == 6 and table.containskey(rollInfo, act.param) then
  1372.         --This is used later to allow/disallow busting
  1373.         --If you are not the rollActor you will not be disallowed to bust.
  1374.         rollActor = act.actor_id
  1375.         local rollID = act.param
  1376.         local rollNum = act.targets[1].actions[1].param
  1377.         boo = res.job_abilities[rollID].en
  1378.         --rollInfo[rollID][1]
  1379.         add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..boo..' ] *-*-*-*-*-*-*-*-*')
  1380.         if RollOne == boo then
  1381.             OneValue = rollNum
  1382.             add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..RollOne..' = '..OneValue..' ] *-*-*-*-*-*-*-*-*')
  1383.             refresh()
  1384.         elseif RollTwo == boo then
  1385.             TwoValue = rollNum
  1386.             add_to_chat(204, '*-*-*-*-*-*-*-*-* [ '..RollTwo..' = '..TwoValue..' ] *-*-*-*-*-*-*-*-*')
  1387.             refresh()
  1388.         end
  1389.     end
  1390.    
  1391.     --- Tracking Haste and Flurry
  1392.     --check if you are a target of spell
  1393.         local actionTargets = act.targets
  1394.         playerId = windower.ffxi.get_player().id
  1395.         isTarget = false
  1396.         for _, target in ipairs(actionTargets) do
  1397.             if playerId == target.id then
  1398.                 isTarget = true
  1399.             end
  1400.         end
  1401.         if isTarget == true then
  1402.             if act.category == 4 then
  1403.                 local param = act.param
  1404.                 if param == 845 then
  1405.                     add_to_chat(122, 'Flurry Status = Flurry 1')
  1406.                      sets.precast.RA = sets.precast.RAFlurryOne
  1407.                     flurry = 1
  1408.                 elseif param == 846 then
  1409.                     add_to_chat(122, 'Flurry Status = Flurry 2')
  1410.                     sets.precast.RA = sets.precast.RAFlurryTwo
  1411.                     flurry = 2
  1412.                 elseif param == 57 then
  1413.                     add_to_chat(122, 'Haste Status = Haste 1 (Haste)')
  1414.                     haste = 1
  1415.                 elseif param == 511 then
  1416.                     add_to_chat(122, 'Flurry Status = Haste 2 (Haste 2)')
  1417.                     haste = 2
  1418.                 end
  1419.             --Handle Spy Drink
  1420.             elseif act.category == 5 then
  1421.                 if act.param == 5389 then
  1422.                     add_to_chat(122, 'Haste Status = Haste 2 (Spy Drink)')
  1423.                     haste = 2
  1424.                 end
  1425.             --Handle Avatar Haste1/2
  1426.             elseif act.category == 13 then
  1427.                 local param = act.param
  1428.                 --595 haste 1 -602 hastega 2
  1429.                 if param == 595 then
  1430.                     add_to_chat(122, 'Haste Status = Haste 1 (Hastega)')
  1431.                     haste = 1
  1432.                 elseif param == 602 then
  1433.                     add_to_chat(122, 'Haste Status = Haste 2 (Hastega2)')
  1434.                     haste = 2
  1435.                 end
  1436.             end
  1437.         end
  1438.    
  1439. end)
  1440.  
  1441. ringBonus = true
  1442.  
  1443. function RollEffect(rollid, rollnum)
  1444.     if rollnum == 13 then
  1445.         return
  1446.     end
  1447.  
  1448.  
  1449.     --There's gotta be a better way to do this.
  1450.     local rollName = rollInfo[rollid][1]
  1451.     local rollVal = rollInfo[rollid][rollnum]
  1452.    
  1453.  
  1454.  
  1455.     --I'm handling one roll a bit odd, so I need to deal with it seperately.
  1456.     --Which is stupid, I know, but look at how I've done most of this
  1457.     if rollName == "Companion\'s" then
  1458.         local hpVal = rollVal[1]
  1459.         local tpVal = rollVal[2]
  1460.         if gearTable[13] == 28548 or gearTable[14]== 28548 or ringBonus then
  1461.             hpVal =  hpVal + (rollInfo[rollid][16][1]*5)
  1462.             tpVal = tpVal  + (rollInfo[rollid][16][2]*5)
  1463.             ringBonus = true
  1464.         elseif gearTable[13] == 28547 or gearTable[14] == 28547 or ringBonus then
  1465.             hpVal =  hpVal + (rollInfo[rollid][16][1]*3)
  1466.             tpVal = tpVal  + (rollInfo[rollid][16][2]*3)
  1467.             ringBonus = true
  1468.         end
  1469.         return "Pet:"..hpVal.." Regen".." +"..tpVal.." Regain"
  1470.     end
  1471.  
  1472.     --If there's no Roll Val can't add to it
  1473.     if rollVal ~= '?' then
  1474.         if gearTable[13] == 28548 or gearTable[14] == 28548 or ringBonus then
  1475.             rollVal = rollVal + (rollInfo[rollid][16]*5)
  1476.             ringBonus = true
  1477.         elseif gearTable[13] == 28547 or gearTable[14] == 28547 or ringBonus then
  1478.             rollVal = rollVal + (rollInfo[rollid][16]*3)
  1479.             ringBonus = true
  1480.         end
  1481.     end
  1482.     -- Convert Bolters to Movement Speed based on 5.0 being 100%
  1483.     if(rollName == "Bolter\'s") then
  1484.         rollVal = '%.0f':format(100*((5+rollVal) / 5 - 1))
  1485.     end
  1486.  
  1487.     if(rollInfo[rollid][17] ~= nil) then
  1488.         local bonusVal = gearTable[rollInfo[rollid][17][1] ] == rollInfo[rollid][17][2] and rollInfo[rollid][17][3] or 0
  1489.         rollVal = rollVal + bonusVal
  1490.     end
  1491.  
  1492.     return rollVal..rollInfo[rollid][14]
  1493. end
Add Comment
Please, Sign In to add comment