mastomania
07-22-2013, 07:42 PM
Hi.
I'm struggling with some code.
I'm making Demona warlock script to bot my ms, but the warlocks going invisible is a problem.
I've been using the following script by Syntax, however this script uses rune on characters position, when target goes off(monster goes invisible)
I'm looking for a way to store variable monsterPosition every time the script loops, the variable stores the current targets position, and when the monster goes invisible the bot shoots a rune on the last saved monsterPosition.
edit: I tried with function Creature:Position(), which i thought was supposed to return the coordinates of the target, but it's not working for me.
local info = [[
Name: Invisible Monster Attacker
Description: Executes an AoE when monsters go invisible
Author: Cavitt Glover (Syntax)
Version: 1.0.00 (updated 04.25.2012)]]
local config = {
attacks = {
--[[
runes/spells should be prioritized from top to bottom, eg: exori gran will be attempted before exori or exori mas.
aggressive:
0 = attack triggers when no players are in the area.
1 = attack triggers when only war enemies and skulled players, noone else.
2 = attack triggers when innocents are in the area but not when friendlies are.
3 = attack triggers when friendlies are in the area but not when innocents are.
4 = attack triggers without any regards to players in the area.
]]
--{spell="exori gran", threshold=5, mana=50, radius=1, aggressive=0},
{rune=3191, threshold=2, radius=5, aggressive=0},
--{spell="exori mas", threshold =7, mana=80, radius=4, aggressive=0}
}
}
local attack = false
local function think()
local target = Creature.GetByID(Self.TargetID())
if(target:isVisible() and target:isAlive() and target:isValid())then -- target is visible, record it
attack = true
elseif(not target:isVisible() and attack)then -- creature went invisible, attack it
attack = false -- for next check
for _, info in ipairs(config.attacks)do
local check = getTargetsInArea(Self.Position(), info.radius, info.aggressiveness, true)
if(check)then -- if its not false from a security check, continue
if(info.spell)then
Self.Cast(info.spell, info.mana)
elseif(info.rune)then
Self.UseItemWithMyPosition(info.rune)
end
wait(2000,2500)
end
end
end
end
print(info)
wait(5000)
while (true) do
think()
wait(500)
end
I'm struggling with some code.
I'm making Demona warlock script to bot my ms, but the warlocks going invisible is a problem.
I've been using the following script by Syntax, however this script uses rune on characters position, when target goes off(monster goes invisible)
I'm looking for a way to store variable monsterPosition every time the script loops, the variable stores the current targets position, and when the monster goes invisible the bot shoots a rune on the last saved monsterPosition.
edit: I tried with function Creature:Position(), which i thought was supposed to return the coordinates of the target, but it's not working for me.
local info = [[
Name: Invisible Monster Attacker
Description: Executes an AoE when monsters go invisible
Author: Cavitt Glover (Syntax)
Version: 1.0.00 (updated 04.25.2012)]]
local config = {
attacks = {
--[[
runes/spells should be prioritized from top to bottom, eg: exori gran will be attempted before exori or exori mas.
aggressive:
0 = attack triggers when no players are in the area.
1 = attack triggers when only war enemies and skulled players, noone else.
2 = attack triggers when innocents are in the area but not when friendlies are.
3 = attack triggers when friendlies are in the area but not when innocents are.
4 = attack triggers without any regards to players in the area.
]]
--{spell="exori gran", threshold=5, mana=50, radius=1, aggressive=0},
{rune=3191, threshold=2, radius=5, aggressive=0},
--{spell="exori mas", threshold =7, mana=80, radius=4, aggressive=0}
}
}
local attack = false
local function think()
local target = Creature.GetByID(Self.TargetID())
if(target:isVisible() and target:isAlive() and target:isValid())then -- target is visible, record it
attack = true
elseif(not target:isVisible() and attack)then -- creature went invisible, attack it
attack = false -- for next check
for _, info in ipairs(config.attacks)do
local check = getTargetsInArea(Self.Position(), info.radius, info.aggressiveness, true)
if(check)then -- if its not false from a security check, continue
if(info.spell)then
Self.Cast(info.spell, info.mana)
elseif(info.rune)then
Self.UseItemWithMyPosition(info.rune)
end
wait(2000,2500)
end
end
end
end
print(info)
wait(5000)
while (true) do
think()
wait(500)
end