adikoss2
01-12-2015, 04:23 PM
---------------------------------
---------FULL AFK OKOLNIR-------------
--------Created By Magov-----------
---------------------------------
local LeaveMana = xx --- Z iloma manasami ma wracać ?
local BuyMana = xx --- Z iloma manasami ma zacząć expić?
local LeaveMana1 = xx --- Z iloma health ma wracać?
local BuyMana1 = xx --- Z iloma health ma zacząć expić?
local LeaveAmmo = xx --- Z iloma (SD) ma wracać?
local BuyAmmo = xx --- Z iloma (SD) ma zacząć expić?
local LeaveCap = 100 --- Opuść exp, jeśli postać będzie miała <tyle cap.
local HideEquipment = true --- Chcesz zminimalizować EQ ?
local ManaName = "Great Mana Potion"
local ManaCost = 50
local AmmoName = "prismatic bolt"
local AmmoCost = 20
-- Backpack Configuration:
local MainBP = "Grey Backpack"
local StackBP = "Blue Backpack"
local LootBP = "Beach Backpack"
local Mana1BP = "Purple Backpack"
local ManaBP = "Orange Backpack"
---------- Depot Setup -----------
local ItemsDepotBP = "Green Backpack"
local StackDepotBP = "Red Backpack"
-- Normal items to deposit
local Items = {"Dragon Slayer", "Tower Shield", "Royal Helmet"}
-- nie dotykac ponizej nooby
local ManaID = Item.GetID(ManaName)
local ManaID1 = Item.GetID(ManaName1)
local AmmoID = Item.GetID(AmmoName)
Looter.Start()
Targeting.Start()
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
local info = [[]]
wait(5000)
print([[
--<Full Afk Okolnir by Magov/Shadowcores>--]])
wait(5000)
function onWalkerSelectLabel(labelName)
if (labelName == "Checker") then
if (Self.ItemCount(ManaPotID) <= ManasToLeave) or (Self.ItemCount(HealthPotID) <= HealthToLeave) or (Self.Cap() < MinCap) then
gotoLabel("Leave")
else
gotoLabel("Hunt")
end
end
elseif (labelName == "Zaczynamy") then
print("Skrypt zrobiony przez Magnusa")
print("Wszelkie problemy zglaszac na vt albo na gg 10729137")
elseif (labelName == "Hard") then
if not Hard then
gotoLabel("AfterHard")
end
elseif (labelName == "Zaczynamy") then
print("Skrypt zrobiony przez Magova")
print("Wszelkie problemy zglaszac na TS3 5.196.17.225 Magov/Adi")
elseif (labelName == "DepositGold") then
-- Deposit Gold, check balance.
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
local withdrawManas1 = math.max(BuyMana1 - Self.ItemCount(ManaID1), 0)*ManaCost1
local withdrawAmmo = math.max(BuyAmmo - Self.ItemCount(AmmoID), 0)*AmmoCost
local total = math.abs(withdrawManas + withdrawAmmo + withdrawManas1)+100000
if total >= 1 then
Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
end
Walker.Start()
elseif (labelName == "BuyAmmo") then
-- Buy Mana Potions
if (Self.ItemCount(AmmoID) < BuyAmmo) then
print("Buying Ammo")
Self.SayToNpc("hi", 100)
wait(1500)
Self.SayToNpc("trade", 100)
wait(100)
while (Self.ItemCount(AmmoID) < BuyAmmo) do
Self.ShopBuyItemsUpTo(AmmoID, BuyAmmo)
wait(300,500)
end
elseif (labelName == "BuyManas") then
-- Buy Mana Potions
if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(ManaID1) < BuyMana1) then
print("Buying manas")
Self.SayToNpc("hi", 100)
wait(1500)
Self.SayToNpc("trade", 100)
wait(100)
while (Self.ItemCount(ManaID) < BuyMana) do
Self.ShopBuyItemsUpTo(ManaID, BuyMana)
wait(300,500)
end
while (Self.ItemCount(ManaID1) < BuyMana1) do
Self.ShopBuyItemsUpTo(ManaID1, BuyMana1)
wait(500)
end
wait(200, 500)
end
elseif (labelName == "TravelGo") then
Self.SayToNpc({"hi","okolnir","yes"}, 65)
elseif (labelName == "TravelBack") then
Self.SayToNpc({"hi","svargrond","yes"}, 65)
elseif (labelName == "ResetBps") then
-- Reset Backpacks
Walker.Stop()
Self.CloseContainers()
Self.OpenMainBackpack()
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(StackBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(LootBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(ManaBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(Mana1BP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(ManaBP):OpenChildren(ManaBP)
Container.GetLast():Minimize()
wait(500,600)
Walker.Start()
elseif (labelName == "OpenToDeposit") then
print("Closing & Opening Containers for depositing")
Self.CloseContainers()
Self.OpenMainBackpack()
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(StackBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(LootBP)
Container.GetLast():Minimize()
wait(500,600)
elseif (labelName == "Depositing") then
--Opening depot & bps
Walker.Stop()
Self.ReachDepot()
wait(500,600)
Container.GetByName("Locker"):OpenChildren({3502, true}) -- Opens depot chest
wait(500,600)
Container.GetByName("Locker"):Close() -- Closes locker
wait(500,600)
Container.GetByName("Depot Chest"):OpenChildren({ItemsDepotBP, true}) -- Opens depot bp for normal items
wait(500,600)
Container.GetByName("Depot Chest"):OpenChildren({StackDepotBP, true}) -- Opens depot bp for stackables
wait(500,600)
while (Container.GetByName(ItemsDepotBP):isFull()) do -- Opening next backpack untill reach non fully filled
Dedi_OpenNextBp(ItemsDepotBP)
wait(200,400)
end
while (Container.GetByName(StackDepotBP):isFull()) do -- Opening next backpack untill reach non fully filled
Dedi_OpenNextBp(StackDepotBP)
wait(200,400)
end
--Depositing items
for i=0,5 do -- Repeat 4 times (put here amount of loot backpacks you have on yourself)
for j=Container.GetByName(LootBP):ItemCount()-1, 0, -1 do -- Checks all slot takens
local ItemName = Item.GetName(Container.GetByName(LootBP):GetItemDa ta(j).id):titlecase()
if table.contains(Items, ItemName) then -- If item is in Item list, move from loot backpack to depot bp)
Container.GetByName(LootBP):MoveItemToContainer(j, Container.GetByName(ItemsDepotBP):Index(), Container.GetByName(ItemsDepotBP):ItemCapacity()-1)
wait(200,400)
end
if Container.GetByName(ItemsDepotBP):isFull() then -- If depot backpack is filled open next
Dedi_OpenNextBp(ItemsDepotBP)
wait(200,400)
end
end
Dedi_OpenNextBp(LootBP) -- Checked all slots in current loot backpack, so open next and repeat looking for items again
wait(200,400)
end
--Depositing stackables
-- Here we have only 1 backpack, so we don't have to repeat it few times
for i=0,5 do
for j=Container.GetByName(StackBP):ItemCount()-1, 0, -1 do
local ItemName = Item.GetName(Container.GetByName(StackBP):GetItemD ata(j).id):titlecase()
if table.contains(Stackable, ItemName) then
Container.GetByName(StackBP):MoveItemToContainer(j , Container.GetByName(StackDepotBP):Index(), Container.GetByName(StackDepotBP):ItemCapacity()-1)
wait(200,400)
end
if Container.GetByName(StackDepotBP):isFull() then
Dedi_OpenNextBp(StackDepotBP)
wait(200,400)
end
end
Dedi_OpenNextBp(StackBP) -- Checked all slots in current loot backpack, so open next and repeat looking for items again
wait(200,400)
end
--Closing bps with items
Container.GetByName(ItemsDepotBP):Close()
wait(200,400)
Container.GetByName(StackDepotBP):Close()
wait(200,400)
Container.GetByName(StackBP):Close()
wait(200,400)
Container.GetByName(LootBP):Close()
wait(200,400)
Walker.Start()
end
end
Self.ReachDepot = function (tries)
local tries = tries or 3
Walker.Stop()
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end
local function gotoDepot()
local pos = Self.Position()
print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
Walker.Start()
return true
end
else
print("To depo jest zajete, szukam dalej.")
end
end
return false
end
repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Nie udalo sie dotrzec do depo... " .. tries .. " szukam dalej.")
until tries <= 0
return false
end
Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
end
I have error in 57 lines can not complete the function.Error: 'end' expected (to close 'function' at line 57) near '<eof>
ENGLISH OR POLISH HELP PLEASE
---------FULL AFK OKOLNIR-------------
--------Created By Magov-----------
---------------------------------
local LeaveMana = xx --- Z iloma manasami ma wracać ?
local BuyMana = xx --- Z iloma manasami ma zacząć expić?
local LeaveMana1 = xx --- Z iloma health ma wracać?
local BuyMana1 = xx --- Z iloma health ma zacząć expić?
local LeaveAmmo = xx --- Z iloma (SD) ma wracać?
local BuyAmmo = xx --- Z iloma (SD) ma zacząć expić?
local LeaveCap = 100 --- Opuść exp, jeśli postać będzie miała <tyle cap.
local HideEquipment = true --- Chcesz zminimalizować EQ ?
local ManaName = "Great Mana Potion"
local ManaCost = 50
local AmmoName = "prismatic bolt"
local AmmoCost = 20
-- Backpack Configuration:
local MainBP = "Grey Backpack"
local StackBP = "Blue Backpack"
local LootBP = "Beach Backpack"
local Mana1BP = "Purple Backpack"
local ManaBP = "Orange Backpack"
---------- Depot Setup -----------
local ItemsDepotBP = "Green Backpack"
local StackDepotBP = "Red Backpack"
-- Normal items to deposit
local Items = {"Dragon Slayer", "Tower Shield", "Royal Helmet"}
-- nie dotykac ponizej nooby
local ManaID = Item.GetID(ManaName)
local ManaID1 = Item.GetID(ManaName1)
local AmmoID = Item.GetID(AmmoName)
Looter.Start()
Targeting.Start()
registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
local info = [[]]
wait(5000)
print([[
--<Full Afk Okolnir by Magov/Shadowcores>--]])
wait(5000)
function onWalkerSelectLabel(labelName)
if (labelName == "Checker") then
if (Self.ItemCount(ManaPotID) <= ManasToLeave) or (Self.ItemCount(HealthPotID) <= HealthToLeave) or (Self.Cap() < MinCap) then
gotoLabel("Leave")
else
gotoLabel("Hunt")
end
end
elseif (labelName == "Zaczynamy") then
print("Skrypt zrobiony przez Magnusa")
print("Wszelkie problemy zglaszac na vt albo na gg 10729137")
elseif (labelName == "Hard") then
if not Hard then
gotoLabel("AfterHard")
end
elseif (labelName == "Zaczynamy") then
print("Skrypt zrobiony przez Magova")
print("Wszelkie problemy zglaszac na TS3 5.196.17.225 Magov/Adi")
elseif (labelName == "DepositGold") then
-- Deposit Gold, check balance.
Walker.Stop()
Self.SayToNpc({"hi", "deposit all", "yes"}, 100)
local withdrawManas = math.max(BuyMana - Self.ItemCount(ManaID), 0)*ManaCost
local withdrawManas1 = math.max(BuyMana1 - Self.ItemCount(ManaID1), 0)*ManaCost1
local withdrawAmmo = math.max(BuyAmmo - Self.ItemCount(AmmoID), 0)*AmmoCost
local total = math.abs(withdrawManas + withdrawAmmo + withdrawManas1)+100000
if total >= 1 then
Self.SayToNpc({"withdraw " .. total, "yes", "balance"}, 100)
end
Walker.Start()
elseif (labelName == "BuyAmmo") then
-- Buy Mana Potions
if (Self.ItemCount(AmmoID) < BuyAmmo) then
print("Buying Ammo")
Self.SayToNpc("hi", 100)
wait(1500)
Self.SayToNpc("trade", 100)
wait(100)
while (Self.ItemCount(AmmoID) < BuyAmmo) do
Self.ShopBuyItemsUpTo(AmmoID, BuyAmmo)
wait(300,500)
end
elseif (labelName == "BuyManas") then
-- Buy Mana Potions
if (Self.ItemCount(ManaID) < BuyMana) or (Self.ItemCount(ManaID1) < BuyMana1) then
print("Buying manas")
Self.SayToNpc("hi", 100)
wait(1500)
Self.SayToNpc("trade", 100)
wait(100)
while (Self.ItemCount(ManaID) < BuyMana) do
Self.ShopBuyItemsUpTo(ManaID, BuyMana)
wait(300,500)
end
while (Self.ItemCount(ManaID1) < BuyMana1) do
Self.ShopBuyItemsUpTo(ManaID1, BuyMana1)
wait(500)
end
wait(200, 500)
end
elseif (labelName == "TravelGo") then
Self.SayToNpc({"hi","okolnir","yes"}, 65)
elseif (labelName == "TravelBack") then
Self.SayToNpc({"hi","svargrond","yes"}, 65)
elseif (labelName == "ResetBps") then
-- Reset Backpacks
Walker.Stop()
Self.CloseContainers()
Self.OpenMainBackpack()
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(StackBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(LootBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(ManaBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(Mana1BP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(ManaBP):OpenChildren(ManaBP)
Container.GetLast():Minimize()
wait(500,600)
Walker.Start()
elseif (labelName == "OpenToDeposit") then
print("Closing & Opening Containers for depositing")
Self.CloseContainers()
Self.OpenMainBackpack()
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(StackBP)
Container.GetLast():Minimize()
wait(500,600)
Container.GetByName(MainBP):OpenChildren(LootBP)
Container.GetLast():Minimize()
wait(500,600)
elseif (labelName == "Depositing") then
--Opening depot & bps
Walker.Stop()
Self.ReachDepot()
wait(500,600)
Container.GetByName("Locker"):OpenChildren({3502, true}) -- Opens depot chest
wait(500,600)
Container.GetByName("Locker"):Close() -- Closes locker
wait(500,600)
Container.GetByName("Depot Chest"):OpenChildren({ItemsDepotBP, true}) -- Opens depot bp for normal items
wait(500,600)
Container.GetByName("Depot Chest"):OpenChildren({StackDepotBP, true}) -- Opens depot bp for stackables
wait(500,600)
while (Container.GetByName(ItemsDepotBP):isFull()) do -- Opening next backpack untill reach non fully filled
Dedi_OpenNextBp(ItemsDepotBP)
wait(200,400)
end
while (Container.GetByName(StackDepotBP):isFull()) do -- Opening next backpack untill reach non fully filled
Dedi_OpenNextBp(StackDepotBP)
wait(200,400)
end
--Depositing items
for i=0,5 do -- Repeat 4 times (put here amount of loot backpacks you have on yourself)
for j=Container.GetByName(LootBP):ItemCount()-1, 0, -1 do -- Checks all slot takens
local ItemName = Item.GetName(Container.GetByName(LootBP):GetItemDa ta(j).id):titlecase()
if table.contains(Items, ItemName) then -- If item is in Item list, move from loot backpack to depot bp)
Container.GetByName(LootBP):MoveItemToContainer(j, Container.GetByName(ItemsDepotBP):Index(), Container.GetByName(ItemsDepotBP):ItemCapacity()-1)
wait(200,400)
end
if Container.GetByName(ItemsDepotBP):isFull() then -- If depot backpack is filled open next
Dedi_OpenNextBp(ItemsDepotBP)
wait(200,400)
end
end
Dedi_OpenNextBp(LootBP) -- Checked all slots in current loot backpack, so open next and repeat looking for items again
wait(200,400)
end
--Depositing stackables
-- Here we have only 1 backpack, so we don't have to repeat it few times
for i=0,5 do
for j=Container.GetByName(StackBP):ItemCount()-1, 0, -1 do
local ItemName = Item.GetName(Container.GetByName(StackBP):GetItemD ata(j).id):titlecase()
if table.contains(Stackable, ItemName) then
Container.GetByName(StackBP):MoveItemToContainer(j , Container.GetByName(StackDepotBP):Index(), Container.GetByName(StackDepotBP):ItemCapacity()-1)
wait(200,400)
end
if Container.GetByName(StackDepotBP):isFull() then
Dedi_OpenNextBp(StackDepotBP)
wait(200,400)
end
end
Dedi_OpenNextBp(StackBP) -- Checked all slots in current loot backpack, so open next and repeat looking for items again
wait(200,400)
end
--Closing bps with items
Container.GetByName(ItemsDepotBP):Close()
wait(200,400)
Container.GetByName(StackDepotBP):Close()
wait(200,400)
Container.GetByName(StackBP):Close()
wait(200,400)
Container.GetByName(LootBP):Close()
wait(200,400)
Walker.Start()
end
end
Self.ReachDepot = function (tries)
local tries = tries or 3
Walker.Stop()
local DepotIDs = {3497, 3498, 3499, 3500}
local DepotPos = {}
for i = 1, #DepotIDs do
local dps = Map.GetUseItems(DepotIDs[i])
for j = 1, #dps do
table.insert(DepotPos, dps[j])
end
end
local function gotoDepot()
local pos = Self.Position()
print("Ilosc znalezionych Depo: " .. tostring(#DepotPos))
for i = 1, #DepotPos do
location = DepotPos[i]
Self.UseItemFromGround(location.x, location.y, location.z)
wait(1000, 2000)
if Self.DistanceFromPosition(pos.x, pos.y, pos.z) >= 1 then
wait(5000, 6000)
if Self.DistanceFromPosition(location.x, location.y, location.z) == 1 then
Walker.Start()
return true
end
else
print("To depo jest zajete, szukam dalej.")
end
end
return false
end
repeat
reachedDP = gotoDepot()
if reachedDP then
return true
end
tries = tries - 1
sleep(100)
print("Nie udalo sie dotrzec do depo... " .. tries .. " szukam dalej.")
until tries <= 0
return false
end
Map.GetUseItems = function (id)
if type(id) == "string" then
id = Item.GetID(id)
end
local pos = Self.Position()
local store = {}
for x = -7, 7 do
for y = -5, 5 do
if Map.GetTopUseItem(pos.x + x, pos.y + y, pos.z).id == id then
itemPos = {x = pos.x + x, y = pos.y + y, z = pos.z}
table.insert(store, itemPos)
end
end
end
end
I have error in 57 lines can not complete the function.Error: 'end' expected (to close 'function' at line 57) near '<eof>
ENGLISH OR POLISH HELP PLEASE