------------------------------------------------ -- Use food/pots/items and check for its buff with table support -- JDuarteDJ & Giram -- Version 5 ------------------------------------------------ -- /script n=0 repeat n=n+1 local name, icon, count, ID = UnitBuff( "player", n ) if name then SendSystemChat(name..", "..ID) end until not name -- Known issues -- -- Foods will overwrite each others function useGoodie(_itemName,_buffName) --ofc I came up with a silly name local itemTable ={ --potions giant = {ID = 207199, buffName = 506683, castTime = 0}, -- Fullness(tested) 495637 speed = {ID = 207200, buffName = 506684, castTime = 0}, -- Unbridled Enthusiasm (506684 working) frog = {ID = 207201, buffName = 506685, castTime = 1500}, -- Princely Look (tested) casting = {ID = 207202, buffName = 506686, castTime = 0}, -- Clear Thought (tested) luck = {ID = 207203, buffName = 506687, castTime = 0}, -- Turn of Luck Powder Dust (506687 working) riding = {ID = 207204, buffName = 506685, castTime = 1000}, -- Galloping Gale (506688 = gmatch error, tested) jump = {ID = 207205, buffName = "", castTime = 3000}, -- Crazy breakout (tested) defense = {ID = 207206, buffName = 506690, castTime = 2500}, -- Scarlet Love 506690 (working) agro = {ID = 207207, buffName = 506691, castTime = 1000}, -- Pungent Vileness 506691 (some wait time but no cast time, tested) godspeed = {ID = 207208, buffName = 506692, castTime = 0}, -- Godspeed. Instant cast. 1 min CD. (tested) --foods pdmg = {ID = 207209, buffName = 506673, castTime = 0}, -- Housekeeper Special Salted Fish with Sauce (tested) mdmg = {ID = 207210, buffName = 506674, castTime = 0}, -- 501132, 506674. Housekeeper Special Smoked Bacon with Herbs (tested) critp = {ID = 207211, buffName = 495629, castTime = 0}, -- 501138, 506675. Housekeeper Special Caviar Sandwich 506675 matt = {ID = 207212, buffName = 495630, castTime = 0}, -- 501143, 506676 (both ids are same?). Housekeeper Special Deluxe Seafood patt2 = {ID = 207213, buffName = 495631, castTime = 0}, -- Housekeeper Special Spicy Meatsauce Burrito (tested) mdmg2 = {ID = 207214, buffName = 495632, castTime = 0}, -- Housekeeper Special Delicious Swamp Mix (tested) patt3 = {ID = 207215, buffName = 506679, castTime = 0}, -- 506679. Housekeeper Special Unimaginable Salad (checked) matt3 = {ID = 207216, buffName = 506680, castTime = 0} -- 501145, 506680. Housekeeper Special Cheese Fishcake } local option = itemTable[_itemName] if not option then option = {} if not _buffName then option.buffName = _itemName --Assume both have same name like in mounts else option.buffName = _buffName end option.ID = _itemName --luckily the inventory functions use Name Or ID option.castTime = 0 end -- itemTotalCount(option.ID, "all") checks potions / foods from every slot. -- Prints what we are using if item is on CD. Here could be somekind of CD check so it wouldnot print or try to use it if its on CD. if inventory:itemTotalCount(option.ID, "all") >= 1 and not player:hasBuff(option.buffName) then inventory:useItem(option.ID); cprintf(cli.yellow,"Used " .._itemName.. ".\n",_itemName) if option.castTime > 0 then yrest(option.castTime); end inventory:update(); yrest(800); end end