I try to make one, but no way, put time for the field, but if bot is killing monster it doesn't shot field.
Tried to make with topitem but nothing :/
Anyway?
I try to make one, but no way, put time for the field, but if bot is killing monster it doesn't shot field.
Tried to make with topitem but nothing :/
Anyway?
FireBomb Action (3 stages), change ID's to Energy Bomb
init start
local fieldId = {2132,2133}
local t = {{x=11111,y=22222,z=3},{x=44444,y=55555,z=6}} -- put how much you want
function shootFF()
for i=-6,7 do
for j=-4,5 do
local posx,posy,posz = i+$posx,j+$posy,$posz
for l=1, #t do
if(posx == t[l].x and posy == t[l].y and posz == t[l].z)then
local tile = gettile(posx,posy,$posz)
for k=1, tile.itemcount do
if(table.find(fieldId,tile.item[k].id))then
pausewalking(1000)
useitemon(3192, 0, ground(posx,posy,$posz))
wait(200)
pausewalking(0)
elseif(not table.find(fieldId,tile.item[k].id) and topitem(posx,posy,$posz).id ~= 2131)then
pausewalking(1000)
useitemon(3192, 0, ground(posx,posy,$posz))
wait(200)
pausewalking(0)
end
end
end
end
end
end
end
init end
auto(1000)
shootFF()
will use energy bomb on self if no monsters near you and no energy on position you stand
Code:if (maround(5)) <1 and not isitemontile(2122, $posx, $posy, $posz) then useitemon(itemid("Energy Bomb Rune"), 0, ground ($posx, $posy, $posz)) end
function isbombontile(rune, nonpvp, x, y, z)
local fields = {
pvp = {fire = {2118, 2119}, poison = 2121, energy = 2122},
non = {fire = {2131, 2132}, poison = 2134, energy = 2135}
}
local dmgtype = runeinfo(rune).dmgtype:lower()
local ids = fields.pvp[dmgtype]
if nonpvp then
ids = table.merge(ids, fields.non[dmgtype])
end
for i = -1, 1 do
for j = -1, 1 do
if not areitemsontile('any', x+j, y+i, z, ids) and tilewalkable(x+j, y+i, z) then
return false
end
end
end
return true
end
function areitemsontile(mode, x, y, z, ...)
local ids = {}
mode = mode or 'any'
if type(...) == 'number' then
ids = {...}
elseif type(...) == 'string' then
ids = string.explode(..., ',')
elseif type(...) == 'table' then
ids = ...
end
local found = 0
for _, id in ipairs(ids) do
if isitemontile(tonumber(id), x, y, z) then
if mode == 'any' then
return true
else
found = found + 1
end
end
end
if found == #ids then
return true
end
return false
end