I decided to fix the !refund command on BrenBot, it now will give the player the credits instead of just saying it did.
I also added !defund so you can take a players credits.
EDIT: Also fixed the double was typo ;p
Requirements
BrenBot: Of course
ExtraConsoleCommands Plugin: The Commands use GiveCredits and TakeCredits, only available with the plugin.
All I did was edit the pm and xml files to the following.
!refund
sub refund
{
my ( $kernel, $session, $heap, $args ) = @_[ KERNEL, SESSION, HEAP, ARG0 ];
my %args = %{$args};
if ($args{arg1} && $args{arg2} && ($args{arg2} =~ m/^(-?\d+)$/ ))
{
my ( $result, %player ) = playerData::getPlayerData( $args{'arg1'} );
if ( $result == 1 )
{
my $amount = $args{arg2};
plugin::RenRemCMD ( "GiveCredits $player{id} $amount" );
plugin::RenRemCMD("ppage $player{id} you have been giving $amount credits by $args{nick}.");
plugin::ircmsg ( " $player{name} was refunded $amount credits by $args{nick}", A);
}
else {
doMsg("Error: $args{arg1} was not found ingame, or is not unique",$args{nicktype}, "A");
}
}
else
{
doMsg("Syntax: !refund <player> <amount>",$args{nicktype}, "A");
}
}
!defund
sub defund
{
my ( $kernel, $session, $heap, $args ) = @_[ KERNEL, SESSION, HEAP, ARG0 ];
my %args = %{$args};
if ($args{arg1} && $args{arg2} && ($args{arg2} =~ m/^(-?\d+)$/ ))
{
my ( $result, %player ) = playerData::getPlayerData( $args{'arg1'} );
if ( $result == 1 )
{
my $amount = $args{arg2};
plugin::RenRemCMD ( "TakeCredits $player{id} $amount" );
plugin::RenRemCMD("ppage $player{id} $args{nick} has taken $amount credits from you.");
plugin::ircmsg ( " $player{name} was defunded $amount credits by $args{nick}", A);
}
else {
doMsg("Error: $args{arg1} was not found ingame, or is not unique",$args{nicktype}, "A");
}
}
else
{
doMsg("Syntax: !defund <player> <amount>",$args{nicktype}, "A");
}
}
Cookie Jar<glome> Who stole the cookie from the cookie jar?!
<content> glome stole the cookie from the cookie jar!
<glome> Who me?!
<content> Yes you!
<glome> Couldn't be!
<content> Then WHO?!!
<glome> Woody stole the cookie from the cookie jar!
*** glome has been kicked by DrWoody (fuck you i didn't touch the motherfucking cookie, bitch
[Updated on: Fri, 13 July 2012 09:57]
Report message to a moderator