User Control Panel
Advertisements

HELP US, HELP YOU!

Problem with a command to make users enable/disable Blab

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
X-Worm
Newbie
Newbie


Joined: 12 May 2005
Posts: 36

Reputation: 35.7Reputation: 35.7Reputation: 35.7Reputation: 35.7

PostPosted: Tue May 16, 2006 6:28 pm    Post subject: Problem with a command to make users enable/disable Blab Reply with quote

Ah, yes. I'm trying to make a command for users to enable/disable the Blab module, and this is the part where Blab processes the message.

Quote:
$reply = $blabber->processMessage( $username, $msg );
return $reply;


I've tried wrapping an If-statement around it like this

Quote:
if ($bot->{$username}->{blab} eq "enabled") {
$reply = $blabber->processMessage( $username, $msg );
}
return $reply;


and then creating a command like this to enable it (I've tried both in Mayabot's command folders, and in bot.pl)

Quote:
$bot->{$username}->{blab} = "enabled";


... but that doesn't seem to work. But if you add

Quote:
$bot->{$username}->{blab} = "enabled"


right above the if-statement, it works, so... Uhm, Ideas?

And since this barely can help, I uploaded the two Mayabot files in .txt below:

bot.pl
message.pl


Last edited by X-Worm on Wed May 17, 2006 5:21 am; edited 1 time in total
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: Tue May 16, 2006 6:44 pm    Post subject: Reply with quote

The $bot variable is not being passed to the subroutine where the message is being carried out. Pass it to the subroutine (my $bot = shift; etc) and then it should work.
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
eric256
The Keymaker
The Keymaker


Joined: 03 May 2006
Posts: 2292
Location: Colorado
Reputation: 47Reputation: 47Reputation: 47Reputation: 47Reputation: 47

PostPosted: Tue May 16, 2006 7:34 pm    Post subject: Reply with quote

Hey,

In the future please use the upload facility to attach files to your post Wink

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl 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