Hello.
This script can be improved, but should works.
How it works: If there's one of those items on door or a creature, it will try to move, if it can't, it will try to use Disintegrate Rune.
So you need to setup the IDs that you want to avoid and door's location, which you discover using Cavebot. Just create a waypoint doors sqm and it will show you the X/Y/Z position.
local Door = { X = 12345, Y = 12345, Z = 7 } -- The door position
local ItemsDestroy = { 2595, 2596, 1738, 1739, 1740, 1741, 1747, 1748, 1749, 1750, 1751, 1752, 1753} --item IDs that you wanna destroy, IDS NOT NAMES!
if Door.X ~= posx() or Door.Y ~= posy() then
local doorItem = topitem(Door.X, Door.Y, Door.Z, true)
if doorItem.id == 99 or table.find(ItemsDestroy, doorItem.id) ~= nil then
local maxDist = 2
if doorItem.id == 99 then
maxDist = 1
end
local posMove = wheretomoveitem(Door.X, Door.Y, Door.Z, false, maxDist)
if posMove.posx > 0 then
moveitems(doorItem.id, ground(posMove.posx, posMove.posy, posMove.posz), ground(Door.X, Door.Y, Door.Z), 100)
wait(200)
else
if doorItem.id == 99 then
playsound('default')
flashclient()
else
if table.find(ItemsDestroy, doorItem.id) ~= nil then
useitemon(2310,Door.X, Door.Y, Door.Z)
wait(800)
else
playsound('default')
flashclient()
end
end
end
end
end