I'm attempting to create an in game menu. The idea is not original to me (I saw Akkadius do it, and I think it is great).
Anyway, I've searched and can't find anyone that's posted code for it. I've attempted to do it myself. However, It is not working for me. Here is my code:
Code:
sub EVENT_SAY
{
my $menuHelp = quest::saylink("Server Information");
my $menuScribeSpells = quest::saylink("Scribe your spells");
my $menuUnscribeSpells = quest::saylink("Unscribe your spells");
if ($text=~/menu/i)
{
plugin::Whisper("What would you like to do? Would you like [$menuHelp]?");
plugin::Whisper("Wold you like to [$menuScribeSpells]?");
plugin::Whisper("Would you like to [$menuUnscribeSpells]?");
}
if($text="Server Information")
{
Blah blah Lots of crap here..
my $Yel = plugin::PWColor("Yellow");
my $Blu = plugin::PWColor("Light Blue");
my $Red = plugin::PWColor("Red");
my $grn = plugin::PWColor("Forest Green");
quest::popup("Welcome",
"$Yel $TextToCenter <br>
$Yel $TextToCenter2 </c> <br>
$Yel $TextToCenter3 </c> <br>
$Yel $TextToCenter4 </c> <br>
$Yel $TextToCenter5 </c> <br>
$Yel $TextToCenter6 </c> <br>
$Yel $TextToCenter7 </7> <br>
$Yel $TextToCenter8 </7> <br>
$Yel $TextToCenter9 </7> <br> <br>
$Indent $globalload <br>
$Indent $spellfile
");
}
}
It isn't finished, but I prefer to check my work as I go to find errors. I get no response when I say menu or Menu, etc. I put it in global_players.pl and also tried it in a zone player.pl.
I put the script on a NPC and it functioned correctly when I said menu. Maybe sub EVENT_SAY is not the correct event to use. Any suggestions? Thanks.