EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Level check on buff ? (https://www.eqemulator.org/forums/showthread.php?t=32646)

Huppy 12-07-2010 01:39 AM

Level check on buff ?
 
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:

Code:

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

Quote:

Originally Posted by trevius (Post 194916)
You had multiple syntax issues going on. This should work fine:

Code:

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


All times are GMT -4. The time now is 08:18 AM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.