View Single Post
  #2  
Old 02-25-2008, 07:44 AM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Using this as a reference, I would imagine you could use the following command:

Code:
$client->GetItemIDAt(slot_id)
You would then need a loop to test each possible visible slot, which would be 0 through 21. This should do what you're looking for (although I haven't tested it):

Code:
sub EVENT_SAY {
	if ($text=~/i'm a noob/i) {
		my $s_id;	#slot_id that will be looked at, defined in the for loop
		my $ii = 0;	#how many total items you have in your inventory
		for ($s_id = 0; $s_id <= 21; $s_id++) {	#look at just visible slots 0-21
			if ($client->GetItemIDAt($s_id) != 0) {
				$ii++;
			}
		}
		if ($ii > 0) {
			quest::say("If you were a noob, then how did you get $ii pieces of armor?");
		} elseif ($ii == 0) {
			quest::say("Yes. Yes, you are certainly a noob. A very naked noob.");
			quest::emote("sees you cutting diamonds.");
	}
}
To be honest, I'm not even sure if you have to define the variables at the beginning (so that they're only for the script), but it should prevent them from carrying over to the next call of the script (I think).
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote