User Control Panel
Advertisements

HELP US, HELP YOU!

Words Game

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
mikeo
Newbie
Newbie


Joined: 07 May 2005
Posts: 38
Location: Amsterdam, The Netherlands
Reputation: 12.9

PostPosted: Fri Dec 30, 2005 4:10 pm    Post subject: Words Game Reply with quote

This is my first Perl code, so don't think it's too great. With a little help on the if(), but the rest I did myself lol.

It works by saying !words <something>.

Hope you like it!
Code:
sub cmd_words {
   my($self, $username, $name, $msg) = @_;

   if ($msg)
   {
      if ($msg =~ /^(this|is|the|first|game)$/i)
      {
         $self->sendMessage("That was 1 of the 5 words, remember it!"
                          . "\n\t$dot Type !words clue to get help!");
      }
      elsif ($msg =~ /^(clue)$/i)
      {
         $self->sendMessage("Word 1: 4 letters, begins with a \'t\' and ends with an \'s\'."
                          . "\nWord 2: 2 letters."
                          . "\nWord 3: 3 letters, begins with a \'t\'."
                          . "\nWord 4: 5 letters, begins with an \'f\' and ends with a \'t\'."
                          . "\nWord 5: 4 letters, begins with a \'g\'and ends withs an \'e\'."
                          . "\n\nIf you know the sentence, just say !words <the sentence> and edit <the sentence>. Good Luck.");
      }
      elsif ($msg =~ /^(this is the first game)$/i)
      {
         $self->sendMessage("That was the correct sentence! Well Done!");
      }
      else
      {
         $self->sendMessage("That was not 1 of the 5 words. Try again!"
                          . "\n\t$dot Type !words clue to get help!");
      }
   }
   else
   {
         $self->sendMessage("You have to add a word behind !words.\n"
                          . "Eg: !words lol");
   }

    return;
}
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Fri Dec 30, 2005 4:12 pm    Post subject: Reply with quote

Nice job Wink
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
mikeo
Newbie
Newbie


Joined: 07 May 2005
Posts: 38
Location: Amsterdam, The Netherlands
Reputation: 12.9

PostPosted: Fri Dec 30, 2005 4:13 pm    Post subject: Reply with quote

Thaks darkmonkey, all because of your help on the if() Smile
Back to top
blostorm
Newbie
Newbie


Joined: 14 Feb 2005
Posts: 14

Reputation: 15.2Reputation: 15.2

PostPosted: Fri Dec 30, 2005 9:52 pm    Post subject: Reply with quote

That's look good Laughing
Back to top
mikeo
Newbie
Newbie


Joined: 07 May 2005
Posts: 38
Location: Amsterdam, The Netherlands
Reputation: 12.9

PostPosted: Sat Dec 31, 2005 8:14 am    Post subject: Reply with quote

Thank you Blostorm Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group