Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---------------------------- ZMIENNE ---------------------------------
- ---- SUPPLE ----
- local manaPotionName = "Mana Potion"
- local manaPotionAmmount = 200
- local manaPotionLeaveAmmount = 100
- local manaPotionID = Item.GetID(manaPotionName)
- local healthPotionName = "Supreme Health Potion"
- local healthPotionAmount = 50
- local healthPotionLeaveAmmount = 35
- local healthPotionID = Item.GetID(healthPotionName)
- ---- SUPPLE ----
- ---- PLECAKI ----
- local rashidBP = "Grey Backpack"
- local suppliesBP = "Purple Backpack"
- local stackBP = "Camouflage Backpack"
- local greenBP = "Green Backpack"
- local blueBP = "Blue Backpack"
- ---- PLECAKI ----
- ---- SORTOWANIE ----
- local Items = {manaPotionID, healthPotionID}
- local MainBP = "Backpack"
- local suppleBP = "Purple Backpack"
- ---- SORTOWANIE ----
- --- PRYWATNE WIADOMOSCI ---
- local title = "Prywatne wiadomosci:"
- local showTitle = true
- local messageCount = 4
- local messageLength = 60
- local location =
- {
- x = 0,
- y = 250
- }
- local colors =
- {
- message = {95, 247, 247},
- title = {225, 225, 225},
- }
- local HUDData = {}
- --- PRYWATNE WIADOMOSCI ---
- --- SOFTY ---
- local Mana = 5000000 -- Ilosc many od ktorej zalozyc softy
- --- SOFTY ---
- dropVials = true
- local Info = [[~~~~ROSHAMUUL - LOWER [EK], made by Sasyia~~~~
- Start Yalahar Depot +1]]
- print(Info)
- ---------------------------- ZMIENNE ---------------------------------
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- function onWalkerSelectLabel(labelName)
- ---------------------------- MISC ------------------------------
- if (labelName == "Start") then
- Walker.ConditionalGoto((Self.Position().z == 9), "BeginHunt", "ReachDepot")
- elseif (labelName == "Checker") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "BeginHunt")
- elseif (labelName == "Checker1") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue1")
- elseif (labelName == "Checker2") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue2")
- elseif (labelName == "Checker3") then
- Walker.ConditionalGoto((Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) or (Self.ItemCount(manaPotionID) <= manaPotionLeaveAmmount), "Leave", "Continue3")
- elseif (labelName == "DepositItems") then
- Self.ReachDepot()
- Self.DepositItems()
- elseif (labelName == "ResetBps") then
- Walker.Stop()
- Self.CloseContainers()
- Self.OpenMainBackpack(true):OpenChildren({suppliesBP, true}, {stackBP,true}, {greenBP, true}, {blueBP,true}, {rashidBP,true})
- Container.GetFirst():Minimize()
- Walker.Start()
- elseif (labelName == "YalaShipDoors") then
- Walker.Stop()
- Self.UseDoor(32817, 31275, 6, close)
- Walker.Start()
- elseif (labelName == "SellVials") then
- setBotEnabled(false)
- Self.SayToNpc({"Hi", "Trade"}, 65)
- wait(1000,2000)
- local ITEMS_TO_SELL = {285}
- for _, ITEM in ipairs(ITEMS_TO_SELL) do
- Self.ShopSellAllItems(ITEM)
- wait(300, 500)
- end
- setBotEnabled(true)
- Self.SayToNpc("bye", 65)
- elseif (labelName == "Jewels") then
- setBotEnabled(false)
- Self.SayToNpc({"Hi", "Trade"}, 65)
- wait(1000,2000)
- local ITEMS_TO_SELL = {"Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
- "Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
- "Red Crystal Fragment","Small Sapphire","Violet Crystal Shard"}
- for _, ITEM in ipairs(ITEMS_TO_SELL) do
- Self.ShopSellAllItems(ITEM)
- wait(300, 500)
- end
- setBotEnabled(true)
- Self.SayToNpc("bye", 65)
- ---------------------------- MISC ------------------------------
- ---------------------------- NPCS ------------------------------
- elseif (labelName == "Supplies") then
- Walker.Stop()
- if (Self.ItemCount(manaPotionID) < manaPotionAmmount) or (Self.ItemCount(healthPotionID) <= healthPotionLeaveAmmount) then
- Self.SayToNpc({"hi", "flasks"}, 100)
- while (Self.ItemCount(FlaskID) >= 1) or (Self.ItemCount(FlaskIDA) >= 1) or (Self.ItemCount(FlaskIDB) >= 1) do
- Self.SayToNpc("yes", 100)
- end
- wait(2000)
- Self.SayToNpc("Trade", 100)
- wait(2000)
- while (Self.ItemCount(manaPotionID) < manaPotionAmmount) do
- Self.ShopBuyItemsUpTo(manaPotionID, manaPotionAmmount)
- wait(500,800)
- end
- while (Self.ItemCount(healthPotionID) < healthPotionAmount) do
- Self.ShopBuyItemsUpTo(healthPotionID, healthPotionAmount)
- wait(500,800)
- end
- end
- Walker.Start()
- ---------------------------- NPCS ------------------------------
- elseif (labelName == "DropJewels") then
- Walker.Stop()
- Self.DropItems(33244,32474,6,"Small Emerald","Small Ruby","Small Diamond","Small Amethyst","Black Pearl","White Pearl",
- "Blue Crystal Shard","Blue Crystal Splinter","Brown Crystal Splinter","Cyan Crystal Fragment",
- "Giant Shimmering Pearl","Gold Ingot","Green Crystal Fragment","Green Crystal Shard","Green Crystal Splinter",
- "Opal","Red Crystal Fragment","Small Enchanted Amethyst","Small Enchanted Emerald","Small Enchanted Ruby","Small Enchanted Sapphire",
- "Small Sapphire","Small Topaz","Tiger Eye","Violet Crystal Shard", 1)
- Walker.Start()
- --------------------------- TRAVELS ----------------------------
- elseif (labelName == "Rosha") then
- if(Self.Position().x == 33494 and Self.Position().y == 32567 and Self.Position().z == 7) then
- sleep(2000)
- Self.SayToNpc({"hi","roshamuul","yes"}, 100)
- if (Self.Position().x == 32310 and Self.Position().y == 32210 and Self.Position().z == 6) then
- Walker.Start()
- end
- end
- elseif (labelName == "Thais") then
- if(Self.Position().x == 32309 and Self.Position().y == 32207 and Self.Position().z == 6) then
- sleep(2000)
- Self.SayToNpc({"hi","thais","yes"}, 100)
- if (Self.Position().x == 33494 and Self.Position().y == 32567 and Self.Position().z == 7) then
- Walker.Start()
- end
- end
- elseif (labelName == "Yala") then
- if(Self.Position().x == 32309 and Self.Position().y == 32207 and Self.Position().z == 6) then
- sleep(2000)
- Self.SayToNpc({"Hi","yalahar","yes"}, 1000)
- if (Self.Position().x == 32816 and Self.Position().y == 31272 and Self.Position().z == 6) then
- Walker.Start()
- end
- end
- --------------------------- TRAVELS ----------------------------
- elseif(labelName == "CheckRosha") then
- if (Self.Position().x == 32309 and Self.Position().y == 32208 and Self.Position().z == 6) then
- gotoLabel("Thais")
- end
- elseif(labelName == "CheckYala") then
- if (Self.Position().x == 32309 and Self.Position().y == 32208 and Self.Position().z == 6) then
- gotoLabel("Yala")
- end
- elseif(labelName == "CheckThais") then
- if (Self.Position().x == 33495 and Self.Position().y == 32566 and Self.Position().z == 7) then
- gotoLabel("Rosha")
- end
- end
- end
- ------------------------- DEPOSITER ----------------------------
- 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("Depots found: " .. 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("Something is blocking the path. Trying next depot.")
- end
- end
- return false
- end
- repeat
- reachedDP = gotoDepot()
- if reachedDP then
- return true
- end
- tries = tries - 1
- sleep(100)
- print("Attempt to reach depot was unsuccessfull. " .. tries .. " tries left.")
- 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
- return store
- end
- ------------------------- DEPOSITER ----------------------------
- ---------------------- WYWALANIE SMIECI -------------------------
- Module.New('itemdrop', function(mod)
- mainBP = Container.New(0)
- local DROP_ITEMS = {"empty potion flask"}
- local pos = Self.Position()
- if mainBP:isOpen() then
- for spot, item in mainBP:iItems() do
- if table.find(DROP_ITEMS, Item.GetName(item.id)) then
- mainBP:MoveItemToGround(spot, pos.x, pos.y, pos.z)
- end
- end
- end
- end)
- ----------------------- WYWALANIE SMIECI ------------------------
- --------------------- SORTOWANIE SUPPLI --------------------
- Module.New("Sort Supplies", function()
- local bp1 = Container(MainBP)
- for spot, item in bp1:iItems() do
- if (table.contains(Items, item.id)) then
- bp1:MoveItemToContainer(spot, Container.New(suppleBP):Index())
- break
- end
- end
- end)
- --------------------- SORTOWANIE SUPPLI --------------------
- --------------------- PRYWATNE WIADOMOSCI --------------------
- if (showTitle == true) then
- local HUDTitle = HUD.CreateTextDisplay(location.x, location.y, title, unpack(colors.title))
- location.y = location.y + 20
- end
- for index = 1, messageCount do
- local data = {}
- data.message = ""
- data.label = HUD.CreateTextDisplay(
- location.x,
- location.y + ((index - 1) * 12),
- data.message,
- unpack(colors.message)
- )
- HUDData[index] = data
- end
- PrivateMessageProxy.OnReceive("pmProxy", function (proxy, speaker, level, text)
- local message = speaker .. " [" .. level .. "]: " .. text
- if (string.len(message) > messageLength) then
- message = string.sub(message, 0, messageLength - 3) .. "..."
- end
- for index = 1, messageCount-1 do
- HUDData[index].message = HUDData[index+1].message
- HUDData[index].label:SetText(HUDData[index].message)
- end
- HUDData[messageCount].message = message
- HUDData[messageCount].label:SetText(message)
- end)
- --------------------- PRYWATNE WIADOMOSCI --------------------
- --------------------- ZAKLADANIE SOFTOW --------------------
- Module.New("SoftSwitcher", function(Softs)
- if (Self.Feet().id ~= 3549) and (Self.ItemCount(6529) >= 1) and (Self.Mana() <= Mana) and (Self.isInPz() == false) then
- Self.Equip(6529, "feet")
- end
- Softs:Delay(200 * math.random(3,15))
- end)
- --------------------- ZAKLADANIE SOFTOW --------------------
- ----------------------- LOOTER OFF -------------------------
- Module.New('LooterOnOff', function()
- local _lootCap = 120
- if (Self.Cap() <= _lootCap) then
- Looter.Stop()
- else
- Looter.Start()
- end
- end)
- ----------------------- LOOTER OFF -------------------------
- Module.New('DropVials', function()
- if dropVials and Self.Cap() < 300 then
- pos = Self.Position()
- Self.DropFlasks(pos.x, pos.y, pos.z)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement