Page 1 of 1

Demystify the backpack

Posted: Sat Nov 24, 2012 5:32 am
by Turbomuemmel
Hello people
excuse my english again.

question 1

Is there a way in the backpack contained items to disenchant the same. The bot has collected.

Thanks in advance

Re: Demystify the backpack

Posted: Sat Nov 24, 2012 9:20 am
by rock5
Do you mean disenchanting looted items? You would have to do a search through your inventory for valid items probably in the onLeaveCombat section of your profile. Probably you would do a search by item type. If "Weapons" or "Armor" then disenchant. Are you happy to disenchant all of those or would you like to omit items of a certain color or number of stats or maybe something else?

Maybe something like this

Code: Select all

inventory:update()
local DisQuality = 1 -- 0 = white / 1 = green etc. Disenchant this color or lower
local DisStatCount = 2 -- Disenchant items with this number of stats or lower.
for i = 61,120 do -- first 2 bags
	local item = inventory.BagSlot[i]
	if item.Available and not item.Empty then 
		if (item:isType("Weapons") and not item:isType("Arrows") and not item:isType("Projectiles")) or
		   (item:isType("Armor") and not item:isType("Amulets")) then
			if DisQuality >= item.Quality and DisStatCount >= #item.Stats then
				player:update()
				if player.Battling then break end
				RoMScript("CastSpellByName(\"Disenchanting\")")
				yrest(100)
				RoMScript("PickupBagItem("..item.BagId..")")
				yrest(3550);
			end
		end
	end
end
This should disenchant all green or white armor and weapons with 2 stats or less in your first 2 bags. It's untested. If using another language besides English you will have to translate Weapons, Arrows, Projectiles, Armor and Amulets. Check out the "itemtypestable.lua" file in the "cache" folder for the translations. You will also have to translate "Disenchanting". It also stops disenchanting if something attacks you.