Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

Reply
 
Thread Tools Display Modes
  #1  
Old 05-05-2012, 10:08 PM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 545
Exclamation Multiple item checker and nuker on EVENT_TARGET_CHANGE. Need help.

player.pl <--- Possible?

Code:
sub EVENT_TARGET_CHANGE {

if(plugin::check_hasitem($client, xxxx) && if(plugin::check_hasitem($client, xxxx)
{
$client->NukeItem(xxxx);
$client->NukeItem(xxxx);
}
}

I put this in templates named as player.pl and it's purpose is to check 2 or more items on the player at once as soon as they switch targets and if they break this rule the nuke goes off and eliminates all of the items. (it's an anti-cheat for having items you're not supposed to.) This however is not working when I try it with a couple test items. Is there anyway to make this work?

NOTE: The player is not allowed to have both of these items and that's why the anti cheat burns them.
Reply With Quote
  #2  
Old 05-05-2012, 10:20 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

Need only 1 if and close your parenthesis
Reply With Quote
  #3  
Old 05-05-2012, 10:29 PM
oslander
Sarnak
 
Join Date: Aug 2010
Posts: 33
Default

Quote:
Originally Posted by joligario View Post
Need only 1 if and close your parenthesis
Code:
sub EVENT_TARGET_CHANGE {

if(plugin::check_hasitem($client, 4202) && plugin::check_hasitem($client, 4203)
{
$client->NukeItem(4202);
$client->NukeItem(4203);
}
I think this is what he means. I used bronze mask and collar as an example.
Reply With Quote
  #4  
Old 05-05-2012, 10:46 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Close...

Code:
if(plugin::check_hasitem($client, 4202) && plugin::check_hasitem($client, 4203))
Reply With Quote
  #5  
Old 05-05-2012, 11:29 PM
joligario's Avatar
joligario
Developer
 
Join Date: Mar 2003
Posts: 1,498
Default

And just a note: the way you have it only triggers if they have both.
Reply With Quote
  #6  
Old 05-06-2012, 01:05 AM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 545
Default

Quote:
Originally Posted by joligario View Post
And just a note: the way you have it only triggers if they have both.
It's not working. I switch the target and the items aren't deleted. Does the NukeItem feature not work with this or is there something wrong with this script?
EDIT: I forget to close it originally, a small mistake but it's not working even closed below.

Code:
#Player.pl  Under the Wayfarer's message in Templates.

sub EVENT_TARGET_CHANGE {

if(plugin::check_hasitem($client, 4202) && plugin::check_hasitem($client, 4203))
{
$client->NukeItem(4202);
$client->NukeItem(4203);
}

}
Reply With Quote
  #7  
Old 05-06-2012, 02:06 AM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

Add some debugging information to the script to make sure it is even running. Add messages at each stage so you can see where it goes wrong, and simplify it into small steps you can test individually and then put them together.
Reply With Quote
  #8  
Old 05-06-2012, 05:12 AM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 545
Default

This is goofy. Why does it do this?

THIS WILL PLAY A FANFARE AND NUKE THE CHOSEN ITEMS EVERY TIME A
DIFFERENT TARGET IS CHOSEN OR DROPPED.
Code:
# File is player.pl in the templates folder.

sub EVENT_TARGET_CHANGE {

quest::ding();
$client->NukeItem(4202);
$client->NukeItem(4203);
}

}

THIS WILL NOT DO ANYTHING. THE PLUGIN IS CORRECT BECAUSE I TESTED IT ON A NPC INSTEAD OF PLAYER.PL

Code:
# File is player.pl in the templates folder.

sub EVENT_TARGET_CHANGE {

if(plugin::check_hasitem($client, "4202")
{
quest::ding();
$client->NukeItem(4202);
$client->NukeItem(4203);
}

}


So what in the world do I need to do to check for those items that it's not passing through to get to the next stage on EVENT_TARGET_CHANGE or is it impossible?
Reply With Quote
  #9  
Old 05-06-2012, 07:44 AM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

Code:
# File is player.pl in the templates folder.

sub EVENT_TARGET_CHANGE {

if(plugin::check_hasitem($client, "4202") )
{
quest::ding();
$client->NukeItem(4202);
$client->NukeItem(4203);
}

}
You are missing a closing ). I highlighted where it was missing. A perl interpreter will tell you these errors if you run "perl script.pl" on the windows command line.

If it shows nothing when you run it, then it's an issue with the emulator code and not a syntax error.
Reply With Quote
  #10  
Old 05-06-2012, 05:44 PM
lerxst2112
Demi-God
 
Join Date: Aug 2010
Posts: 1,742
Default

lol, I made it bold in mine too, but making it giant is a sure win. <3 Secrets
Reply With Quote
  #11  
Old 05-06-2012, 09:15 PM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 545
Default

The extra ) actually broke the script on the npc and wasn't needed. (I already said I tested this on an NPC with the single ")") It was fine as is. Thanks for trying to help though. This call doesn't work with this EVENT type so it's impossible to do with it. I asked if you all knew a way to get this to work but I doubt it. I'll have to figure something else out.

NOTE: If I knew the answer to something I would of already made a script for the person who was asking for help. If you want to show you're true tech gods that know anything it would be better if you actually showed it instead of act like I should know everything already. If I did I wouldn't be asking for help. "Closing" that isn't even needed. The extra "IF" was a mistake but the single ) was fine. Try the script for yourself on an NPC.
Reply With Quote
  #12  
Old 05-06-2012, 10:22 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

First of all, with your attitude in your last reply, you really don't deserve further help. The answer has already been handed to you and you are complaining about that.

I tested the following script just now on a player.pl in my blackburrow zone and it worked perfectly fine.

Code:
sub EVENT_TARGET_CHANGE {

	if (plugin::check_hasitem($client, 2632))
	{
		quest::ding();
		$client->Message(13, "Target Changed");
	}

}
Note that I used a different item ID, because I just picked a random item my character had on them for testing. I also didn't use your nuke item, but used a debug message instead to prove it was getting that far and it did.

Also, anytime you have an opening parenthesis "(", or curly bracket "{", you always need a closing one that goes with that specific one. I highly recommend you download notepad++ for your script editing, because it will make it really easy for you to make sure you have your brackets and parenthesis properly closed. Just click next to the one you want to check and it highlights the other one in red.

The people that were responding in this thread to help you have been doing this stuff for years, so they know what they are talking about.

If you are still having a problem with that script, then your issue is most likely with the plugin itself. Maybe you don't have plugins in the correct folder. By default from PEQ, the plugin folder is inside the quest folder. You need to move it directly into your server folder for them to actually work.

As mentioned earlier, you are using && in your example which means they need to have both items for the nuke item to happen. What you want is || for OR instead of AND. This should work:
Code:
sub EVENT_TARGET_CHANGE {

	if(plugin::check_hasitem($client, 4202) || plugin::check_hasitem($client, 4203))
	{
		$client->Message(13, "Nuking Items");
		$client->NukeItem(4202);
		$client->NukeItem(4203);
	}

}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 05-06-2012 at 10:28 PM..
Reply With Quote
  #13  
Old 05-06-2012, 11:10 PM
Secrets's Avatar
Secrets
Demi-God
 
Join Date: May 2007
Location: b
Posts: 1,449
Default

I didn't mean it as offensive, I was just pointing out a syntax error. Trevius' reply is right though, the script he posted should work.

I didn't mean to come of as a know-it-all. I just wanted to help.
Reply With Quote
  #14  
Old 05-07-2012, 12:10 AM
chrsschb's Avatar
chrsschb
Dragon
 
Join Date: Nov 2008
Location: GA
Posts: 904
Default

I use a shit load of check_hasitem plugins on my server, Trevius is 100% right!
Reply With Quote
  #15  
Old 05-07-2012, 02:45 AM
Drakiyth's Avatar
Drakiyth
Dragon
 
Join Date: Apr 2012
Posts: 545
Default

I apologize if I came off rude. I'm just extremely stressed out right now with trying to fix this stuff up. I decided to make the first tier and higher path charms epic lore so now people can't have two of them in their inventory at once, however bots are bringing in a problem with being able to stash these charms. Trevius, Secrets, Lerxst, Joligaro, Oslander, thank you for your help.

Would you good folks know how to do away with unwanted items on bots by any chance?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 05:17 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3