User Control Panel
Advertisements

HELP US, HELP YOU!

Upercase command

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Mon Mar 08, 2004 9:40 pm    Post subject: Reply with quote

Code:
sub upercase <br />{<br />   my ($bot, $self, $user, $msg) = @_;<br /><br />   my $user_settings = $bot->{users}->{$user};<br />   my $msn = $bot->{msn};<br />   my $settings = $bot->{settings};<br /><br />   # Make sure we have a string to make uppercase.<br />   if ($msg) {<br />  $reply = "Result: " . uc($msg);<br />   }<br />   else {<br />  $reply = "This command is used to uppercase a string.\n\n"<br />     . "!upercase HeLlO wOrLd!";<br />   }<br /><br />   return $reply;<br />}<br /><br />};

I've converted, the upercase command, from Nexus, to 'andromeda'.

Edit: You're going to have to put
Category => "fun",
"or whatever you wan't it to be".
Back to top
Cer
Upgraded Agent
Upgraded Agent


Joined: 03 Feb 2004
Posts: 3776
Location: Michigan
Reputation: 146.9
votes: 4

PostPosted: Mon Mar 08, 2004 9:50 pm    Post subject: Reply with quote

Quote:
sub upercase
{
  my ($bot, $self, $user, $msg) = @_;

  my $user_settings = $bot->{users}->{$user};
  my $msn = $bot->{msn};
  my $settings = $bot->{settings};

# Make sure we have a string to make uppercase.
if ($msg) {
$reply = "Result: " . uc($msg);
}
else {
$reply = "This command is used to uppercase a string.\n\n"
  . "!upercase HeLlO wOrLd!";
}

return $reply;
}

};


Have you tested that code? There's a lone } there all by itself.

Code:
sub upercase <br />{<br />  my ($bot, $self, $user, $msg) = @_;<br /><br />  my $user_settings = $bot->{users}->{$user};<br />  my $msn = $bot->{msn};<br />  my $settings = $bot->{settings};<br /><br /># Make sure we have a string to make uppercase.<br />if ($msg) {<br /> $reply = "Result: " . uc($msg);<br />}<br />else {<br /> $reply = "This command is used to uppercase a string.\n\n"<br />  . "!upercase HeLlO wOrLd!";<br />}<br /><br />return $reply;<br />}<br /><br />{<br />  Category => "fun",<br />};


That's a little bit better.

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
..::BIGmouth( )::..
God Like
God Like


Joined: 05 Feb 2004
Posts: 801

Reputation: 44.1Reputation: 44.1Reputation: 44.1Reputation: 44.1

PostPosted: Mon Mar 08, 2004 10:00 pm    Post subject: Reply with quote

I didn't notice, that.. thx Cer.

<*lazy*>Edit:I did test it, It worked i didn't get any errors or anything.
but the one you posted is better Very Happy...

If you wan't to make, a lowercase command make the . uc to . lc.

Code:
$reply = "Result: " . lc($msg);
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Mon Mar 08, 2004 10:38 pm    Post subject: Reply with quote

I like this command ill try to convert it in morph...
Back to top
night
Not Yet a God
Not Yet a God


Joined: 06 Jan 2004
Posts: 498

Reputation: 38.4Reputation: 38.4Reputation: 38.4Reputation: 38.4

PostPosted: Mon Mar 08, 2004 11:09 pm    Post subject: Reply with quote

gd work Smile
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Tue Mar 09, 2004 1:06 pm    Post subject: Reply with quote

rofl, I guess Luke isn't the only one who makes pointless commands Smile

btw, its spelt uppercase
Back to top
GiL
Not Yet a God
Not Yet a God


Joined: 06 Jan 2004
Posts: 344

Reputation: 35.3Reputation: 35.3Reputation: 35.3Reputation: 35.3

PostPosted: Wed Mar 10, 2004 2:25 am    Post subject: Reply with quote

well.. seeing as this is very very pointless.. but also useful, i will make it nicer Very Happy one command called case Smile P.S It isnt tested becase i did it at school and dont have active perl installed
Code:
<br />sub case<br />{<br />    my ($bot,$self,$user,$msg);<br />    $self->{settings}->{callback} = "case";<br />    if ($msg eq '')<br />    {<br />        $self->{settings}->{doing} = "pick";<br />        return "Please pick which case you would like to change your text to.\n\n1.) Upper\n2.) Lower";<br />    }<br />    elsif ($self->{settings}->{doing} eq "pick")<br />    {<br />        if ($msg =~ /^(1|upper)$/i)<br />        {<br />            $self->{settings}->{doing} = "upper";<br />            return "Please enter the string you want to be converted to uppercase.";<br />        }<br />        elsif ($msg =~ /^(2|lower)$/i)<br />        {<br />            $self->{settings}->{doing} = "lower";<br />            return "Please enter the string you want to be converted to lowercase.";<br />        }<br />        else<br />        {<br />            delete $self->{settings}->{doing};<br />            return "Incorrect Usage!";<br />       }<br />    }<br />    elsif ($self->{settings}->{doing} eq "upper")<br />    {<br />        delete $self->{settings}->{doing};<br />        $self->{settings}->{callback} = ";<br />        $msg = uc($msg);<br />        return "$msg";<br />    }<br />    elsif ($self->{settings}->{doing} eq "lower")<br />    {<br />        delete $self->{settings}->{doing};<br />        $self->{settings}->{callback} = ";<br />        $msg = lc($msg);<br />        return "$msg";<br />    }<br />    else<br />    {<br />        delete $self->{settings}->{doing} if exists $self-->{settings}->{doing};<br />        $self->{settings}->{callback} = ";<br />        return "Incorrect Usage!";<br />    }<br />}<br /><br />{<br />    Category => 'Utilities',<br />    Usage => 'case',<br />    Description => 'Convert a string to either upper case or lower case.',<br />};<br />



-Jebus Penguin (AKA Gil)
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