teence
06-26-2016, 02:20 PM
Hello guys,
I need some help, I've been trying for hours tranform this script, which changes weapon when 2
defined monsters ON SCREEN. What I need is make it work, when 2 monsters in rage 1.
Lua code:
local config = {
["WEAPON NAME TO SWITCH"] = {"MonsterName1", "MonsterName2", "MonsterName3", count = 2, defaultWeapon = "NORMAL WEAPON NAME"}
}
Module.New("Weapon Changer by Werox", function(module)
local tbl = {}
for weapon, creatures in pairs(config) do
for name in Creature.iMonsters() do
if (table.contains(creatures, name)) then
table.insert(tbl, name)
end
end
if (#tbl >= config[weapon].count) then
Self.Equip(weapon, "weapon")
elseif (#tbl < config[weapon].count) then
Self.Equip(config[weapon].defaultWeapon, "weapon")
end
end
end)
I need it for mad sheep skilling, when I'm blocking mad sheep + rowtorm (I need to kill second rotworm, whenever it attacks me by other weapon than Mystic Blade, like Spike sword)
edit/
I have been also traing to merge this script with this one
lua code:
local Ring_RingID = 3051 -- id ring
local MonsterList = {"Crypt Shambler", "Mummy", "Ghost"}
local MonsterCount = 3 -- How many monsters until you equip the special ring?
local MonsterRange = 2 -- Range of the monsters until you equip the special ring?
Module.New("RingEquip", function(module)
local mob = Self.GetTargets(MonsterRange)
local mobCount = 0
for i = 1, #mob do
if table.contains(MonsterList, mob[i]:Name()) then
mobCount = mobCount + 1
end
end
if (mobCount >= MonsterCount and Self.Ring().id ~= Item.GetRingActiveID(Ring_RingID) and Self.ItemCount(Ring_RingID) > 0) then
Self.Equip(Ring_RingID, "ring")
elseif (mobCount < MonsterCount and Self.Ring().id == Item.GetRingActiveID(Ring_RingID)) then
Self.Dequip("ring", MainBackpack)
end
module:Delay(1000, 1100)
end)
But without any progress
I need some help, I've been trying for hours tranform this script, which changes weapon when 2
defined monsters ON SCREEN. What I need is make it work, when 2 monsters in rage 1.
Lua code:
local config = {
["WEAPON NAME TO SWITCH"] = {"MonsterName1", "MonsterName2", "MonsterName3", count = 2, defaultWeapon = "NORMAL WEAPON NAME"}
}
Module.New("Weapon Changer by Werox", function(module)
local tbl = {}
for weapon, creatures in pairs(config) do
for name in Creature.iMonsters() do
if (table.contains(creatures, name)) then
table.insert(tbl, name)
end
end
if (#tbl >= config[weapon].count) then
Self.Equip(weapon, "weapon")
elseif (#tbl < config[weapon].count) then
Self.Equip(config[weapon].defaultWeapon, "weapon")
end
end
end)
I need it for mad sheep skilling, when I'm blocking mad sheep + rowtorm (I need to kill second rotworm, whenever it attacks me by other weapon than Mystic Blade, like Spike sword)
edit/
I have been also traing to merge this script with this one
lua code:
local Ring_RingID = 3051 -- id ring
local MonsterList = {"Crypt Shambler", "Mummy", "Ghost"}
local MonsterCount = 3 -- How many monsters until you equip the special ring?
local MonsterRange = 2 -- Range of the monsters until you equip the special ring?
Module.New("RingEquip", function(module)
local mob = Self.GetTargets(MonsterRange)
local mobCount = 0
for i = 1, #mob do
if table.contains(MonsterList, mob[i]:Name()) then
mobCount = mobCount + 1
end
end
if (mobCount >= MonsterCount and Self.Ring().id ~= Item.GetRingActiveID(Ring_RingID) and Self.ItemCount(Ring_RingID) > 0) then
Self.Equip(Ring_RingID, "ring")
elseif (mobCount < MonsterCount and Self.Ring().id == Item.GetRingActiveID(Ring_RingID)) then
Self.Dequip("ring", MainBackpack)
end
module:Delay(1000, 1100)
end)
But without any progress