Mitsuwa
07-09-2012, 05:42 AM
Is it possible to make a script that auto equips energy rings when X amount of monsters appear on screen? It would be great to set it to 3+ monsters.
Anyone know??
lulaa123
01-11-2013, 06:06 PM
local config = {
monsterLimit = 3,
monsterList = {"Dragon Lord", "Tortoise"},
EnergyRingID = 3051,
SecondRingID = 3052,
TrashRingID = 3004
}
function getMonsterCount()
local count = 0
for i = CREATURES_LOW, CREATURES_HIGH do
local creature = Creature.GetFromIndex(i)
if (creature:isValid()) and creature:ID() ~= Self.ID() then
if (creature:isOnScreen() and creature:isVisible() and creature:isAlive()) then
local name = creature:Name()
if(table.find(config.monsterList, name, true))then
count = count + 1
end
end
end
end
return count
end
while(true)do
local curRing = Self.Ring().id
local eneRing = getActiveRingID(config.EnergyRingID)
local secRing = getActiveRingID(config.SecondRingID)
if (getMonsterCount() >= config.monsterLimit and curRing ~= eneRing) then
Self.Equip(config.EnergyRingID, "ring")
elseif (getMonsterCount() < config.monsterLimit) then
if ((Self.ItemCount(config.SecondRingID) > 0 or Self.ItemCount(secRing) > 0) and curRing ~= secRing) then
Self.Equip(config.SecondRingID, "ring")
elseif ((Self.ItemCount(config.SecondRingID) < 1 and Self.ItemCount(secRing) < 1) and curRing ~= TrashRingID) then
Self.Equip(config.TrashRingID, "ring")
end
end
sleep(400)
end
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.