User Control Panel
Advertisements

HELP US, HELP YOU!

Reputation Command

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


Joined: 14 May 2007
Posts: 1


PostPosted: Thu Jun 07, 2007 2:08 am    Post subject: Reputation Command Reply with quote

This Command has been developed for an Open Source Project Based of the White Warrior 1.0 Template.

Code:
## Coded by Josh Morey

if ($msg eq '!repmenu')
{
    open (DATA, "./Files/menu/repmenu.txt");
    @menu = <DATA>;
    close(DATA);

    $self->sendmsg("@menu");
}

if ($msg eq '!myrep')
{
    $rep = do "./Files/RepData.dat";
    $person = $username;
    if (exists $rep->{$person}->{points})
       {
          $points = $rep->{$person}->{points};
       } else {
          $points = 0;
       }
    $self->sendmsg("Your Reputation Points: $points");
}

if ($msg eq '!rep')

{
       $self->sendmsg("Usage: !rep plus/minus - email");
}

elsif ($msg =~ /^!rep (.*) - (.*)/)
   {
       $rep = do "./Files/RepData.dat";
       $points = $rep->{$2}->{points};
       
       if (!exists $rep->{$2}->{points})
       {
           $points = 0;
       }

       if ($1 eq 'plus')
       {
           $points++;
           $self->sendmsg("You have changed $2's Reputation");
       }
       elsif ($1 eq 'minus')
       {
           $points--;
           $self->sendmsg("You have changed $2's Reputation");
       }
       else
       {
           $self->sendmsg("Error: You must use Plus or Minus to effect Reputation Points");
       }
           $rep->{$2}->{points} = $points;
           open FILE, "> ./Files/RepData.dat";
           print FILE Dumper($rep);
           close FILE;
}
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