View Single Post
  #28  
Old 02-24-2013, 05:55 PM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Quote:
Originally Posted by c0ncrete View Post

Code:
foreach my $findThis (@findThese) {
    foreach my $slotID (@lookIn) {
        if ($client->GetItemIDAt($slotID) == $findThis) {
            $client->DeleteItemInInventory($slotID);
        }
    }
}
Thanks for the code c0ncrete it works... however, there is one thing that it is doing, or rather not doing that I am trying to figure out.

The NPC will delete the items, but they aren't removed. In fact what happens is when I go to pick up the stack of items, I get the following:
Here is my script so you can look at it yourself and tell me if I did something wrong.

This also happens on single items as well.

Code:
######
#Buffer
#Kingmen
######

sub EVENT_SAY
{

my $buffs = quest::saylink("buffs");
my $help = quest::saylink("help");
my $items = quest::saylink("items");


@diamonds = (
              quest::varlink("22503"),	#Blue_Diamond
              quest::varlink("15981"),	#Raw_Diamond
              quest::varlink("10037"),	#Diamond
              quest::varlink("25814")	#Flawless_Diamond
            );
			
#@diamonds1 = (
#				GetItemID(22503),
#				GetItemID(10037),
#				GetItemID(25814),
#				GetItemID(15981));

#@slots	=	(1, 2, 3, 4, 5, 6, 7, 8, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
#			265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
#			284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
#			303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
#			322, 323, 324, 325, 326, 327, 328, 329, 330);

if($text=~/hail/i)
	{
		plugin::Whisper("Hi there $name, would you like some $buffs? Also, I am collecting some $items if you want to $help");
	}
	
if($text=~/buffs/i)
	{
		plugin::Whisper("Enjoy your buffs, $name");
		quest::selfcast(1561);  #legacy of thorns
		quest::selfcast(39);    #quickness
		quest::selfcast(2570);  #kei
		quest::selfcast(5415);  #Talisman of Wunshi
		quest::selfcast(5405);  #Talisman of Fortitude
		quest::selfcast(5417);  #Champion
	}
	
if($text=~/^items$/i)
  {{
    $client->Message(315, "Yes, I am searching for the follwing items.");
    $client->Message(315, "=== ITEMS ===");
	}
  for my $dia(@diamonds){
    $client->Message(315, "$dia");
   }}
   
if($text=~/help/i)
	{{
	$client->Message(315, "Great. Stand close as I take them.");
 	}
	{ 
  foreach my $dia1 (22503, 10037, 25814, 15981) {
    foreach my $slot (22, 23, 24, 25, 26, 27, 28, 29, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264,
			265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283,
			284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302,
			303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
			322, 323, 324, 325, 326, 327, 328, 329, 330) {
        if ($client->GetItemIDAt($slot) == $dia1) {
            $client->DeleteItemInInventory($slot);
        }
    }
  }}}
}
I have arrays @diamonds1 and @slots commented out so they do not interfer with my script right now, and also so my npc will talk to me. I haven't found a way to implement an item search into the array just yet, so I just replaced @finditem with the item numbers I am wanting.

Thanks,
~Kingmen
Reply With Quote