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);
}
}