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 04-07-2011, 03:48 AM
louis1016
Hill Giant
 
Join Date: Dec 2009
Posts: 157
Default $text question

Im trying to figure out if its possible to have an npc ask a player a question and use that response in the script. For example: I'm trying to create a script in which aedilles thrall asks the player to name a bot and then uses the quest::createbot function to create a bot with that name. Id really like for this to work, as my alternative is predefining names which Id rather not do. Can anyone please help me out?
Reply With Quote
  #2  
Old 04-07-2011, 05:48 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yes, it is possible. You can use the $text variable and input it into a quest command just like any other variable that you may have created. Though, you will most likely want to add a filter on the text they enter to prevent them from adding special characters and such. If you search google for regular expression and perl and look for the regex to filter out all but letters, you can then set whatever you want as long as there is a quest command/object for it. You will also want to add in checks to make sure they aren't just hailing the NPC or using one of its other prompt key words (IE. if ($text !~ /Hail/i)).
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
Reply


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