How to detect a recipe is learned or not? --solved--
Posted: Tue Nov 13, 2012 10:36 am
i want to write a little function that scans my bags, and when it encounters a recipe, it checks if its allready learned, if it is, i add it to lootfilter with a slash script, else i add it to lootfilter and use it.
this will learn them automaticly and keep my bags clean :3
but i am stuck on the part of detecting the learned state...
Botje
edit, instead of relying on lootfilter, i can also thrash them ofcourse...
thanx rock, here is my final version
this will learn them automaticly and keep my bags clean :3
but i am stuck on the part of detecting the learned state...
Botje
edit, instead of relying on lootfilter, i can also thrash them ofcourse...
thanx rock, here is my final version
Code: Select all
function LearnRecipe(drop) -- true or false
inventory:update();
if drop == nil then drop = false
for i, item in pairs(inventory.BagSlot) do
if item:isType("Recipes") then
if RoMScript("GetCraftItemInfo("..item.Id..")") == nil then -- Don't have it
printf("Learning recipe: "..item.Name.."\n");
logInfo("LearnRecipe", "Learning recipe: " ..item.Name.. "." , true)
item:use();
yrest(5000);
else
if drop == true then
printf("Deleting Recipe: "..item.Name.."\n");
item:delete()
end
end
end
end
end