Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- [[ Quiver functions
- -- examples of it's utilitation. ]]
- local quiverConfig = {
- ["defaultContainer"] = "Jewelled Backpack",
- ["quiverContainer"] = "Red Quiver",
- ["ammunitionID"] = {25757, 25758},
- ["labelAfter"] = "openQuiver", -- Label that's after your label to open containers.
- ["huntCheck"] = true, -- If you want to check if your quiver's open while hunting.
- ["huntLabel"] = "huntQuiver" -- Label that you'll be using to check while hunting.
- }
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- function onWalkerSelectLabel(scriptExamples)
- if scriptExamples == quiverConfig["labelAfter"] then
- -- Checks if the quiver container it's open
- if (Container(quiverConfig["quiverContainer"]):isOpen() == false) then
- -- If container it's not open, will proceed to open it
- Self.UseItemFromEquipment("shield")
- end
- elseif scriptExamples == quiverConfig["huntLabel"] then
- -- Checks if the option it's enabled or not
- if quiverConfig["huntCheck"] == true then
- -- If it's enabled, will check if quiver it's open or not
- if (Container(quiverConfig["quiverContainer"]):isOpen() == false) then
- -- If container it's not open, will proceed to open it
- Self.UseItemFromEquipment("shield") -- Opens the quiver
- end
- end
- end
- end
- Module.New("sort|SpecialAmmo", function()
- local defaultContainer = Container(quiverConfig["defaultContainer"])
- local quiverContainer = Container(quiverConfig["quiverContainer"])
- for spot, item in defaultContainer:iItems() do
- if (table.contains(quiverConfig["ammunitionID"], item.id) and not quiverContainer:isFull()) then
- defaultContainer:MoveItemToContainer(spot, Container.New(quiverConfig["quiverContainer"]):Index())
- break
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement