OTBots Forums
Shoot rune on mob - Printable Version

+- OTBots Forums (https://forums.otbots.com)
+-- Forum: Classictibia Bot (https://forums.otbots.com/Forum-Classictibia-Bot--1)
+--- Forum: Scripts (https://forums.otbots.com/Forum-Scripts--6)
+---- Forum: Requests (https://forums.otbots.com/Forum-Requests--10)
+---- Thread: Shoot rune on mob (/Thread-Shoot-rune-on-mob--1495)



Shoot rune on mob - Glandq - 02-07-2021

Hello!
Didnt find a script that shoots a rune at specific mob.
Lets say I want to shoot at ghoul lmm rune once my hp above some %.
I will do it at melee range.

Normal targeting doesnt work for me, when character heals it stops attacking mobs with a rune and just stands and tries to melee them

Thanks in advance!


RE: Shoot rune on mob - Arkilys - 02-07-2021

Hello.

The reason is quite obvious, it should not shoot runes while you are healing. Otherwise, you could die.
So it will only shoot runes while not healing.

The correct section to request scripts is Scripts->Requests. So please, keep that in mind for any future requests.
I'm moving your thread to the correct section.

But here it goes, the script that you requested. Big Grin
local MIN_HEALTH = 80 -- Min. health pc to shoot runes. Only shoot runes if your characters hp% is higher than this value.
local Monsters = {
    { Name = 'Demon', HpMin = 0, HpMax = 100, Rune = 'heavy magic missile rune' }, -- Monster name, Hp min and max to shoot runes and which rune.
    { Name = 'Orc', HpMin = 20, HpMax = 100, Rune = 'heavy magic missile rune' }, -- On this case, it will only shoot runes when orc has hp% between 20 and 100%.
}

local attacked_creature = attacked()

if attacked_creature.id > 0 and hppc() >= MIN_HEALTH and cancast() then
    for _, monster in ipairs(Monsters) do
        if monster.Name:lower() == attacked_creature.name:lower() and attacked_creature.hppc >= monster.HpMin and attacked_creature.hppc <= monster.HpMax then
            useitemoncreature(monster.Rune, attacked_creature.id)
            wait(1000, 1300)
            break
        end
    end
end



RE: Shoot rune on mob - Glandq - 02-08-2021

(02-07-2021, 07:02 PM)Arkilys Wrote:
|Only Registered members can see download links. | Click here to buy subscription or here to register.
Hello.

The reason is quite obvious, it should not shoot runes while you are healing. Otherwise, you could die.
So it will only shoot runes while not healing.

The correct section to request scripts is Scripts->Requests. So please, keep that in mind for any future requests.
I'm moving your thread to the correct section.

But here it goes, the script that you requested. Big Grin
local MIN_HEALTH = 80 -- Min. health pc to shoot runes. Only shoot runes if your characters hp% is higher than this value.
local Monsters = {
    { Name = 'Demon', HpMin = 0, HpMax = 100, Rune = 'heavy magic missile rune' }, -- Monster name, Hp min and max to shoot runes and which rune.
    { Name = 'Orc', HpMin = 20, HpMax = 100, Rune = 'heavy magic missile rune' }, -- On this case, it will only shoot runes when orc has hp% between 20 and 100%.
}

local attacked_creature = attacked()

if attacked_creature.id > 0 and hppc() >= MIN_HEALTH and cancast() then
    for _, monster in ipairs(Monsters) do
        if monster.Name:lower() == attacked_creature.name:lower() and attacked_creature.hppc >= monster.HpMin and attacked_creature.hppc <= monster.HpMax then
            useitemoncreature(monster.Rune, attacked_creature.id)
            wait(1000, 1300)
            break
        end
    end
end
Oh sorry, didnt see this section, pretty new here. Script works like a charm, attacks as I expected it! Kudos

Ah I noticed one thing that is missing, open next bp once its empty, would help a lot


RE: Shoot rune on mob - Arkilys - 02-08-2021

|Only Registered members can see download links. | Click here to buy subscription or here to register.



RE: Shoot rune on mob - fireball11 - 09-23-2021

is there a way to do this but with custom runes?
so item id instead of sudden death rune or heavy magic missile rune?


RE: Shoot rune on mob - Arkilys - 09-24-2021

Yes, you just need to setup Rune field with the rune id.
Example:
{ Name = 'Orc', HpMin = 20, HpMax = 100, Rune = 1234 }