PDA

View Full Version : any idea's why this wont work


jkennedy
01-14-2010, 04:00 PM
{if ($text =~/Buffs/i){ if(plugin::check_hasitem(2377)) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886); } }



it works if i take the hasitem put out but not with it even if i have the item

Wesell
01-14-2010, 04:07 PM
Might be helpful if you posted the entire script. It looks like you have a superfluous { in your script, but that might just be a cut/paste error.

jkennedy
01-14-2010, 04:13 PM
#A conversation to Heal Player for a Cost
sub EVENT_SAY
{
if ($text =~/Hail/i){ quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");}
if ($text =~/Heal/i){ quest::say ("Good, stand where you are while I cast");
quest::selfcast(13);}
if ($text =~/Buff/i){
if ($ulevel <= 46) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);} }
if ($text =~/Meditate/i){ quest::say ("Here you go $name");
quest::setskill(31,150);}
if ($text =~/Bard/i){ if($class eq 'Bard') { quest::say ("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
} }
if ($text =~/Buff/i){ if ($ulevel >= 46) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467); } }
if ($text =~/Scribe/i){
quest::say ("Good, stand where you are while I cast");
quest::scribespells($ulevel); } }
{
if ($text =~/Buffs/i){ if(plugin::check_hasitem(2377)) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(5297);
quest::selfcast(527;
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(539;
quest::selfcast(2886); } }


sorry

jkennedy
01-14-2010, 04:16 PM
it made smile faces outta some of the lower text its got the 4th number and the ) though

joligario
01-14-2010, 04:21 PM
It makes smiley faces because you are not using the code brackets.

Anyways, to check for the item:
plugin::check_hasitem($client, itemid);

jkennedy
01-14-2010, 04:23 PM
so i add that in like it was a quest:: right

jkennedy
01-14-2010, 04:27 PM
#A conversation to Heal Player for a Cost
sub EVENT_SAY
{
if ($text =~/Hail/i){ quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");}
if ($text =~/Heal/i){ quest::say ("Good, stand where you are while I cast");
quest::selfcast(13);}
if ($text =~/Buff/i){
if ($ulevel <= 46) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);} }
if ($text =~/Meditate/i){ quest::say ("Here you go $name");
quest::setskill(31,150);}
if ($text =~/Bard/i){ if($class eq 'Bard') { quest::say ("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
} }
if ($text =~/Buff/i){ if ($ulevel >= 46) { quest::say ("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467); } }
if ($text =~/Scribe/i){
quest::say ("Good, stand where you are while I cast");
quest::scribespells($ulevel); } }

if ($text =~/Buffs/i){ plugin::check_hasitem($client, 2377);
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886); }

thats what im using now and still nto getting anything

Wesell
01-14-2010, 04:29 PM
Try this out:

sub EVENT_SAY
{
if ($text =~/Hail/i)
{
quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");
}
if ($text =~/Heal/i)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(13);
}
if ($text =~/Buff/i)
{
if ($ulevel <= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);
}
}
if ($text =~/Meditate/i)
{
quest::say("Here you go $name");
quest::setskill(31,150);
}
if ($text =~/Bard/i)
{
if($class eq 'Bard')
{
quest::say("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
}
}
if ($text =~/Buff/i)
{
if ($ulevel >= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467);
}
}
if ($text =~/Scribe/i)
{
quest::say("Good, stand where you are while I cast");
quest::scribespells($ulevel);
}
if ($text =~/Buffs/i)
{
if(plugin::check_hasitem($client, 2377))
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886);
}
}
}

joligario
01-14-2010, 04:33 PM
No, plugin::check_hasitem($client, id) returns true or false. So:

if (plugin::check_hasitem($client, 1234)) {
quest::say("Very good, you have item 1234 either with you or in your bank!");
}

jkennedy
01-14-2010, 04:34 PM
thats also not working

Wesell
01-14-2010, 04:36 PM
Right, you need to pass the client as the first parameter. Fixed up the last post a little.

jkennedy
01-14-2010, 04:36 PM
can someone test my script and see if it works on there server maybe my plugin for check_hasitem is bad

joligario
01-14-2010, 04:39 PM
Post your latest script. And use code brackets like this without the spaces:
[ code ]Code here[ /code ]

jkennedy
01-14-2010, 04:42 PM
[ code ] sub EVENT_SAY
{
if ($text =~/Hail/i)
{
quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");
}
if ($text =~/Heal/i)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(13);
}
if ($text =~/Buff/i)
{
if ($ulevel <= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);
}
}
if ($text =~/Meditate/i)
{
quest::say("Here you go $name");
quest::setskill(31,150);
}
if ($text =~/Bard/i)
{
if($class eq 'Bard')
{
quest::say("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
}
}
if ($text =~/Buff/i)
{
if ($ulevel >= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467);
}
}
if ($text =~/Scribe/i)
{
quest::say("Good, stand where you are while I cast");
quest::scribespells($ulevel);
}
if ($text =~/Buffs/i)
{
if(plugin::check_hasitem($client, 2377))
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886);
}
}
} [ /code ]

jkennedy
01-14-2010, 04:42 PM
sub EVENT_SAY
{
if ($text =~/Hail/i)
{
quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");
}
if ($text =~/Heal/i)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(13);
}
if ($text =~/Buff/i)
{
if ($ulevel <= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);
}
}
if ($text =~/Meditate/i)
{
quest::say("Here you go $name");
quest::setskill(31,150);
}
if ($text =~/Bard/i)
{
if($class eq 'Bard')
{
quest::say("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
}
}
if ($text =~/Buff/i)
{
if ($ulevel >= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467);
}
}
if ($text =~/Scribe/i)
{
quest::say("Good, stand where you are while I cast");
quest::scribespells($ulevel);
}
if ($text =~/Buffs/i)
{
if(plugin::check_hasitem($client, 2377))
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886);
}
}
}

jkennedy
01-14-2010, 04:43 PM
there we go sorry

Congdar
01-14-2010, 04:54 PM
you can't have Buff and then Buffs but you might be able to have Buffs and then Buff as text checking.

jkennedy
01-14-2010, 05:11 PM
i changed it from buffs to donator and still isnt working

jkennedy
01-14-2010, 05:13 PM
sub EVENT_SAY
{
if ($text =~/Hail/i)
{
quest::say ("Welcome to Citadel Of the Warlord , $name. Would you like me to [Scribe] your spells? Maybe you would like Your (Meditate) skill, Or maybe your a (Bard) or would you like [buffs] or do you just need a small [heal] to save your butt");
}
if ($text =~/Heal/i)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(13);
}
if ($text =~/Buff/i)
{
if ($ulevel <= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(278);
quest::selfcast(10);
quest::selfcast(174);
quest::selfcast(145);
quest::selfcast(3692);
}
}
if ($text =~/Meditate/i)
{
quest::say("Here you go $name");
quest::setskill(31,150);
}
if ($text =~/Bard/i)
{
if($class eq 'Bard')
{
quest::say("Here you go $name");
quest::setskill(70,150);
quest::setskill(54,150);
quest::setskill(49,150);
quest::setskill(12,150);
quest::setskill(41,150);
}
}
if ($text =~/Buff/i)
{
if ($ulevel >= 46)
{
quest::say("Good, stand where you are while I cast");
quest::selfcast(1568);
quest::selfcast(4054);
quest::selfcast(3397);
quest::selfcast(5507);
quest::selfcast(2570);
quest::selfcast(3467);
}
}
if ($text =~/Scribe/i)
{
quest::say("Good, stand where you are while I cast");
quest::scribespells($ulevel);
}
if ($text =~/Donator/i)
{
if (plugin::check_hasitem($client, 2377)) {
quest::say("Very good, you have item 1234 either with you or in your bank!");
quest::selfcast(5297);
quest::selfcast(5278);
quest::selfcast(5522);
quest::selfcast(5507);
quest::selfcast(5415);
quest::selfcast(5365);
quest::selfcast(5398);
quest::selfcast(2886);
}
}
}

finally got it working thanks guys

joligario
01-14-2010, 05:22 PM
FYI: You left my example text in your last block. Also, If the player is exactly 46, he will get double spells.