Hello guys,
I wanted to create a script which will message a friend with specific vip icon if someone is attacking me.
So I did something like this:
--- Ultimate PK Friends Messenger by Mlask 1.0.0 ---
init start
local vipGuildIcon = 0 -- vip icon of guild members, 0 = no icon, 1 = heart, 2 = skull, and so on...
local huntspot = "Hunt Name" -- place where you hunt (ex: Ratwoorms Edron)
local waittime = 60000 -- time in ms between msgs (defalut 1 min)
-- dont change anything below this line
local friendsToMsg = {}
init end
foreach vipentry v do
if v.isonline and v.icon == vipGuildIcon then
table.insert(friendsToMsg, v.name)
end
end
auto(300)
if $pattacker.id ~= 0 then
for _, name in ipairs(friendsToMsg) do
say('*' .. name .. '*' .. $pattacker.name .. ' is attacking me in ' .. huntspot)
wait(200,500)
end
wait(waittime]
So the problem is that there are two issues:
1. Windbot is messaging my friend all the time like every 1 minute, no matter if he is attacked by someone or not - and it should message only when he's attacked
2. Windbot is messaging only one person from my vip list with specific icon and not all other persons.
Could u help me where did I make a mistake? Thank You very much!