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

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

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #10  
Old 07-13-2009, 04:29 PM
pfyon's Avatar
pfyon
Discordant
 
Join Date: Mar 2009
Location: Ottawa
Posts: 495
Default

Quote:
Originally Posted by Dibalamin View Post
How can you make it store a text string? Been thinking about a bot to do guilds.
Under EVENT_SAY you should be able to just do
Code:
$myString = $text;
That'll just store the current text since it would be overwritten whenever someone said something to the npc with the current text. A better approach would be to put it in an if block with a regex to check for a string like "Guildname: xxxxxx" then store the xxxxxx part with another regex.
Code:
if($text =~/<some regex to check guildname>/i)
{
$text =~/<regex to pull out the guildname>/;
$guildname = $text;
}
Again, no real experience using perl or regular expressions, so I'm not sure exactly how you'd do that. One way would be to store the initial say text in a temporary variable since performing the regex puts the output in the variable that you perform it on (I think, so $text =~ something modifies $text to be the output of the expression).

Kinda getting over my head with regular expressions and perl in this thread, I'm just waiting for someone who actually uses it regularly to come in and say "no, that's all wrong". :p

Also, not sure if it's good programming practice with perl, but you could declare the variable as a global variable (outside EVENT_SAY, like at the top of the script) so it can be accessed from other events.
Reply With Quote
 


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 08:33 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