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 08-17-2008, 04:28 AM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default Dynamic PC Input Menu System

And well.. the if statement always rings true no matter what... the loops are fine.. everything is fine.. it's just when I change it to any sort of array... it auto checks true..

><
><

http://rafb.net/p/APmJKe82.html

><
><

Any thoughts? I'm thinking of maybe using something like push to convert it to a table.. but ><.... I'd rather not... : o
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #2  
Old 08-17-2008, 07:19 PM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default

Updated Link:
http://rafb.net/p/DK2g2S93.html
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
Reply With Quote
  #3  
Old 08-18-2008, 04:50 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Posting the code here since it makes it more likely for people to check it. It should help increase your chance of someone helping.

Code:
my $greencolor = 2;
my $bluecolor = 4;
my $greycolor = 1;
my $pinkcolor = 5;
my $whitecolor = 7;
my @menu =
(
["Main Menu",3,"[Task Menu]","[Server Information Menu]","[Logout]"],
["Task Menu",1,"[Main Menu]"]
);
sub accessmenu($)
{
my $tableindex = 0;
my $start = 0;
my $end = 0;
	while($end == 0)
        {
        	$client->Message($greencolor,"Table Index: $tableindex -- End: $end -- Input: $_[0] -- Menu: $menu[$tableindex][0]");
                if($menu[$tableindex][0] == $_[0])
                {
                	$end = 1;
                }
                elsif($menu[$tableindex][1] == 0)
                {
                	$client->Message($greycolor,"$_[0] not found.");
                	$end = 2;
                }
                $client->Message($greencolor,"Table Index: $tableindex -- End: $end -- Input: $_[0] -- Menu: $menu[$tableindex][0]");
        } continue {$tableindex++;}
        if($end == 1)
        {
                while($start <= $menu[$tableindex][1])
                {
                        $client->Message($bluecolor,$menu[$tableindex-1][$start + 2]);
 
                } continue {$start++;}
        }
}
sub EVENT_SAY
{
        if($text=~/wu40fjoisdjfiosjiofjsd/i)
        {
        }
        else
        {
                accessmenu($text);
        }
}
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #4  
Old 08-18-2008, 07:59 PM
Deimos
Hill Giant
 
Join Date: Jun 2004
Posts: 135
Default

Oh I fixed it, I forgot to post : O

it was =~ quest text, dumb on my part ; o

But I got cool news, this has evolved into quite a project ^_^.

I'm making a persistent in-game PERL DB off of this, lolz... it'll be better than global variables in a way that you can create data structures and so on : D.

I tested it : P. I created a table, stored it, and had another NPC retrieve it. Worked like a charm : D.

Oh well, I'll submit this when it's done kk, so you can all have fun ^_^. You can also use it for localized instances and local tables within NPCs ^)^. It also takes away the need for the thousands of if statements ><
if($text=~/hail/i) or w/e. You can just have a sub EVENT_SAY and add these statements to the table. You'll also be able to manipulate it more by adding in custom properties, taking properties from other areas, and so on, for example, internal status requirements, how much the NPC likes you, the NPCs mood, the status of the player, and w/e you want, and instead of having these each as an if statement, when you put them in the table it'll autocheck to make sure all of these things are true or false or whatever you want it to be ^_^.

Oh well, back to my little project *is excited*
__________________
//The Path of Chaos Server-
//Fate Industries
//Lots of stuff O-o
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 04:51 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 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3