View Single Post
  #3  
Old 02-24-2013, 12:41 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default GetItemInInventory

I was going through the possible $client commands located here, and I noticed one that I was really interested in:

Code:
$client -> GetItemInInventory
I have tried making this work in serveral ways, and I just cannot seem to get it. I have searched the forums for the use of this command and it doesn't return any results for me.

When using google to search for any reference to this (eqemu getitemininventory), it returns with the changelog.txt file which I saw the following:

Code:
KLS: Added ability to retrieve items from the inventory in perl with $client->GetItemInInventory(slot_id);
I noticed that the command shows (slot_id), but I am a tad confused on how to denote the item that I am wanting it to take.

Here is my script I am working on right now. The entire script works except for the part in black.

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

sub EVENT_SAY
{

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

@diamonds = (
              Blue_Diamond && quest::varlink("22503"),
              Raw_Diamond && quest::varlink("15981"),
              Diamond && quest::varlink("10037"),
              Flawless_Diamond && quest::varlink("25814")
            );
			
@diamonds1 = (
				Blue_Diamond 	 &&	$client->GetItemInInventory(22503),
				Raw_Diamond 	 &&	$client->GetItemInInventory(10037),
				Diamond 	  	 &&	$client->GetItemInInventory(25814),
				Flawless_Diamond &&	$client->GetItemInInventory(15981)
			 );

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.");
  }
  for my $dia1(@diamonds1){
  $client->GetItemInInventory($dia1);
  $client->(315, "All Gone.");
  }}
}
All I am really wanting this script to do is search the persons' inventory, find the items in question, and take them. I have a bit more that I want to do with this, but for right now I want to get this one part working in full so as to understand how it works, and then I will work on the next part (custom currency [different name instead of current ones], and server automatically crediting the currency to the client. I am sure I can figure this part on my own as I have seen some mention to this within the forums recently [Found Here] which should make it easier for me to do so).

Thanks for any replies,
~Kingmen
Reply With Quote