Advertisement
Guest User

Untitled

a guest
May 21st, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 21.71 KB | None | 0 0
  1. local zaehlermanashield = 0
  2. local ssaActive = false
  3. local useSsa = false
  4. local eRingActive = false
  5. local useEring = false
  6. local _config = {}
  7. local hunting = false
  8. local leave = false
  9. local gruppe = false
  10. local gruppenZaehler = 0
  11.  
  12. local waypointNamenFuerWeg =
  13. {
  14. "SvarYakchal-weg"
  15. }
  16.  
  17. local waypointNamenFuerNorm =
  18. {
  19. "SvarYakchal"
  20. }
  21.  
  22. local allowedSenders =
  23. {
  24. "Druiddieswas",
  25. "Chupa Meu Pau",
  26. "Koohl"
  27. }
  28.  
  29. local logout = false
  30. local FOLDER_CONFIG_PATH = '..\\Configs\\'
  31. local manaShield = Module.New('manashield', 'manaFunction', false)
  32. local softEquipper = Module.New('softequipper', 'checkSoftBoots', false)
  33. registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
  34.  
  35. local configHash = "25dac5c951a471f048c5a8bcbfc93d9c"
  36. local LIB_CONFIG = string.reverse([[= niMhtlaeh
  37. = xaMhtlaeh
  38. = esUhtlaeh
  39. 5 = niManam
  40. 001 = xaManam
  41. noitop anam etamitlu = esUanam
  42. 01 = niMdoof
  43. 003 = xaMdoof
  44. moorhsum nworb = esUdoof
  45. ]toBevaC[
  46.  
  47. kcapkcab elprup = kcapkcaBgniRe
  48. kcapkcab yerg = kcapkcaBass
  49.                                     kcapkcab eulb = 4pb
  50.     tobevaC ni sylppuS ;                                xob ssehc naoaZ = 3pb
  51.                                     kcapkcab dellewej = 2pb
  52. !ereh og stoobtfoS ;                                kcapkcab hcaeb = 1pb
  53. ]skcapkcaB[
  54.  
  55. 6003 = gniRmron
  56. 18912 = stooBmron
  57. 01161 = romrAdeeps
  58. 78041 = sgeLdeeps
  59. 86411 = umAmron
  60. 39931 = romrAmron
  61. 99931 = sgeLmron
  62. ]tnempiuqE[
  63. c9d39cfbcb8a5c840f174a159c5cad52:: ;]])
  64.  
  65.  
  66. function onSpeak(ch, m)
  67.     ch:SendYellowMessage(Self.Name(), m)
  68.  
  69.     --[Autofollow]--
  70.     if (string.find( m, "follow") == 1 )  then --and (string.find( m, "stopfollow") == nil) and (string.find( m, "startfollow") == nil)then1
  71.         FriendName = string.sub(m,8)
  72.         ch:SendOrangeMessage("Zentrale", "Following: " .. FriendName .. "!")
  73.         --Module.Start('autofollow')
  74.     elseif (string.find( m, "stopfollow") ~= nil ) then
  75.         Module.Stop('autofollow')
  76.         Self.StopFollow()
  77.         ch:SendOrangeMessage('Zentrale', 'Autofollow OFF.')
  78.     elseif (string.find( m, "startfollow") ~= nil ) then
  79.         Module.Start('autofollow')
  80.         ch:SendOrangeMessage('Zentrale', 'Autofollow ON.')
  81.  
  82.     --[Traveling]--    
  83.     elseif (m == 'yala' ) then   
  84.         Self.SayToNpc({"hi", "yalahar", "yes"}, 65)
  85.     elseif (m == 'gray' ) then   
  86.         Self.SayToNpc({"hi", "gray island", "yes"}, 65)
  87.     elseif (m == 'thais' ) then  
  88.         Self.SayToNpc({"hi", "thais", "yes"}, 65)
  89.     elseif (m == 'venore') then
  90.         Self.SayToNpc({"hi", "venore", "yes"}, 65)
  91.     elseif (m == 'edron') then
  92.         Self.SayToNpc({"hi", "edron", "yes"}, 65)
  93.        
  94.     --[Easy Life]--
  95.     elseif (m == 'bp' ) then
  96.         ResetBps()
  97.  
  98. --Speedset
  99.     elseif (m == 'speedset' ) then
  100.         if Self.Legs().id ~= _config['Equipment']['speedLegs'] and Self.ItemCount(_config['Equipment']['speedLegs']) > 0 then
  101.             Self.Equip(_config['Equipment']['speedLegs'], "legs")
  102.         end
  103.         if Self.Armor().id ~= _config['Equipment']['speedArmor'] and Self.ItemCount(_config['Equipment']['speedArmor']) > 0 then
  104.             Self.Equip(_config['Equipment']['speedArmor'], "armor")
  105.         end
  106. --Normalset    
  107.     elseif (m == 'normset' ) then
  108.         if  Self.Legs().id ~= _config['Equipment']['normLegs'] and Self.ItemCount(_config['Equipment']['normLegs']) > 0 then
  109.             Self.Equip(_config['Equipment']['normLegs'], "legs")
  110.         end
  111.         if Self.Armor().id ~= _config['Equipment']['normArmor'] and Self.ItemCount(_config['Equipment']['normArmor']) > 0 then
  112.             Self.Equip(_config['Equipment']['normArmor'], "armor")
  113.         end
  114. --DeathAmu
  115.     elseif (m == 'damu' ) then
  116.         if Self.Amulet().id ~= 7532 and Self.ItemCount(7532) > 0 then
  117.             Self.Equip(7532, "amulet")
  118.         end
  119. --NormalAmu
  120.     elseif (m == 'namu' ) then
  121.         if Self.Amulet().id ~= _config['Equipment']['normAmu'] and Self.ItemCount(_config['Equipment']['normAmu']) > 0 then
  122.             Self.Equip(_config['Equipment']['normAmu'], "amulet")
  123.         end
  124.  
  125.     --[Fighting]--
  126. --Manashield
  127.     elseif (m == 'manashield' ) then
  128.         if  (zaehlermanashield == 0) then
  129.             t1 = os.time()
  130.             Self.Cast("utamo vita")
  131.             Module.Start('manashield')
  132.             ch:SendOrangeMessage('Zentrale', 'Manashield ON.')
  133.             --print("mana an")
  134.         end
  135.         if (zaehlermanashield > 0) then
  136.             Module.Stop('manashield')
  137.             zaehlermanashield = 0
  138.             ch:SendOrangeMessage('Zentrale', 'Manashield OFF.')
  139.             --print("mana aus")
  140.         end
  141. --SSA
  142.     elseif (m == 'ssa' ) then
  143.         if not ssaActive then
  144.             Self.Dequip("amulet", bp1)
  145.             wait(200)
  146.             Module.Start("ssaEquip")
  147.             ssaActive = true
  148.             Module.Start("ssaBpOpener")
  149.             ch:SendOrangeMessage('Zentrale', 'StoneSkin ON.')
  150.         else
  151.             Module.Stop("ssaEquip")
  152.             ssaActive = false
  153.             Module.Stop("ssaBpOpener")
  154.             Self.Dequip("amulet", _config['Backpacks']['ssaBackpack'])
  155.             wait(200)
  156.             Self.Equip(_config['Equipment']['normAmu'], "amulet")
  157.             wait(200)
  158.             ch:SendOrangeMessage('Zentrale', 'StoneSkin OFF.')
  159.         end
  160.     elseif (m == 'usessa') then
  161.         if useSsa then
  162.             useSsa = false
  163.             ch:SendOrangeMessage('Zentrale', 'StoneSkin-BP was removed from bpReset.')
  164.             return
  165.         end
  166.         if not useSsa then
  167.             useSsa = true
  168.             ch:SendOrangeMessage('Zentrale', 'StoneSkin-BP was added to bpReset.')
  169.             return
  170.         end
  171. --ering
  172.     elseif (m == 'er' ) then
  173.         if not eRingActive then
  174.             Self.Dequip("ring", _config['Backpacks']['eRingBackpack'])
  175.             wait(200)
  176.             Module.Start("eRingEquip")
  177.             eRingActive = true
  178.             ch:SendOrangeMessage('Zentrale', 'ERing ON.')
  179.         else
  180.             Module.Stop("eRingEquip")
  181.             eRingActive = false
  182.             Self.Dequip("ring", _config['Backpacks']['eRingBackpack'])
  183.             wait(200)
  184.             Self.Equip(_config['Equipment']['normRing'], "ring")
  185.             wait(200)
  186.             ch:SendOrangeMessage('Zentrale', 'ERing OFF.')
  187.         end
  188.  
  189.     elseif (m == 'useering') then
  190.         if useEring then
  191.             useEring = false
  192.             ch:SendOrangeMessage('Zentrale', 'ERing-BP was removed from bpReset.')
  193.             return
  194.         end
  195.         if not useEring then
  196.             useEring = true
  197.             ch:SendOrangeMessage('Zentrale', 'ERing-BP was added to bpReset.')
  198.             return
  199.         end
  200. --softboots
  201.     elseif (m == 'softon') then
  202.         Module.Start("softequipper")
  203.         ch:SendOrangeMessage('Zentrale', 'SoftBoots ON.')
  204.     elseif (m == 'softoff') then
  205.         Module.Stop("softequipper")
  206.         --Self.Dequip("feet", _config['Backpacks']['bp1'])
  207.         Self.Equip(_config['Equipment']['normBoots'], "feet")
  208.         ch:SendOrangeMessage('Zentrale', 'SoftBoots OFF.')
  209. --cavebot
  210.     elseif (m == 'hunting') then
  211.         if not hunting then
  212.             hunting = true
  213.             ch:SendOrangeMessage('Zentrale', 'Stackable-BP was added to bpReset.')
  214.             return
  215.         end
  216.         if hunting then
  217.             hunting = false
  218.             ch:SendOrangeMessage('Zentrale', 'Stackable-BP was removed from bpReset.')
  219.             return
  220.         end
  221.     elseif (m == '/resupply') then
  222.         leave = true
  223.         wait(200)
  224.         ch:SendOrangeMessage('Zentrale', 'Going to resupply after current round.')
  225.     elseif (m == '/logout') then
  226.         logout = true
  227.         wait(200)
  228.         ch:SendOrangeMessage('Zentrale', 'Going to Depot to logout after current round.')
  229.     elseif (m == 'reload') then
  230.         loadConfigFile()
  231.         print("reloaded")
  232. --combos
  233.     elseif (m == 'combo solo') then
  234.         loadSettings('..//settings//combo soloblocker', "Frag Helper")
  235.         wait(500)
  236.         loadSettings('..//settings//combo soloblocker', "Combo Options")
  237.     elseif (m == 'combo kina') then
  238.         loadSettings('..//settings//combo Kinadiesdas', "Frag Helper")
  239.         wait(500)
  240.         loadSettings('..//settings//combo Kinadiesdas', "Combo Options")
  241.     elseif (m == 'combo hero') then
  242.         loadSettings('..//settings//combo Newhero', "Frag Helper")
  243.         wait(500)
  244.         loadSettings('..//settings//combo Newhero', "Combo Options")
  245.     elseif (m == 'combo sean') then
  246.         loadSettings('..//settings//combo Sean Dow', "Frag Helper")
  247.         wait(500)
  248.         loadSettings('..//settings//combo Sean Dow', "Combo Options")
  249.     elseif (m == 'stake') then
  250.         loadSettings('..//settings//woodenstake', "Walker")
  251.     elseif (m == 'weglloyd') then
  252.         loadSettings('..//settings/weglloyd', "Walker")
  253.        
  254.     elseif (m == 'test123') then
  255.         print(LoadWay(1))
  256.     elseif (m == 'test') then
  257.     ch:SendOrangeMessage('Zentrale', 'Position: ' .. Self.Position().x .. ', ' .. Self.Position().y .. ', ' .. Self.Position().z)
  258.     elseif (m == 'manawaste') then
  259.         Module.Start("ManaWaster")
  260.     else
  261.         Self.Say(m)
  262.     end
  263. end
  264.    
  265. Module.New("autofollow", function(n)
  266.         if  Self.TargetID() == 0 then
  267.             local Players = Self.GetSpectators()
  268.                 for i = 1, #Players do
  269.                     if Players[i]:Name() == FriendName then
  270.                         Players[i]:Follow()
  271.                     end
  272.                 end
  273.         end
  274.         n:Delay(500)
  275.         --wait(200)
  276. end, false)
  277.  
  278. --[[Module.New("autofollow", function(mod)
  279.     p = Creature(Follow)
  280.     if not p:isFollowed() then
  281.         p:Follow()
  282.     end
  283.     FollowGuy()
  284.     mod:Delay(600)
  285. end, false)
  286. ]]--                                                                    advanced version
  287.  
  288. --[[Module.New("autofollow", function(mod)
  289. p = Creature(Follow)
  290.  --while p:isOnScreen(true) do
  291.         p = Creature(Follow)
  292.         p:Follow()
  293.         while p:Position().z == Self.Position().z and Self.TargetID()==0 do
  294.             ppos = p:Position()
  295.             if not p:isFollowed() then
  296.                 p:Follow()
  297.             end
  298.         end
  299.         if Self.TargetID() ~= 0 then
  300.             if p:DistanceFromSelf() > MaxDistance then
  301.                 Targeting.Stop()
  302.                 Self.StopAttack()
  303.                 p:Follow()
  304.                 while p:DistanceFromSelf() > MaxDistance do
  305.                     wait(200)
  306.                 end
  307.                 Targeting.Start()
  308.             end
  309.         end
  310.  
  311.         if (p:Position().z-Self.Position().z) < 0 then
  312.             IDS = UpIDs
  313.         else
  314.             IDS = DownIDs
  315.         end
  316.         myZ = Self.Position().z
  317.         scan()
  318.         p:Follow()
  319.     --end
  320.     mod:Delay(600)
  321. end, false)
  322. ]]--                                                                    advanced version
  323.  
  324. Module.New("ssaEquip", function(d)
  325.         if (Self.Amulet().id ~= 3081) and Self.ItemCount(3081) > 0 then
  326.             Self.Equip(3081, "amulet")
  327.         end
  328.         d:Delay(500)
  329. end, false)
  330.  
  331. Module.New("eRingEquip", function(h)
  332.         if (Self.Ring().id ~= 3088) and Self.ItemCount(3051) > 0 then
  333.             Self.Equip(3051, "ring")
  334.         end
  335.         h:Delay(1000)
  336. end, false)
  337.  
  338. Module.New('ssaBpOpener', function(m)
  339.     local cont = Container.New(_config['Backpacks']['ssaBackpack'])
  340.     if (cont:EmptySlots() == cont:ItemCapacity()-1 and Item.isContainer(cont:GetItemData(0).id)) then
  341.         cont:UseItem(0, true)
  342.         print("Opening Next Backpack")
  343.     end
  344.     m:Delay(1000)
  345. end, false)
  346.  
  347. --[[
  348. Module.New('manashield', function()
  349.         zaehlermanashield = zaehlermanashield + 1
  350.         print(zaehlermanashield)
  351.         if  (Self.CanCastSpell("utamo vita")) and ( zaehlermanashield >= 2500)  then
  352.             Self.Cast("utamo vita")
  353.             zaehlermanashield = 0
  354.         end
  355. end, false)
  356. ]]--
  357.  
  358. Module.New("waiter", function()
  359.         t4 = os.difftime(os.time(), t3)
  360.         if t4 >= 60  then
  361.             Targeting.Stop()
  362.             wait(200)
  363.             Walker.Start()
  364.             wait(200)
  365.             Module.Stop('waiter')
  366.         end
  367. end, false)
  368.  
  369. Module.New("ManaWaster", function()
  370. Self.Cast("exevo gran mas frigo")
  371. wait(200)
  372. Self.Cast("exevo gran mas tera")
  373. wait(200)
  374. Self.Cast("utana vid")
  375. wait(200)
  376. Self.Cast("exura vita")
  377. wait(200)
  378. Self.Cast("exevo tera hur")
  379. wait(200)
  380. if Self.ItemCount(Item.GetID(_config['CaveBot']['manaUse'])) <= 10 then
  381. Module.Stop("ManaWaster")
  382. wait(200)
  383. BuyPotions1()
  384. end
  385. end, false)
  386.  
  387. Module.New("SuppMover", function()
  388. local manaPotID = Item.GetID(_config['CaveBot']['manaUse'])
  389. local healthPotID = Item.GetID(_config['CaveBot']['healthUse'])
  390. local items = {manaPotID, healthPotID}
  391. local manaBP = _config['Backpacks']['bp3']
  392. local bp1 = Container(0)
  393.  
  394.     for spot, item in bp1:iItems() do
  395.         if (table.contains(items, item.id)) then
  396.             bp1:MoveItemToContainer(spot, Container.New(manaBP):Index())
  397.         end
  398.        
  399.     end
  400.  
  401. end, false)
  402.  
  403. function manaFunction()
  404.         zaehlermanashield = zaehlermanashield + 1
  405.         --print(zaehlermanashield)
  406.         t2 = os.difftime(os.time(), t1)
  407.         --print(t2)
  408.         if  (Self.CanCastSpell("utamo vita")) and ( t2 >= 120)  then
  409.             Self.Cast("utamo vita")
  410.             zaehlermanashield = 0
  411.             t1 = os.time()
  412.         end
  413. end
  414.  
  415. function checkSoftBoots()
  416.         -- Check softboots
  417.         local playerMana = math.abs((Self.Mana() / Self.MaxMana()) * 100)
  418.         --if _config['Soft Boots']['Mana-Percent'] > 0 then
  419.             local playerBoots = getFeetSlotData().id
  420.             --local inProtectionZone = Self.isInPz()
  421.             local needSoftBoots = (playerMana <= 90)
  422.             local mainbp = _config['Backpacks']['bp1']
  423.             --print(math.ceil(playerMana))
  424.             -- Needs soft boots
  425.             if needSoftBoots then
  426.                 -- Needs to swap normal or worn boots with softboots
  427.                 if playerBoots ~= 3549 then
  428.                     -- Search for soft boots in main backpack
  429.                     local cont = Container.New(mainbp)
  430.                     for spot = 0, cont:ItemCount() - 1 do
  431.                         -- Equip soft boots
  432.                         if cont:GetItemData(spot).id == 6529 then
  433.                             cont:MoveItemToEquipment(spot, "feet", 1)
  434.                             --_script.equipped['feet'] = true;
  435.                             break
  436.                         end
  437.                     end
  438.                 end
  439.             -- Need to swap active or worn softboots with normal boots
  440.             elseif playerBoots == 0 or playerBoots == 3549 or playerBoots == 6530 then
  441.                 -- Search for regular boots
  442.                 --for spot = 0, getContainerItemCount(mainbp) - 1 do
  443.                     -- Equip regular boots
  444.                     if Self.ItemCount(_config['Equipment']['normBoots']) > 0 then
  445.                         Self.Equip(_config['Equipment']['normBoots'], "feet")
  446.                         --_script.equipped['feet'] = false;
  447.                     end
  448.                 --end
  449.             end
  450.         --end
  451.     end
  452.  
  453. function ResetBps()
  454. if hunting then
  455. Walker.Stop()
  456. end
  457.     Self.CloseContainers()
  458.         repeat
  459.             wait(900)
  460.         until (Self.UseItemFromEquipment("backpack") > 0)
  461.             wait (1000)
  462.             Minimize()
  463.             Container.GetFirst():OpenChildren({_config['Backpacks']['bp1'], true}, {_config['Backpacks']['bp2'], true})
  464.             Container.GetFirst():OpenChildren({_config['Backpacks']['bp3'], true}, {_config['Backpacks']['bp4'], true})
  465.             if useSsa then
  466.                 Container.GetFirst():OpenChildren(_config['Backpacks']['ssaBackpack'], true)
  467.                 Minimize()
  468.             end
  469.             if useEring then
  470.                 Container.GetFirst():OpenChildren(_config['Backpacks']['eRingBackpack'], true)
  471.                 Minimize()
  472.             end
  473.             if hunting then
  474.                 Container.GetFirst():OpenChildren(_config['Backpacks']['stackableBackpack'], true)
  475.                 Minimize()
  476.             end
  477.             if hunting then
  478.             Walker.Start()
  479.             end
  480. end
  481.  
  482. function Minimize()
  483.     for x = 0, #Container.GetIndexes() - 1 do
  484.         local bp = Container.GetFromIndex(x)
  485.         bp:Minimize()
  486.         wait(200, 400)
  487.     end
  488. end
  489.  
  490. function onClose(channel)
  491.     print('Please re-execute to begin using it again.')
  492. end
  493.  
  494. function onWalkerSelectLabel(labelName)
  495.  
  496.  
  497.     local func = loadstring(labelName)
  498.     if (func) then func()
  499.     end
  500. end
  501.  
  502. function loadIniFile(file)
  503.         -- Could not load config
  504.         if not file then
  505.             ch:SendOrangeMessage('Zentrale', 'Could not load the config.')
  506.         end
  507.        
  508.         local tbl = {}
  509.         local section
  510.         for line in file:lines() do
  511.             local s = string.match(line, "^%[([^%]]+)%]$")
  512.             if s then
  513.                 section = s
  514.                 tbl[section] = tbl[section] or {}
  515.             end
  516.  
  517.             local key, value = string.match(line, "^([^%s]+)%s+=%s+([^;]+)")
  518.  
  519.             -- If the first try didnt work, check for a multi-word key
  520.             if not key then
  521.                 key, value = string.match(line, '"(.+)"%s+=%s+([^;]*)')
  522.             end
  523.             if key and value then
  524.                 -- Type casting
  525.                 if tonumber(value) ~= nil then
  526.                     value = tonumber(value)
  527.                 else
  528.                     value = string.gsub(value, "^%s*(.-)%s*$", "%1")
  529.                     if value == "true" then
  530.                         value = true
  531.                     elseif value == "false" then
  532.                         value = false
  533.                     -- Transform comma-delimited string to table
  534.                     elseif string.find(value, ',') then
  535.                         value = split(value, ',')
  536.                         for i = 1, #value do
  537.                             value[i] = trim(value[i])
  538.                         end
  539.                     end
  540.                 end
  541.                 if section then
  542.                     if not tbl[section] then
  543.                         tbl[section] = {}
  544.                     end
  545.                     tbl[section][key] = value
  546.                 end
  547.             end
  548.         end
  549.         --print("loadinidone")
  550.         file:close()
  551.         return tbl
  552.     end
  553.  
  554. function loadConfigFile()
  555.         local configName = '[' .. Self.Name() .. '] Zentralev01.ini'
  556.         local configPath = FOLDER_CONFIG_PATH .. configName
  557.        
  558.         local function parse(file)
  559.             local tbl = loadIniFile(file)
  560.            
  561.             _config = tbl
  562.            
  563.         end
  564.  
  565.         -- Open config file
  566.         local file = io.open(configPath, 'r')
  567.        
  568.                 if file then
  569.                
  570.                     local match = false
  571.                    
  572.                         for line in file:lines() do
  573.                        
  574.                             if string.match(line, '^; ::' .. configHash .. '$') then
  575.                            
  576.                                 match = true
  577.                             break
  578.                            
  579.                             end
  580.                            
  581.                         end
  582.                        
  583.                     if not match then
  584.                 ch:SendOrangeMessage('Zentrale', 'Updating script config file...')
  585.                 file:close()
  586.                 file = nil
  587.             end
  588.         end
  589.                 if not file then
  590.             -- Write the embedded config to disk
  591.             local defaultConfig = io.open(configPath, 'w+')
  592.             if defaultConfig then
  593.                 defaultConfig:write(LIB_CONFIG)
  594.                 defaultConfig:close()
  595.             else
  596.                 ch:SendOrangeMessage('Zentrale', 'Could not write default config file.')
  597.             end
  598.             return
  599.         end
  600.        
  601.  
  602.         -- Using existing config
  603.         parse(file)
  604.         --print("parsedone")
  605.     end
  606.  
  607. ---------------
  608. --[[Cavebot]]--
  609. ---------------
  610.  
  611. function WithdrawFood()
  612. Walker.Stop()
  613. local mainBP = Self.Backpack().id
  614. Self.OpenDepot()
  615. Self.ItemCount(Item.GetID(_config['CaveBot']['foodUse']) < _config['CaveBot']['foodMax'])
  616. foodToWithdraw = (_config['CaveBot']['foodMax'] - Self.ItemCount(_config['CaveBot']['foodUse']))
  617. Self.WithdrawItems(2, {Item.GetID(_config['CaveBot']['foodUse']), mainBP, foodToWithdraw})
  618. Walker.Start()
  619. end
  620.  
  621. function BuyPotions()
  622.     Walker.Stop()
  623.         Self.SayToNpc({"Hi", "Trade"}, 65)
  624.         wait(900, 1200)
  625.         Self.ShopBuyItemsUpTo(Item.GetID(_config['CaveBot']['manaUse']), _config['CaveBot']['manaMax'])
  626.         wait(500)
  627.         Self.ShopBuyItemsUpTo(Item.GetID(_config['CaveBot']['healthUse']), _config['CaveBot']['healthMax'])
  628.         wait(500)
  629.         Module.Start('SuppMover')
  630.         Walker.Start()
  631. end
  632.  
  633. function CheckPotions()
  634.     Walker.Stop()
  635.     local manaPotID = Item.GetID(_config['CaveBot']['manaUse'])
  636.     local FoodId = Item.GetID(_config['CaveBot']['foodUse'])
  637.     local ManaMin = _config['CaveBot']['manaMin']
  638.     local FoodMin = _config['CaveBot']['foodMin']
  639.     local healthPotID = Item.GetID(_config['CaveBot']['healthUse'])
  640.     local HealthMin = _config['CaveBot']['healthMin']
  641.     local capMin = _config['CaveBot']['minCap']
  642.         if ((Self.ItemCount(manaPotID) <= ManaMin) or (Self.ItemCount(FoodId) <= FoodMin) or (Self.Cap() <= capMin and capMin > 0 ) or (Self.ItemCount(healthPotID) <= HealthMin and _config['CaveBot']['healthMax'] > 0 ) or (leave or logout)) then
  643.             gotoLabel("ToDepo()")
  644.             if gruppe then
  645.                 local delay = GetDelay()
  646.                 wait(delay*1000)
  647.             end
  648.             wait(200)
  649.             Walker.Start()
  650.             else
  651.             gotoLabel("StartHunt()")
  652.             wait(200)
  653.             Walker.Start()
  654.         end
  655. end
  656.  
  657. function StartHunt()
  658.     Module.Stop('SuppMover')
  659.     wait(200)
  660.     leave = false
  661.     wait(200)
  662.     Targeting.Start()
  663.     Looter.Start()
  664.     print("next round")
  665. end
  666.  
  667. function ToDepo()
  668.     wait(500)
  669.     Looter.Stop()
  670. end
  671.  
  672. function Stop()
  673.     Walker.Stop()
  674. end
  675.  
  676. function CheckLogout()
  677.     Walker.Stop()
  678.     wait(200)
  679.     if logout then
  680.         Self.Logout()
  681.     else
  682.         gotoLabel("ResetBps()")
  683.         wait(200)
  684.         Walker.Start()
  685.     end
  686. end
  687.  
  688. function DepositGold()
  689.         Walker.Stop()
  690.         Self.SayToNpc({"Hi", "deposit all"}, 65)
  691.         wait(900, 1200)
  692.         Self.SayToNpc("yes", 65)
  693.         Walker.Start()
  694. end
  695.  
  696. function LoadWay(welcheMap)
  697. Walker.Stop()
  698.     loadSettings('..//settings//' .. waypointNamenFuerWeg[welcheMap], "Targeting")
  699.     wait(200)
  700.     Targeting.Start()
  701.     Looter.Stop()
  702. Walker.Start()
  703. end
  704.  
  705. function LoadNorm(welcheMap)
  706.  
  707.     loadSettings('..//settings//' .. waypointNamenFuerNorm[welcheMap], "Targeting")
  708.  
  709. end
  710.  
  711. -------------------------
  712. --[[Semi-Afk Teamhunt]]--
  713. -------------------------
  714.  
  715. function Loslegen()
  716.     Targeting.Start()
  717.     wait(500)
  718.     print("next round")
  719. end
  720.  
  721. function Warten()
  722.         Walker.Stop()
  723.         wait(500)
  724.         t3 = os.time()
  725.         Module.Start('waiter') 
  726. end
  727.  
  728. ------------------
  729. --[[Mana Waste]]--
  730. ------------------
  731.  
  732. function BuyPotions1()
  733.         Self.SayToNpc({"Hi", "Trade"}, 65)
  734.         wait(900, 1200)
  735.         Self.ShopBuyItemsUpTo(Item.GetID(_config['CaveBot']['manaUse']), _config['CaveBot']['manaMax'])
  736.         wait(500)
  737.         Module.Start("ManaWaster")
  738. end
  739.  
  740. --------------------------
  741. --[[Gruppen Funktionen]]--
  742. --------------------------
  743.  
  744. function GruppenCheck()
  745.     local manaPotID = Item.GetID(_config['CaveBot']['manaUse'])
  746.     local FoodId = Item.GetID(_config['CaveBot']['foodUse'])
  747.     local ManaMin = _config['CaveBot']['manaMin']
  748.     local FoodMin = _config['CaveBot']['foodMin']
  749.     local healthPotID = Item.GetID(_config['CaveBot']['healthUse'])
  750.     local HealthMin = _config['CaveBot']['healthMin']
  751.     local capMin = _config['CaveBot']['minCap']
  752.         if ((Self.ItemCount(manaPotID) <= ManaMin) or (Self.ItemCount(FoodId) <= FoodMin) or (Self.Cap() <= capMin and capMin > 0 ) or (Self.ItemCount(healthPotID) <= HealthMin and _config['CaveBot']['healthMax'] > 0 )) then
  753.             leave = true
  754.                 for i = 1, #allowedSenders do
  755.                     if allowedSenders[i] ~= Self.Name() then
  756.                         Self.PrivateMessage( allowedSenders[i], "resupply" )
  757.                         wait(200)
  758.                     end
  759.                 end
  760.         end
  761. end
  762.  
  763. function GruppePause()
  764.     Walker.Stop()
  765.     wait(200)
  766.     gruppe = true
  767.     gruppenZaehler = gruppenZaehler + 1
  768.     wait(200)
  769.     for i = 1, #allowedSenders do
  770.         if allowedSenders[i] ~= Self.Name() then
  771.         Self.PrivateMessage( allowedSenders[i], "ready" )
  772.         wait(200)
  773.         end
  774.     end
  775.     Module.Start("GruppenWarter")
  776. end
  777.  
  778. function GetDelay()
  779.     local anz = 1
  780.     for i = 1, #allowedSenders do
  781.         if allowedSenders[i] ~= Self.Name() then
  782.             anz = anz +1
  783.         else
  784.             return anz
  785.         end
  786.     end
  787. end
  788.  
  789. Module.New("GruppenWarter", function(w)
  790.     if gruppenZaehler == #allowedSenders then
  791.         gruppenZaehler = 0
  792.         Walker.Start()
  793.         Module.Stop("GruppenWarter")       
  794.     end
  795.     w:Delay(200)
  796. end, false)
  797.  
  798. PrivateMessageProxy.OnReceive("Private Message Proxy", function(proxy, speaker, level, text)
  799. if text == "ready" and (not allowedSenders or table.find(allowedSenders, speaker) and (speaker ~= Self.Name())) then
  800.     gruppenZaehler = gruppenZaehler + 1
  801.     elseif text == "resupply" and (not allowedSenders or table.find(allowedSenders, speaker)) then
  802.     leave = true
  803.     end
  804. end)
  805.  
  806. ------------
  807. --[[Main]]--
  808. ------------
  809.  
  810. local ch = Channel.New('Zentrale', onSpeak, onClose)
  811. ch:SendOrangeMessage('Zentrale', 'Hallo! Tippe /hilfe um eine liste mit den Befehlen zu erhalten.')
  812. loadConfigFile()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement