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 02-22-2013, 08:20 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

I have been reading the perl book and I got to the part of Hashes, Arrays, Scalars etc and after reading about it I decided to give it a shot.

I have it working, but I just have one issue with it... It makes it into a paragraph format. I am wanting have it in a list format, and it seems the \n doesn't work within an array.

Here is my quest file:

Code:
############
#Test Array
#Kingmen
############


sub EVENT_SAY
{


       
my $content = quest::saylink("content");

	@items = (
				CHARM => quest::varlink("1118"),
				EARONE => quest::varlink("1388"),
				HEAD => quest::varlink("1119"),
				FACE => quest::varlink("1389"),
				EARTWO => quest::varlink("1388"),
				NECK => quest::varlink("1384"),
				SHOULDER => quest::varlink("1385"),
				ARMS => quest::varlink("1264"),
				BACK => quest::varlink("1386"),
				BRACERONE => quest::varlink("1319"),
				BRACERTWO => quest::varlink("1319"),
				RANGE => quest::varlink("1373"),
				HANDS => quest::varlink("1270"),
				PRIMARY => quest::varlink("1372"),
				SECONDARY => quest::varlink("1381"),
				RINGONE => quest::varlink("1383"),
				RINGTWO => quest::varlink("1383"),
				CHEST => quest::varlink("1267"),
				LEGS => quest::varlink("1266"),
				FEET => quest::varlink("1261"),
				WAIST => quest::varlink("1387"),
				AMMO => quest::varlink("80703")
              );
      
  if($text=~/hail/i)
    {
      plugin::Whisper("Hi $name, how are you doing today?");
      plugin::Whisper("Would you like to see what $content I have today?");
    }
  if($text=~/content/i)
		{    
		$client->Message(315, "===ITEMS===");
		$client->Message(315, "@items", "\n");
		}
	          
}
Also, here is a picture of what it looks like when I execute the command:


http://img833.imageshack.us/img833/1086/arrayp.jpg

I am still reading the Perl book, but I was trying to implement what was shown in real-time vs practice exercises so it would stick a little more. I understand the concept of everything so far, but like I said, I am trying to figure out how to make it list format.

I have tried the following methods so far:

Code:
CHARM => quest::varlink("1118")
,
Code:
CHARM => quest::varlink("1118"
),
Code:
CHARM => quest::varlink("1118
"),
I was hoping one of them would bring it to a new line, but that didn't work.

Also if I do the following, it returns "syntax OK", but it shows no results in EQ.
Code:
CHARM => quest::varlink("1118"),
"\n", EARONE => quest::varlink("1388"),
As you can see, I got it working, and it is cleaner that my other "work" lol, but I still have a bit to go before I am able to write something decent.


Thanks for any responses.
~Kingmen
Reply With Quote
  #2  
Old 02-22-2013, 08:28 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

The client won't allow you to start a new line in the same message (it won't even display multiple spaces next to each other). You just need to do a for each loop through your array and send a message for each entry in the array.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 02-22-2013, 08:30 AM
Kingmen30264
Hill Giant
 
Join Date: Sep 2006
Posts: 112
Default

Dang. Alright, well I was hoping that I wouldn't have to do that. I suppose that I am going to have to hold off till I get to the part about foreach as I don't want to confuse myself. ~_~

Thanks for the answer Trev.

~Kingmen
Reply With Quote
  #4  
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
Reply

Thread Tools
Display Modes

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 03:14 AM.


 

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