Advertisement
MrTrala

ArcherU Combo (PRIV Version)

Aug 28th, 2016
1,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 11.04 KB | None | 0 0
  1. --[[
  2.     Combo Archer for ArchlightOnline
  3.     (Private Version) -- Released
  4.     By Mr Trala
  5.    
  6. Thanks to:
  7. Colandus from Otland for the string.explode function.
  8.  
  9. Instructions;
  10. Config your ManaRune, your HealCast and your ManaCast just below here, then
  11. load the script, the rest of the instructions are in the Archer Channel.
  12.  
  13. Change Log;
  14. 2.0 -- First and last Public version of archer script.
  15. 2.0.1 -- Fixed problem after Archlight HP/Mana Update.
  16. 2.0.2 -- Fixed an error in healer.
  17. ]]
  18.  
  19. config = {
  20.     ManaRune = 11632, -- ID of your manarune.
  21.     HealCAST = 95, -- x% hp to cast exura san.
  22.     ManaCAST = 80, -- x% mana to use manarune
  23. }
  24.  
  25. -- Don't touch anything below this line if you don't know what are you doing.
  26. local spells = {
  27.     -- Exaus
  28.     FocusedEX = 'exevo gran mas flam',
  29.     CannoEX = 'exevo vis hur',
  30.     WavesEX = 'exevo dis flam hur', -- Sprays Exaus
  31.    
  32.     -- Words
  33.     FocusedWD = 'Focused Shot',
  34.     GranConWD = 'Exori Gran Con',
  35.     ConWD = 'Energy Cannon',
  36.    
  37.     --Sprays
  38.     ESpray = 'Earth Arrow Spray',
  39.     ISpray = 'Ice Arrow Spray',
  40.     FSpray = 'Flame Arrow Spray',
  41.     ENSpray =  'Energy Arrow Spray'
  42. }
  43.  
  44. function string.trim(str)
  45.     return (str:gsub("^%s*(.-)%s*$", "%1"))
  46. end
  47.  
  48. function string.explode(str, sep, limit)
  49.     if limit and type(limit) ~= 'number' then
  50.         error("string.explode: limit must be a number", 2)
  51.     end
  52.  
  53.     if #sep == 0 or #str == 0 then return end
  54.     local pos, i, t = 1, 1, {}
  55.     for s, e in function() return str:find(sep, pos) end do
  56.         table.insert(t, str:sub(pos, s-1):trim())
  57.         pos = e + 1
  58.         i = i + 1
  59.         if limit and i == limit then break end
  60.     end
  61.     table.insert(t, str:sub(pos):trim())
  62.     return t
  63. end
  64.  
  65. spray = {}
  66. version = '2.0.2F'
  67. function onSpeak(channel, message)
  68.     -- receives the channel object that called it and the message that was inputted.
  69.     if (message == '/list') then
  70.         channel:SendYellowMessage('List of Modules', '\n'..
  71.         'Combo -- Use this one to start the basic combo script, "focused shot, exori gran con and energy cannon".\n'..
  72.         'ComboW -- Same as combo but without Energy Cannon (not "new" spell).\n'..
  73.         'ComboA -- This one will shot an Arrow Spray spell, config which one like this "ComboA, earth" (earth, ice, flame and energy).\n'..
  74.         'Aim -- Auto Aim spell.\n'..
  75.         'Manarune -- Auto use your manarune (enabled by default).\n'..
  76.         'LifeSteal -- LifeSteal renew (enabled by default).\n'..
  77.         'Train -- Use this one to start the training module (exura san + utana vid).\n')
  78.     end
  79.    
  80.     -- Modules
  81.     if (message == '/start Combo') or (message == 'Combo') or (message == 'combo') then
  82.         Module.Start('Combo')
  83.         channel:SendYellowMessage('Mr Trala', 'The module with the name "Combo" has been started.')
  84.        
  85.     elseif (message == '/stop Combo') then
  86.         Module.Stop('Combo')
  87.         channel:SendRedMessage('Mr Trala', 'The module with the name "Combo" has been stopped.')
  88.        
  89.     elseif (message == '/start ComboW') or (message == 'ComboW') or (message == 'combow') then
  90.         Module.Start('ComboW')
  91.         channel:SendYellowMessage('Mr Trala', 'The module with the name "ComboW" has been started.')
  92.    
  93.     elseif (message == '/stop ComboW') then
  94.         Module.Stop('ComboW')
  95.         channel:SendRedMessage('Mr Trala', 'The module with the name "ComboW" has been stopped.')
  96.        
  97.     elseif (message == '/start Aim') or (message == 'Aim') or (message == 'aim') then
  98.         Module.Start('Aim')
  99.         channel:SendYellowMessage('Mr Trala', 'The module with the name "Aim" has been started.')
  100.    
  101.     elseif (message == '/stop Aim') then
  102.         Module.Stop('Aim')
  103.         channel:SendRedMessage('Mr Trala', 'The module with the name "Aim" has been stopped.')
  104.  
  105.     elseif (message == '/start Train') or (message == 'Train') or (message == 'train') then
  106.         Module.Start('Train')
  107.         channel:SendYellowMessage('Mr Trala', 'The module with the name "Train" has been started.')
  108.        
  109.     elseif (message == '/stop Train') or (message == '/stop train') then
  110.         Module.Stop('Train')
  111.         channel:SendRedMessage('Mr Trala', 'The module with the name "Train" has been stopped.')
  112.        
  113.     elseif (message == '/start Manarune') or (message == 'manarune') or (message == 'mr') then
  114.         Module.Start('Manarune')
  115.         channel:SendYellowMessage('Mr Trala', 'The module with the name "Manarune" has been started.')
  116.        
  117.     elseif (message == '/stop Manarune') or (message == '/stop train') then
  118.         Module.Stop('Manarune')
  119.         channel:SendRedMessage('Mr Trala', 'The module with the name "Manarune" has been stopped.')
  120.        
  121.     elseif (message == '/stop ComboA') or (message == '/stop comboa') then
  122.         Module.Stop('ComboAOE')
  123.         channel:SendRedMessage('Mr Trala', 'The module with the name "ComboAOE" has been stopped.')
  124.        
  125.     elseif (message == '/start LifeSteal') or (message == 'LifeSteal') or (message == 'lifesteal') then
  126.         Module.Start('LifeSteal')
  127.         channel:SendYellowMessage('Mr Trala', 'The module with the name "LifeSteal" has been started.')
  128.        
  129.     elseif (message == '/stop LifeSteal') or (message == '/stop lifesteal') then
  130.         Module.Stop('LifeSteal')
  131.         channel:SendRedMessage('Mr Trala', 'The module with the name "LifeSteal" has been stopped.')
  132.        
  133.     end
  134.    
  135.     -- ComboAOE Module
  136.     if (message >= 'ComboA') and string.find(message, "ComboA") then
  137.     local p = string.explode(message, ",")
  138.         if p[2] == '' or not string.find(message, ",") then
  139.             channel:SendRedMessage('Mr Trala', 'Please config which Spray to use like this "ComboA, earth" (earth, ice, flame and energy).')
  140.            
  141.         elseif p[2] == '' or string.find(message, "%d") then
  142.             channel:SendRedMessage('Mr Trala', 'Please config which Spray to use like this "ComboA, earth" (earth, ice, flame and energy).')
  143.            
  144.         else   
  145.             spray = {}
  146.             spray[#spray+1] = {SioT = p[2]}
  147.             Module.Start('ComboAOE')
  148.             channel:SendYellowMessage('Mr Trala', 'The module with the name "ComboAOE" has been started and is going to use '..p[2]..' spray.')
  149.         end
  150.     end
  151. end
  152.  
  153. function ReOpen()
  154. local customChannel = Channel.New('Archer Channel', onSpeak, onClose)
  155. customChannel:SendYellowMessage('Mr Trala', 'Welcome to the Archer Combo Script, configured specifically for ArchlightOnline.\n'..
  156.         'This Script has been made by Mr Trala, and you are using the Version '..version..'\n'..
  157.         'If you found any bug send a message to Mr Trolo or Mr Ponid in Archlight.\n')
  158. customChannel:SendOrangeMessage('Instructions', '\n'..
  159.         'Write /list if you want to see a list of the modules you can use\n'..
  160.         'You can start or stop a Module with the command /start or /stop\n')
  161. end
  162.  
  163. function onClose(channel)
  164.      -- receives the channel object that called it
  165.      print('To close '..channel:Name()..' you need to kill the script.')
  166.      ReOpen()
  167. end
  168.  
  169. local customChannel = Channel.New('Archer Channel', onSpeak, onClose)
  170. customChannel:SendYellowMessage('Mr Trala', 'Welcome to the Archer Combo Script, configured specifically for ArchlightOnline.\n'..
  171.         'This Script has been made by Mr Trala, and you are using the Version '..version..'\n'..
  172.         'If you found any bug send a message to Mr Trolo or Mr Ponid in Archlight.\n')
  173. customChannel:SendOrangeMessage('Instructions', '\n'..
  174.         'Write /list if you want to see a list of the modules you can use\n'..
  175.         'You can start or stop a Module with the command /start or /stop\n')
  176.  
  177. -- Functions of the script.
  178. function Combo()
  179. local creature = Creature.GetByID(Self.TargetID())
  180.     if creature:isValid() and creature:isAlive()  and creature:isTarget() and creature:DistanceFromSelf() <= 6 then
  181.         if Self.GetSpellCooldown(spells.FocusedEX) >= 1 and Self.GetSpellCooldown(spells.GranConWD) >= 1 and Self.GetSpellCooldown(spells.CannoEX) == 0 then
  182.             Self.Cast(spells.ConWD)
  183.             Manarune2()
  184.            
  185.         elseif Self.GetSpellCooldown(spells.FocusedEX) == 0 then
  186.             Self.Cast(spells.FocusedWD)
  187.             Manarune2()
  188.        
  189.         elseif Self.GetSpellCooldown(spells.FocusedEX) >= 1  and Self.GetSpellCooldown(spells.GranConWD) == 0 then
  190.             Self.Cast(spells.GranConWD)
  191.             Manarune2()
  192.         end
  193.     end
  194. end
  195.  
  196. function ComboW()
  197. local creature = Creature.GetByID(Self.TargetID())
  198.     if creature:isValid() and creature:isAlive()  and creature:isTarget() and creature:DistanceFromSelf() <= 6 then        
  199.         if Self.GetSpellCooldown(spells.FocusedEX) == 0 then
  200.             Self.Cast(spells.FocusedWD)
  201.             Manarune2()
  202.        
  203.         elseif Self.GetSpellCooldown(spells.FocusedEX) >= 1  and Self.GetSpellCooldown(spells.GranConWD) == 0 then
  204.             Self.Cast(spells.GranConWD)
  205.             Manarune2()
  206.         end
  207.     end
  208. end
  209.  
  210. exaus = 0
  211.  
  212. function ComboAOE()
  213. for i = 1, #spray do
  214. local f = spray[i]
  215. local shot = f.SioT
  216. local earth = spells.ESpray
  217. local ice = spells.ISpray
  218. local flame = spells.FSpray
  219. local energy = spells.ENSpray
  220. local am = 0
  221. local creature = Creature.GetByID(Self.TargetID())
  222.     for name, c in Creature.iMonsters(3) do
  223.         if c:isValid() and c:isAlive() and not Self.isInPz() and c:isOnScreen()then
  224.             am = am +1
  225.         end
  226.         if creature:isValid() and creature:isAlive()  and creature:isTarget() and creature:DistanceFromSelf() <= 6 and am <= 2 then        
  227.             if Self.GetSpellCooldown(spells.FocusedEX) == 0 then
  228.                 Self.Cast(spells.FocusedWD, 3)
  229.                 Manarune2()
  230.            
  231.             elseif Self.GetSpellCooldown(spells.FocusedEX) >= 1  and Self.GetSpellCooldown(spells.GranConWD) == 0 and am <= 2 then
  232.                 Self.Cast(spells.GranConWD, 3)
  233.                 Manarune2()
  234.             end
  235.         end
  236.  
  237.             if am >= 3 and string.find(shot, "flame") and os.time() - exaus >= math.random(2.03, 2.1) then
  238.                 Self.Cast(flame, 3)
  239.                 exaus = os.time()  
  240.                
  241.             elseif am >= 3 and string.find(shot, "ice") and os.time() - exaus >= math.random(2.03, 2.1) then
  242.                 Self.Cast(ice, 3)
  243.                 exaus = os.time()
  244.                
  245.             elseif am >= 3 and string.find(shot, "energy") and os.time() - exaus >= math.random(2.03, 2.1) then
  246.                 Self.Cast(energy, 3)
  247.                 exaus = os.time()
  248.                
  249.             elseif am >= 3 and string.find(shot, "earth") and os.time() - exaus >= math.random(2.03, 2.1) then
  250.                 Self.Cast(earth, 3)
  251.                 exaus = os.time()
  252.             end
  253.         end
  254.     end
  255. end
  256.  
  257. function Train()
  258.     local spell = "exura san"
  259.     local spell2 = "utana vid"
  260.         if Self.GetSpellCooldown(spell) == 0 and (Self.Mana()>= 10) then
  261.             Self.Say(spell)
  262.         end
  263.        
  264.         if Self.GetSpellCooldown(spell2) == 0 and (Self.Mana()>= 10) then
  265.             Self.Say(spell2)
  266.         end
  267. end
  268. function Manarune2()
  269.     if Self.Health() <= config.HealCAST then
  270.         Self.UseItem(config.ManaRune)
  271.         Self.Say('exura san')
  272.         wait(200, 400)
  273.     end
  274.    
  275.     if Self.Mana() <= config.ManaCAST then
  276.         Self.UseItem(config.ManaRune)
  277.         wait(400, 600)
  278.     end
  279. end
  280. Module('Combo', Combo, false)
  281. Module('ComboW', ComboW, false)
  282. Module('Train', Train, false)
  283. Module('ComboAOE', ComboAOE, false)
  284.  
  285. Module('LifeSteal', function(mod)
  286. local exaus = 'exura gran ico'
  287.     if Self.GetSpellCooldown(exaus) == 0 then
  288.         Self.Cast('Life Steal')
  289.     end
  290. end, true)
  291.  
  292. function AimT()
  293. local mana = 10
  294.     if(Self.Mana() >= mana) then
  295.         Self.Cast("Aim")
  296.     end
  297. end
  298.  
  299. Module.New('Aim', function(Mod)
  300. local exaus = 9
  301.     if Self.CanCastSpell('Utani Hur') then
  302.         AimT()
  303.         Manarune2()
  304.         Mod:Delay((exaus * 1000), (exaus * 1000) + 200)
  305.     end
  306. end, true)
  307.  
  308. Module('Manarune', function(mod)
  309.     if Self.Health() <= config.HealCAST then
  310.         Self.UseItem(config.ManaRune)
  311.         Self.Say('exura san')
  312.         wait(200, 400)
  313.     end
  314.    
  315.     if Self.Mana() <= config.ManaCAST then
  316.         Self.UseItem(config.ManaRune)
  317.         wait(400, 600)
  318.     end
  319. end, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement