Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local quiverConfig = {
- ["ammunitionID"] = {25757, 25758, 15793}, -- Ammunition IDs. (Do not use names)
- ["huntCheck"] = true -- Do you want to check if quiver's open while hunting? (true/false)
- }
- registerEventListener(WALKER_SELECTLABEL, "onWalkerSelectLabel")
- function onWalkerSelectLabel(KiNGTiNScripts)
- if KiNGTiNScripts == "quiver|Check" then -- Here you have to add your label name, else use this one
- -- Checks if the quiver container it's open
- if (Container(Item.GetName(Self.Shield().id)):isOpen() == false) then
- -- If container it's not open, will proceed to open it
- --ch:SendYellowMessage("Quiver", "It's not open, re-openning.")
- Self.UseItemFromEquipment("shield")
- end
- elseif KiNGTiNScripts == "quiver|Hunt" then -- Here you have to add your label name, else use this one
- -- 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(Item.GetName(Self.Shield().id)):isOpen() == false) then
- -- If container it's not open, will proceed to open it
- --ch:SendYellowMessage("Quiver", "It's not open, re-openning.")
- Self.UseItemFromEquipment("shield") -- Opens the quiver
- end
- end
- end
- end
- Module.New("quiver|Sorting", function(mod)
- local ammoTypes = quiverConfig["ammunitionID"]
- local quiverName = Item.GetName(Self.Shield().id)
- for i = 0, #Container.GetAll() do
- search = Container.New(i)
- cont = Container.New(quiverName)
- for spot = 0, cont:ItemCount() do
- local item = search:GetItemData(spot)
- if cont:isOpen() and search:Name() ~= cont:Name() and table.find(ammoTypes, item.id) and not cont:isFull() then
- print("Moving items...")
- search:MoveItemToContainer(spot, cont:Index(), 0, 500)
- end
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement