Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.06 KB | None | 0 0
  1. --!!INIT!!--
  2. include('no_interruptions.lua')
  3. include('spam_protection.lua')
  4. include('how_about_no.lua')
  5. include('organizer-lib')
  6.  
  7. --Command Aliases--
  8. send_command('alias pdt gs c pdt')
  9. send_command('alias mdt gs c mdt')
  10. send_command('alias acc gs c acc')
  11. send_command('alias spi gs c spi')
  12. send_command('alias cp gs c cp')
  13. send_command('alias kite gs c kite')
  14. send_command('bind F12 pdt')
  15. send_command('bind ^F12 kite')
  16. send_command('bind F11 mdt')
  17. send_command('bind ^F9 acc')
  18. send_command('bind F10 spi')
  19. send_command('bind F9 gs c status')
  20. send_command('bind ^` gs c shield')
  21.  
  22.  
  23. -- Called when this job file is unloaded (eg: job change)
  24. function file_unload()
  25. send_command('unbind ^`')
  26. send_command('unbind f9')
  27. send_command('unbind ^f9')
  28. send_command('unbind f11')
  29. send_command('unbind f12')
  30. send_command('unbind ^f12')
  31. send_command('unbind f10')
  32. end
  33.  
  34. --Main()--
  35. function get_sets()
  36.  
  37. TankCape = { name="Rudianos's Mantle", augments={'HP+60','HP+20','Eva.+20 /Mag. Eva.+20','Enmity+10',}}
  38. FCCape = { name="Rudianos's Mantle", augments={'HP+60','HP+20','Eva.+20 /Mag. Eva.+20','"Fast Cast"+10',}}
  39.  
  40. --Command Triggers--
  41.  
  42. PDTTrigger = 1
  43. KITETrigger = 0
  44. MDTTrigger = 0
  45. AccTrigger = 0
  46. SpellInt = 0
  47. CPTrigger = 0
  48.  
  49. ShadowType = 'None'
  50. ShieldType = 'Ochain'
  51.  
  52. target_distance = 6
  53.  
  54. organizer_items = {
  55. main="Brilliance",
  56. main2="Almace",
  57. sub="Aegis",
  58. sub2="Ochain",
  59. ring2="Warp Ring",
  60. ring1="Dim. Ring (Mea)",
  61. }
  62.  
  63. select_default_macro_book()
  64.  
  65. --Idle Sets--
  66.  
  67. sets.Idle = {}
  68.  
  69. sets.Idle.Standard = {
  70. ammo = "Homiliary",
  71. head = "Jumalik Helm",
  72. neck = "Sanctity Necklace",
  73. lear = "Ethereal Earring",
  74. rear = "Infused Earring",
  75. body = "Jumalik Mail",
  76. hands = "Souveran Handschuhs",
  77. rring = "Paguroidea Ring",
  78. lring = "Sheltered Ring",
  79. back = TankCape,
  80. waist = "Flume Belt +1",
  81. legs = "Carmine Cuisses +1",
  82. feet = "Souveran Schuhs"
  83. }
  84.  
  85. sets.Idle.PDT = {
  86. ammo = "Staunch Tathlum",
  87. head = "Souveran Schaller",
  88. neck = "Loricate Torque +1",
  89. lear = "Ethereal Earring",
  90. rear = "Thureous Earring",
  91. body = "Reverence Surcoat +3",
  92. hands = "Souveran Handschuhs",
  93. rring = "Warden's Ring",
  94. lring = "Defending Ring",
  95. back = TankCape,
  96. waist = "Flume Belt +1",
  97. legs = "Chevalier's Cuisses +1",
  98. feet = "Souveran Schuhs"
  99. }
  100.  
  101. sets.Idle.MDT = set_combine(sets.Idle.PDT, {
  102. back = "Reiki Cloak"
  103. })
  104.  
  105. sets.Idle.Regen = sets.Idle.Standard
  106.  
  107. sets.Idle.Refresh = sets.Idle.Standard
  108.  
  109. --Misc Sets--
  110.  
  111. sets.Enmity = {
  112. ammo = "Sapience Orb",
  113. head = "Loess Barbuta +1",
  114. neck = "Unmoving Collar +1",
  115. lear = "Cryptic Earring",
  116. rear = "Friomisi Earring",
  117. body = "Rev. Surcoat +3",
  118. hands = "Souveran Handschuhs",
  119. rring = "Apeile Ring",
  120. lring = "Apeile Ring +1",
  121. back = TankCape,
  122. waist = "Creed Baudrier",
  123. legs = "Cab. Breeches",
  124. feet = "Souveran Schuhs"
  125. }
  126.  
  127. --TP Sets--
  128.  
  129. sets.engaged = {
  130. ammo = "Ginsen",
  131. head = "Carmine Mask +1",
  132. neck = "Asperity Necklace",
  133. lear = "Brutal Earring",
  134. rear = "Telos Earring",
  135. body = "Emet Harness +1",
  136. hands = "Leyline Gloves",
  137. lring = "Hetairoi Ring",
  138. rring = "Petrov Ring",
  139. back = "Phalangite Mantle",
  140. waist = "Windbuffet Belt +1",
  141. legs = "Carmine Cuisses +1",
  142. feet = "Carmine Greaves +1",
  143. }
  144.  
  145. sets.engaged.Acc = set_combine(sets.engaged, {
  146. neck = "Combatant's Torque",
  147. lear = "Digni. Earring",
  148. waist = "Kentarch Belt +1",
  149. lring = "Cacoethic Ring +1",
  150. rring = "Ramuh Ring +1"
  151. })
  152.  
  153. --WS Sets--
  154.  
  155. sets.precast = {}
  156.  
  157. sets.precast.WS = {
  158. ammo = "Floestone",
  159. neck = "Fotia Gorget",
  160. waist = "Fotia Belt",
  161. head = "Carmine Mask +1",
  162. lear = "Brutal Earring",
  163. rear = "Telos Earring",
  164. body = "Emet Harness +1",
  165. hands = "Leyline Gloves",
  166. lring = "Hetairoi Ring",
  167. rring = "Petrov Ring",
  168. back = "Phalangite Mantle",
  169. legs = "Carmine Cuisses +1",
  170. feet = "Carmine Greaves +1",
  171. }
  172.  
  173. sets.precast.WS['Sanguine Blade'] = {
  174. ammo = "Pemphredo Tathlum",
  175. head = "Jumalik Helm",
  176. neck = "Baetyl Pendant",
  177. lear = "Novio Earring",
  178. rear = "Friomisi Earring",
  179. --body = "",
  180. hands = "Leyline Gloves",
  181. lring = "Shiva Ring +1",
  182. rring = "Shiva Ring +1",
  183. --back = "",
  184. waist = "Yamabuki-no-Obi",
  185. --legs = "",
  186. --feet = ""
  187. }
  188.  
  189. --Spells--
  190.  
  191. --Pre Cast--
  192.  
  193. sets.precast.FC = {
  194. ammo = "Sapience Orb",
  195. head = "Carmine Mask",
  196. neck = "Orunmila's Torque",
  197. lear = "Loquac. Earring",
  198. rear = "Odnowa Earring +1",
  199. body = "Rev. Surcoat +3",
  200. hands = "Leyline Gloves",
  201. lring = "Kishar Ring",
  202. rring = "Weather. Ring +1",
  203. back = FCCape,
  204. --waist
  205. legs = "Enif Cosciales",
  206. feet = "Carmine Greaves +1",
  207. }
  208.  
  209. sets.precast['Enhancing Magic'] = set_combine(sets.precast.FC, {
  210. waist = "Siegel Sash",
  211. })
  212.  
  213. sets.precast['Ninjutsu'] = sets.precast.FC
  214.  
  215. sets.precast.FC.Cure = set_combine(sets.precast.FC, {ear1="Nourish. Earring +1",ear2="Mendicant's Earring",body="Jumalik Mail"})
  216.  
  217. --Mid Cast--
  218.  
  219. sets.midcast = {}
  220.  
  221. sets.midcast['Enhancing Magic'] = {
  222. ammo = "Sapience Orb",
  223. head = "Carmine Mask +1",
  224. neck = "Incanter's Torque",
  225. ear1 = "Augment. Earring",
  226. ear2 = "Andoaa Earring",
  227. --body = "Shab. Cuirass +1",
  228. rring = "Stikini Ring",
  229. lring = "Stikini Ring",
  230. waist = "Olympus Sash",
  231. back = "Merciful Cape",
  232. legs = "Carmine Cuisses +1"
  233. }
  234.  
  235. sets.midcast.Phalanx = set_combine(sets.midcast['Enhancing Magic'], {
  236. hands = "Souveran Handschuhs",
  237. feet = "Souveran Schuhs",
  238. })
  239.  
  240. sets.midcast.SpellInterrupt = set_combine(sets.Idle.PDT, {
  241. ammo = "Staunch Tathlum",
  242. head = "Souveran Schaller",
  243. neck = "Willpower Torque",
  244. rear = "Halasz Earring",
  245. --hands = "Rawhide Gloves",
  246. rring = "Evanescence Ring",
  247. waist = "Rumination Sash",
  248. legs = "Founder's Hose",
  249. --feet = "",
  250. })
  251.  
  252. sets.midcast.Cure = set_combine(sets.Enmity, {
  253. head="Souveran Schaller",
  254. body="Jumalik Mail",
  255. neck="Phalaina Locket",
  256. legs="Founder's Hose",
  257. back="Solemnity Cape",
  258. ear1="Nourish. Earring +1",
  259. ear2="Mendicant's Earring",
  260. hands="Macabre Gauntlets +1"})
  261.  
  262. sets.midcast.Flash = set_combine(sets.Enmity, {waist="Goading Belt"})
  263.  
  264. sets.midcast.Enlight = {
  265. ammo = "Sapience Orb",
  266. head = "Jumalik Helm",
  267. neck = "Incanter's Torque",
  268. --ear1 = "Augment. Earring",
  269. --ear2 = "Andoaa Earring",
  270. body = "Rev. Surcoat +3",
  271. rring = "Stikini Ring",
  272. lring = "Stikini Ring",
  273. waist = "Asklepian Belt",
  274. back = "Altruistic Cape",
  275. legs = "Carmine Cuisses +1"
  276. }
  277.  
  278. --Job Abilites--
  279.  
  280. sets.precast.JA = {}
  281.  
  282. sets.precast.JA['Provoke'] = sets.Enmity
  283.  
  284. sets.precast.JA['Invincible'] = set_combine(sets.Enmity, {legs="Cab. Breeches"})
  285.  
  286. sets.precast.JA['Fealty'] = set_combine(sets.Enmity, {body="Cab. Surcoat"})
  287.  
  288. sets.precast.JA['Chivalry'] = set_combine(sets.Enmity, {hands="Cab. Gauntlets"})
  289.  
  290. sets.precast.JA['Cover'] = set_combine(sets.Enmity, {head="Rev. Coronet"})
  291.  
  292. sets.precast.JA['Rampart'] = set_combine(sets.Enmity, {head="Cab. Coronet"})
  293.  
  294. sets.precast.JA['Sentinel'] = set_combine(sets.Enmity, {feet="Cab. Leggings"})
  295.  
  296. sets.precast.JA['Shield Bash'] = set_combine(sets.Enmity, {hands="Cab. Gauntlets"})
  297.  
  298. sets.precast.JA['Intervene'] = sets.precast.JA['Shield Bash']
  299. end
  300.  
  301. --Precast Core--
  302. function precast(spell, action)
  303. if check_ready(spell) then
  304. --Magic--
  305. if spell.action_type == 'Magic' then
  306. precast_magic(spell)
  307. end
  308.  
  309. --Job Ability--
  310. if spell.type == 'JobAbility' then
  311. precast_ja(spell)
  312. end
  313.  
  314. --Weaponskills--
  315. if spell.type == "WeaponSkill" then
  316. precast_weaponskill(spell)
  317. end
  318.  
  319. --AutoCancel Ichi--
  320. if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and
  321. (buffactive['Copy Image (3)'] or buffactive['Copy Image (4+)']) then
  322. cancel_spell()
  323. end
  324.  
  325. --Disability Swap--
  326. if buffactive['terror'] or buffactive['petrification']
  327. or buffactive['stun'] or buffactive['sleep'] then
  328. if MDTTrigger == 1 then
  329. equip(sets.Idle.MDT)
  330. else
  331. equip(sets.Idle.PDT)
  332. end
  333. cancel_spell()
  334. end
  335.  
  336. spam_protection_on(spell)
  337. else
  338. cancel_spell()
  339. end
  340. end
  341.  
  342. --Midcast Core--
  343. function midcast(spell, action)
  344.  
  345. if spell.action_type == "Magic" then
  346. midcast_magic(spell)
  347. end
  348.  
  349. end
  350.  
  351. --Aftercast Core--
  352. function aftercast(spell, action)
  353. if spam_protection_off(spell)then
  354. --Shadow Track--
  355. if string.find(spell.name,'Utsusemi') and not spell.interrupted then
  356. if spell.name == 'Utsusemi: Ichi' then
  357. ShadowType = 'Ichi'
  358. elseif spell.name == 'Utsusemi: Ni' then
  359. ShadowType = 'Ni'
  360. end
  361. end
  362.  
  363. --Aftercast Function Trigger--
  364. if player.status == "Engaged" then
  365. aftercast_engaged()
  366. else
  367. aftercast_idle()
  368. end
  369. end
  370.  
  371. end
  372.  
  373. --Status Change Core--
  374. function status_change(new, old)
  375. if check_ready_status() then
  376. --Aftercast Function Trigger--
  377. if player.status == "Engaged" then
  378. aftercast_engaged()
  379. else
  380. aftercast_idle()
  381. end
  382. end
  383. end
  384.  
  385. --Custom Command Engine--
  386. function self_command(command)
  387.  
  388. --PDT Trigger--
  389. if command == 'pdt' then
  390. if PDTTrigger == 1 then
  391. add_to_chat(170, 'PDT Toggled - Max Damage')
  392. PDTTrigger = 0
  393. else
  394. add_to_chat(170, 'PDT Toggled - Max PDT')
  395. PDTTrigger = 1
  396. end
  397. end
  398.  
  399. --MDT Trigger--
  400. if command == 'mdt' then
  401. if MDTTrigger == 1 then
  402. add_to_chat(170, 'MDT Toggled - Max Damage')
  403. MDTTrigger = 0
  404. else
  405. add_to_chat(170, 'MDT Toggled - Max MDT')
  406. MDTTrigger = 1
  407. end
  408. end
  409.  
  410. --Acc Trigger--
  411. if command == 'acc' then
  412. if AccTrigger == 1 then
  413. add_to_chat(170, 'Acc Toggled - Max Damage')
  414. AccTrigger = 0
  415. else
  416. add_to_chat(170, 'Acc Toggled - Max Acc')
  417. AccTrigger = 1
  418. end
  419. end
  420.  
  421. --SpellInterrupt Trigger--
  422. if command == 'spi' then
  423. if SpellInt == 1 then
  424. add_to_chat(170, 'Spell Interrupt Set Off')
  425. SpellInt = 0
  426. else
  427. add_to_chat(170, 'Spell Interrupt Set On')
  428. SpellInt = 1
  429. end
  430. end
  431.  
  432. --Cap Cape Lock--
  433. if command == 'cp' then
  434. if CPTrigger == 1 then
  435. enable('back')
  436. add_to_chat(170, 'CP Cape Released')
  437. CPTrigger = 0
  438. else
  439. equip({back="Mecisto. Mantle"})
  440. disable('back')
  441. add_to_chat(170, 'CP Cape Locked')
  442. CPTrigger = 1
  443. end
  444. end
  445.  
  446. --Kiting Lock--
  447. if command == 'kite' then
  448. if KITETrigger == 1 then
  449. enable('legs')
  450. add_to_chat(170, 'Kiting Off')
  451. KITETrigger = 0
  452. else
  453. equip({legs="Carmine Cuisses +1"})
  454. disable('legs')
  455. add_to_chat(170, 'Kiting On')
  456. KITETrigger = 1
  457. end
  458. end
  459.  
  460. --Status Reporter--
  461. if command == 'status' then
  462. local msg = 'Trigger Status Report: '
  463. if KITETrigger == 1 then
  464. msg = msg .. 'Kiting On, '
  465. end
  466. if CPTrigger == 1 then
  467. msg = msg .. 'Cp Cape Locked, '
  468. end
  469. if SpellInt == 1 then
  470. msg = msg .. 'Spell Interruption Set On, '
  471. end
  472. if PDTTrigger == 1 then
  473. msg = msg .. 'PDT Set Locked'
  474. else
  475. if MDTTrigger == 1 then
  476. msg = msg .. 'MDT Set Locked'
  477. else
  478. msg = msg .. 'DPS Set Locked'
  479. end
  480. end
  481. add_to_chat(170, msg)
  482. end
  483.  
  484. --Shield Switch--
  485. if command == "shield" then
  486. if ShieldType == 'Ochain' then
  487. ShieldType = 'Aegis'
  488. equip({sub="Aegis"})
  489. add_to_chat(170, 'Aegis Equipped')
  490. else
  491. ShieldType = 'Ochain'
  492. equip({sub="Ochain"})
  493. add_to_chat(170, 'Ochain Equipped')
  494. end
  495. end
  496.  
  497. --Aftercast Function Trigger--
  498. if player.status == "Engaged" then
  499. aftercast_engaged()
  500. else
  501. aftercast_idle()
  502. end
  503.  
  504. end
  505.  
  506. --Subfunction for Magic Precast--
  507. function precast_magic(spell, action)
  508.  
  509. --Ninjutsu--
  510. if spell.skill == 'Ninjutsu' then
  511. equip(sets.precast['Ninjutsu'])
  512.  
  513. --Enhancing--
  514. elseif spell.skill == 'Enhancing Magic' then
  515. equip(sets.precast['Enhancing Magic'])
  516.  
  517. elseif spell.skill == 'Healing Magic' then
  518. if spell.english == "Raise" then
  519. equip(sets.precast.FC)
  520. else
  521. equip(sets.precast.FC.Cure)
  522. end
  523.  
  524. --Default--
  525. else
  526. equip(sets.precast.FC)
  527. end
  528.  
  529. end
  530.  
  531. --Subfunction for Job Ability Precast--
  532. function precast_ja(spell, action)
  533.  
  534. --2hr Trigger--
  535. if spell.english == "Invincible" then
  536. equip(sets.precast.JA['Invincible'])
  537.  
  538. elseif spell.english == "Provoke" then
  539. equip(sets.precast.JA['Provoke'])
  540.  
  541. elseif spell.english == "Fealty" then
  542. equip(sets.precast.JA['Fealty'])
  543.  
  544. elseif spell.english == "Chivalry" then
  545. equip(sets.precast.JA['Chivalry'])
  546.  
  547. elseif spell.english == "Cover" then
  548. equip(sets.precast.JA['Cover'])
  549.  
  550. elseif spell.english == "Rampart" then
  551. equip(sets.precast.JA['Rampart'])
  552.  
  553. elseif spell.english == "Sentinel" then
  554. equip(sets.precast.JA['Sentinel'])
  555.  
  556. elseif spell.english == "Shield Bash" then
  557. equip(sets.precast.JA['Shield Bash'])
  558.  
  559. elseif spell.english == "Intervene" then
  560. equip(sets.precast.JA['Intervene'])
  561.  
  562. --Default--
  563. else
  564. equip(sets.Enmity)
  565. end
  566.  
  567. end
  568.  
  569. --Subfunction for Weapon Skill Precast--
  570. function precast_weaponskill(spell, action)
  571.  
  572. --Sanguine Blade--
  573. if spell.english == "Sanguine Blade" then
  574. equip(sets.precast.WS['Sanguine Blade'])
  575.  
  576. --Default--
  577. else
  578. equip(sets.precast.WS)
  579. --Moonshade Trigger--
  580. if player.tp < 2750 then
  581. equip({lear = 'Moonshade Earring'})
  582. end
  583. end
  584.  
  585. end
  586.  
  587. --Subfunction for Midcast Magic--
  588. function midcast_magic(spell, action)
  589.  
  590. --Cancel Ni Shadows before Ichi--
  591. if spell.name == 'Utsusemi: Ichi' and ShadowType == 'Ni' and (buffactive['Copy Image'] or buffactive['Copy Image (2)']) then
  592. send_command('cancel Copy Image')
  593. send_command('cancel Copy Image (2)')
  594. end
  595.  
  596. if spell.skill == 'Divine Magic' then
  597. if spell.english == "Flash" then
  598. equip(sets.midcast.Flash)
  599. elseif spell.english == "Enlight" or spell.english == "Enlight II" then
  600. equip(sets.midcast.Enlight)
  601. else
  602. equip(sets.Enmity)
  603. end
  604.  
  605. --MidCast Gear for Enhancing Magic--
  606. elseif spell.skill == 'Enhancing Magic' then
  607.  
  608. --Phalanx Trigger--
  609. if spell.english == "Phalanx" then
  610. equip(sets.midcast.Phalanx)
  611. elseif spell.english == "Crusade" then
  612. equip(sets.Enmity)
  613. elseif string.find(spell.english,"Protect") or string.find(spell.english, "Shell") then
  614. equip(sets.Enmity, {rring="Sheltered Ring"})
  615. --Default Enhancing--
  616. else
  617. equip(sets.midcast['Enhancing Magic'])
  618. end
  619.  
  620. elseif spell.skill == 'Healing Magic' then
  621. if spell.english == "Raise" then
  622. equip(sets.Enmity)
  623. else
  624. equip(sets.midcast.Cure)
  625. end
  626.  
  627. --Default--
  628. else
  629. equip(sets.Enmity)
  630. end
  631.  
  632. if spell.english == "Refresh" or string.find(spell.english,'Cure') or string.find(spell.english,'Cura') and spell.target.type == "SELF" then
  633. equip({waist="Gishdubar Sash"})
  634. end
  635.  
  636. if SpellInt == 1 then
  637. equip(sets.midcast.SpellInterrupt)
  638. end
  639.  
  640. end
  641.  
  642. --Aftercast Swap while Idle--
  643. function aftercast_idle()
  644.  
  645. --PDT Swap--
  646. if PDTTrigger == 1 then
  647. equip(sets.Idle.PDT)
  648.  
  649. --MDT Swap--
  650. elseif MDTTrigger == 1 then
  651. equip(sets.Idle.MDT)
  652.  
  653. --Refresh Idle--
  654. elseif player.mpp < 50 then
  655. equip(set_combine(sets.Idle.Standard, {waist = "Fucho-no-Obi"}))
  656.  
  657. --Default--
  658. else
  659. equip(sets.Idle.Standard)
  660. end
  661.  
  662. end
  663.  
  664. --Aftercast Swap for TP--
  665. function aftercast_engaged()
  666.  
  667. --PDT Swap--
  668. if PDTTrigger == 1 then
  669. equip(sets.Idle.PDT)
  670.  
  671. --MDT Swap--
  672. elseif MDTTrigger == 1 then
  673. equip(sets.Idle.MDT)
  674.  
  675. --Acc Swap--
  676. elseif AccTrigger == 1 then
  677. equip(sets.engaged.Acc)
  678.  
  679. --Default--
  680. else
  681. equip(sets.engaged)
  682. end
  683.  
  684. --Disability Swap--
  685. if buffactive['terror'] or buffactive['petrification']
  686. or buffactive['stun'] or buffactive['sleep'] then
  687. if MDTTrigger == 1 then
  688. equip(sets.Idle.MDT)
  689. else
  690. equip(sets.Idle.PDT)
  691. end
  692. end
  693.  
  694. --Wake Up--
  695. if buffactive['sleep'] and player.hp > 100 and player.status == "Engaged" then
  696. equip({head="Frenzy Sallet"})
  697. end
  698.  
  699. end
  700.  
  701. --Buff Function--
  702. function buff_change(buff,gain)
  703.  
  704. --Disability Swap--
  705. if buffactive['terror'] or buffactive['petrification']
  706. or buffactive['stun'] or buffactive['sleep'] then
  707. if MDTTrigger == 1 then
  708. equip(sets.Idle.MDT)
  709. else
  710. equip(sets.Idle.PDT)
  711. end
  712. end
  713.  
  714. --Wake Up--
  715. if buff == "sleep" and player.hp > 100 and player.status == "Engaged" then
  716. equip({head="Frenzy Sallet"})
  717. end
  718.  
  719. end
  720.  
  721.  
  722. -- Select default macro book on initial load or subjob change.
  723. function select_default_macro_book()
  724. -- Default macro set/book
  725. set_macro_page(1, 19)
  726. end
  727.  
  728.  
  729. function set_macro_page(set,book)
  730. if not tonumber(set) then
  731. add_to_chat(123,'Error setting macro page: Set is not a valid number ('..tostring(set)..').')
  732. return
  733. end
  734. if set < 1 or set > 10 then
  735. add_to_chat(123,'Error setting macro page: Macro set ('..tostring(set)..') must be between 1 and 10.')
  736. return
  737. end
  738.  
  739. if book then
  740. if not tonumber(book) then
  741. add_to_chat(123,'Error setting macro page: book is not a valid number ('..tostring(book)..').')
  742. return
  743. end
  744. if book < 1 or book > 20 then
  745. add_to_chat(123,'Error setting macro page: Macro book ('..tostring(book)..') must be between 1 and 20.')
  746. return
  747. end
  748. send_command('@input /macro book '..tostring(book)..';wait .1;input /macro set '..tostring(set))
  749. else
  750. send_command('@input /macro set '..tostring(set))
  751. end
  752. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement