Advertisement
MrTrala

Lord of Elem. - Outdated- Need minor fixes

Dec 7th, 2015
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.91 KB | None | 0 0
  1. --[[
  2.     ExpFARM for Archlight
  3.     Version 1.0
  4.     By Mr Trala
  5. ]]
  6.  
  7. local config = {
  8.     mrid = 11614, -- Id of manarune
  9.     mana = 90, -- Mana x% to use manarune
  10.     emrmana = 60, -- Exana Restoras mana x%
  11.     sdid = 3155, -- Your SD ID (dont change it even if you have infi sd)
  12.     manaspl = 500, -- Mana to use spells
  13.     exaus = 20, -- Exausthed in Seconds (for utamo vita)
  14.     WhiteList = {"Lord Guardian", "Chiro Lavir", "Jliu"},
  15.     healWhiteList = true,
  16.     healParty = false,
  17.     healAlly = false,
  18.     range = 7,
  19.     health = 95,
  20.     method = "exura sio" ,
  21.     Words = {"GO", "go", "come", "COME"},
  22.     Follow = {"Follow me", "Follow", "follow", "Follow", "FOLLOW"},
  23.     DP = {"godp", "GODP", "DP", "dp", "dptorift", "rift", "dp to rift"},
  24.     DROP = {"Drop", "drop", "drp"},
  25.     LEAVE = {"leave", "LEAVE", "logout"},
  26.     leaderName = {"Chiro Lavir", "Mr Trilo"}, -- For cavebot commands
  27.     FriendName = "Mr Trilo" -- For "follow" commands
  28. }
  29.  
  30. local cooldowns = {
  31. -- Don't touch this if you don't know what are you doing
  32.     restor = "exura san",
  33.     masrst = "utura gran",
  34. -- spells
  35.     sprest = "exana restora",
  36.     spmres = "exana gran restora"
  37. }
  38.  
  39. function onSpeak(channel, message)
  40.     -- receives the channel object that called it and the message that was inputted.
  41.     if (message == '/help') then
  42.         channel:SendOrangeMessage('Mr Trala', 'List of commands available:\n'..
  43.         '/start - name of module to start\n'..
  44.         '/stop - name of module to stop\n'..
  45.         '/list - gives you a list of the current modules of the script\n')
  46.     else
  47.         channel:SendOrangeMessage('Mr Trala', 'Invalid command type /help for a list of commands')
  48.     end
  49.     if (message == '/start Utamo') then
  50.         Module.Start("Utamo")
  51.         channel:SendOrangeMessage('Mr Trala', 'The module with the name "ExpFARM" has started.')
  52.     end
  53. end
  54. function onClose(channel)
  55.      -- receives the channel object that called it
  56.      print(channel:Name() .. ' has been closed.')
  57. end
  58. local customChannel = Channel.New('ExpFARM', onSpeak, onClose)
  59. function follow()
  60.     if Self.TargetID() == 0 then
  61.         for name, creature in Creature.iPlayers() do
  62.             if(name == config.FriendName) then
  63.                 Creature.Follow(creature)
  64.                 wait(500)
  65.             end
  66.         end
  67.     else
  68.         for name, creature in Creature.iPlayers() do
  69.             if(name == FriendName) then
  70.                 if(creature:DistanceFromSelf() > config.range) then
  71.                     Self.StopAttack()
  72.                     Creature.Follow(creature)
  73.                     wait(1000)
  74.                 end
  75.             end
  76.         end
  77.     end
  78. end
  79.  
  80. Module('Follow', follow, false)
  81.  
  82. Module('sdtarg', function(mod)
  83. local creature = Creature.GetByID(Self.TargetID())
  84.     if creature:isValid() and creature:isAlive() and creature:isTarget() and Self.ItemCount(3154) >= 1 then
  85.         Self.UseItemWithTarget(3154)
  86.     else
  87.         Self.UseItemWithTarget(config.sdid)
  88.     end
  89. end)
  90.  
  91. Module('Manarune', function(mod)
  92. Self.ManaPercent = function()
  93.     return math.abs(Self.Mana()/(Self.MaxMana()*0.01))
  94. end
  95.     if Self.ManaPercent() <= config.mana then
  96.         Self.UseItem(config.mrid)
  97.     end
  98.    
  99.     if Self.ManaPercent() <= config.emrmana and Self.GetSpellCooldown(cooldowns.masrst) == 0 then
  100.         Self.Cast(cooldowns.spmres, config.manaspl)
  101.     end
  102.    
  103.     if Self.ManaPercent() <= config.emrmana and Self.GetSpellCooldown(cooldowns.restor) == 0 then
  104.         Self.Cast(cooldowns.sprest, config.manaspl)
  105.     end
  106. end)
  107.  
  108. Module('Utamo', function(Mod)
  109.     if(Self.Mana() >= config.manaspl) then
  110.         Self.Cast("utamo vita")
  111.     end
  112.     Mod:Delay((config.exaus * 1000), (config.exaus * 1000) + 500)
  113. end)
  114.  
  115. Module('Sios', function(mod)
  116. local function sio(name)
  117.     if(Self.Mana() >= config.mana)then
  118.         Self.Say("exura huma sio \""..name)
  119.         sleep(math.random(100,200))
  120.     end
  121. end
  122.         for i = CREATURES_LOW, CREATURES_HIGH do
  123.             local creature = Creature.GetFromIndex(i)
  124.             if (creature:isValid()) then
  125.                 if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
  126.                     local name = creature:Name()
  127.                     if(creature:isWarAlly() and config.healAlly) or (creature:isPartyMember() and config.healParty) or (table.find(config.WhiteList, name, false) and config.healWhiteList)then
  128.                         if(creature:DistanceFromSelf() <= config.range) and (creature:HealthPercent() <= config.health)then
  129.                             if(config.method == "exura sio")then
  130.                                 sio(name)
  131.                             else
  132.                                 displayInformationMessage("Unsupported method type in Auto Healer Script!")
  133.                             end
  134.                         end
  135.                     end
  136.                 end
  137.             end
  138.         end
  139.         sleep(math.random(100,300))
  140. end)
  141.  
  142.  
  143. LocalSpeechProxy.OnReceive("Buffs", function(proxy, mtype, speaker, level, text)
  144.     if (table.find(config.Words, text)) and (table.find(config.leaderName, speaker)) then
  145.         Self.Step(EAST)
  146.    
  147.     elseif text == "back" and (table.find(config.leaderName, speaker)) then
  148.         Self.Step(WEST)
  149.         Walker.Goto("riftdp")
  150.         Walker.Start()
  151.    
  152.     elseif (table.find(config.Follow, text)) and (table.find(config.leaderName, speaker)) then
  153.         Module.Start("Follow")
  154.        
  155.     elseif text == "stop" and (table.find(config.leaderName, speaker)) then
  156.         Module.Stop("Follow")
  157.         Self.Step()
  158.        
  159.     elseif text == "exitall" and (table.find(config.leaderName, speaker)) then
  160.         os.exit()
  161.            
  162.     elseif text == "manualdp" and (table.find(config.leaderName, speaker)) then
  163.         Walker.Goto("manualdp")
  164.         Walker.Start()
  165.            
  166.     elseif (table.find(config.DP, text)) and (table.find(config.leaderName, speaker)) then
  167.         Walker.Goto("start")
  168.         Walker.Start()
  169.    
  170.     elseif (table.find(config.DROP, text)) and (table.find(config.leaderName, speaker)) then
  171.         Self.CloseContainers()
  172.         Self.OpenMainBackpack()
  173.         Self.DropItem(911, 1075, 6, 11372)
  174.        
  175.     elseif (table.find(config.LEAVE, text)) and (table.find(config.leaderName, speaker)) then
  176.         Walker.Goto("Leave")
  177.         Walker.Start()
  178.     end
  179.    
  180. end)
  181.  
  182. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  183. function onWalkerSelectLabel(labelName)
  184.        
  185.     if (labelName == "stop") then
  186.         Walker.Stop()
  187.  
  188.         elseif (labelName == "firstpause") then
  189.             Walker.Stop()
  190.        
  191.         elseif (labelName == "pause1") then
  192.             Walker.Stop()
  193.            
  194.         elseif (labelName == "end2") then
  195.         os.exit()
  196.         Walker.Stop()
  197.     end
  198. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement