Log in

View Full Version : Level check on buff ?


Huppy
12-07-2010, 01:39 AM
I've been trying to get this buff bot script (idea from Trevius) to check
for level and not cast the spell if character is not meeting $ulevel.
The script works good, as long as the character is grouped, but if not,
(in the "else"), it doesn't check for level and casts the spell anyways.
My intentions (for example) is not letting the character get a buff like
KEI, when it is less than level 45.

sub EVENT_SAY {

if (($text =~/hail/i)&&{$ulevel=>45}) {
my $Group = $client->GetGroup();
if($Group) {
$Group->CastGroupSpell($npc, 2570)
}
else {
my $GetPlayerID = $client->GetID();
quest::selfcast(2570);
}
quest::say("Incoming KEI for $name");
}

}

trevius
12-07-2010, 04:56 AM
You had multiple syntax issues going on. This should work fine:

sub EVENT_SAY {

if ($text =~/hail/i && $ulevel >= 45)
{
my $Group = $client->GetGroup();
if($Group)
{
$Group->CastGroupSpell($npc, 2570);
}
else
{
my $GetPlayerID = $client->GetID();
quest::selfcast(2570);
}
quest::say("Incoming KEI for $name");
}

}

I suggest reviewing the changes I made so you can learn what you did wrong.

Huppy
12-07-2010, 05:05 AM
You had multiple syntax issues going on. This should work fine:

sub EVENT_SAY {

if ($text =~/hail/i && $ulevel >= 45)
{
my $Group = $client->GetGroup();
if($Group)
{
$Group->CastGroupSpell($npc, 2570);
}
else
{
my $GetPlayerID = $client->GetID();
quest::selfcast(2570);
}
quest::say("Incoming KEI for $name");
}

}

I suggest reviewing the changes I made so you can learn what you did wrong.

Ok, yes, several things different than what I was doing, but, as always, your
very good at what you do (smirk) THANK YOU, it works like I wanted it too now, lol