Toggle Auto Loot function
Posted: Sun Nov 23, 2014 9:11 pm
While working on my waypoint file for Sascilia Steppes, I came across a short series of quests involving Fuquash and his henchmen. Now normally I use LootIt to limit the items that I loot from mobs, mostly "$Quest Item" and a range of Green to Orange items. This was going to cause a problem with this series of quests, as you must loot EVERYTHING off these mobs to allow them to de-spawn and for Fuquash to allow you to complete the quest.
So rather than telling LootIt to just loot everything off the dead mobs, I came up with a simple function that will take care of this for me. What it does is reads the current setting of Auto Loot from your preferences and remembers it so that it can make sure Auto Loot is on for these quests, and turns it back off only if you originally had it turned off.
Edit: Fixed the placement of the "local aLoot" line.
So rather than telling LootIt to just loot everything off the dead mobs, I came up with a simple function that will take care of this for me. What it does is reads the current setting of Auto Loot from your preferences and remembers it so that it can make sure Auto Loot is on for these quests, and turns it back off only if you originally had it turned off.
Code: Select all
<!-- This function turns on autoloot regarless of looting add-ons, and resets the original condition when finished. -->
local aLoot
function toggleLoot(_set)
if string.lower(_set) == "set" then
aLoot = RoMScript("IsAutoTakeLoot()")
if aLoot == false then
RoMScript("SetAutoTakeLoot(true)")
end
else
if aLoot == false then
RoMScript("SetAutoTakeLoot(false)")
end
end
end