Log in

View Full Version : Rusty remover?



l4z
01-17-2016, 12:57 AM
Hiho,
Need script to use rusty removers, anybody?
Was searchin but couldnt find..
thanks

eldera
01-17-2016, 02:15 AM
Learn how to search then :P

l4z
01-17-2016, 11:43 AM
Cmon please help.

eldera
01-17-2016, 01:50 PM
Withdraw rusty removers to mainBP and loot rusted items to mainBP. Also add keepItemList to looter because otherwise built in xenobot depositer won't deposit those items to dp.

local indexOfMainBackpack = 0 -- Name, index or id of container
local indexOfLootBackpack = 1 -- Name, index or id of container
local rustRemover = "flask of rust remover"
local rustyItemList = {8894, 8895, 8896, 8897, 8898, 8899}
local keepItemList = {"knight armor", "crown armor", "golden armor", "paladin armor", "knight legs", "crown legs", "golden legs"}
local trashItemList = {"chain armor", "scale armor", "brass armor", "plate armor", "studded legs", "chain legs", "brass legs", "plate legs"}


--[[ DO NOT EDIT ANYTHING BELOW THIS LINE ]]--

function isMonsterBody(name)
local monsterBodyNames = {"The", "Demonic", "Dead", "Slain", "Dissolved", "Remains", "Elemental", "Split"}
for _, element in ipairs(monsterBodyNames) do
if name:find(element) then
return true
end
end
return false
end

Module.New("unrusters", function()
local _rustRemoverSlot = nil
local _rustyItemListlot = nil

local mainBP = Container.New(indexOfMainBackpack)
local loopBP = Container.New(indexOfLootBackpack)

if (mainBP:Index() == loopBP:Index() and mainBP:Index() > 0 and loopBP:Index() > 0) then
print("MAIN AND LOOT BP MUST BE OTHER CONTAINERS")
return
end

if (not isMonsterBody(mainBP:Name())) then
for slot, item in mainBP:iItems() do
if (item.id == Item.GetItemIDFromDualInput(rustRemover) and _rustRemoverSlot == nil) then
_rustRemoverSlot = slot
end

if (table.contains(rustyItemList, item.id) and _rustyItemListlot == nil) then
_rustyItemListlot = slot
end

if (_rustRemoverSlot and _rustyItemListlot) then
mainBP:UseItemWithContainerItem(_rustRemoverSlot, mainBP, _rustyItemListlot)
break
end
end
end

for slot, item in mainBP:iItems() do
if (table.find(keepItemList, Item.GetItemNameFromDualInput(item.id))) then
mainBP:MoveItemToContainer(slot, loopBP:Index(), loopBP:ItemCapacity()-1)
break
end

if (table.find(trashItemList, Item.GetItemNameFromDualInput(item.id))) then
mainBP:MoveItemToGround(slot, Self.Position().x, Self.Position().y, Self.Position().z)
break
end
end
end)

l4z
01-17-2016, 07:45 PM
Thank you Sir, will try out it tomorrow :)

Merre
02-17-2016, 03:29 PM
is it possible to make it add the looted item to a hud?

eldera
02-18-2016, 12:49 PM
Which hud?

jogosmerc
08-18-2017, 12:13 AM
thks buddy!!!