User Control Panel
Advertisements

HELP US, HELP YOU!

Block Command...?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl
View unanswered posts
Author Message
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Thu Jan 01, 2004 4:38 pm    Post subject: Reply with quote

Hi,

I was trying to use the block command from this part of the forum ( http://www.bot-depot.com/forums/index.php?...pic=51&hl=block ). And I used at the very last post clcools updated block command for MSN.pm 1.2. So, I tried it out, and it would not work, at all. Just to make sure to, I am suppose to put this in the commands folder, right? And was the block command able to be used in MSN.pm 1.3?

Here is the code for the block & unblock command...

Code:
<br />if ($msg =~ /^\!block (.*)/i) {<br />$msn->send( "REM", "AL $1" );<br />$msn->send( "ADC", "BL N=$1" );<br />return;<br />}<br />


Code:
<br />if ($msg =~ /^\!unblock (.*)/i) {<br />$msn->send( "REM", "BL $1" );<br />$msn->send( "ADC", "AL N=$1" );<br />return;<br />}



And here is the error I was getting...

Code:
<br />Use of uninitialized value in pattern match (m//) at commands/block.pl.txt line<br />1, <DATA> line 1.<br />commands/block.pl.txt did not return a true value at bot.pl line 70, <DATA> line<br /> 1.<br />Including block.pl.txt..<br />C:\Perl\bin><br />


Thank you! Smile
Back to top
Sypher
Senior Member
Senior Member


Joined: 01 Jan 2004
Posts: 233
Location: The Netherlands
Reputation: 39.8Reputation: 39.8Reputation: 39.8Reputation: 39.8

PostPosted: Thu Jan 01, 2004 4:43 pm    Post subject: Reply with quote

always close your file with

1; Wink

_________________
Sypher
Developer of Codera
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Thu Jan 01, 2004 4:44 pm    Post subject: Reply with quote

Try using
Code:
 $msn->block('emial@email.ltd');
Instead, with all the other bits you need.
Back to top
Vorx
Senior Member
Senior Member


Joined: 21 Dec 2003
Posts: 152

Reputation: 32Reputation: 32Reputation: 32

PostPosted: Thu Jan 01, 2004 4:45 pm    Post subject: Reply with quote

Well I used the same code as you, and I take it your using wiredbots because you asked about it going in the commands folder.

Here's my code:

BLOCK:
Code:
<br />sub block {<br /><br />if ($msg =~ /^\:block (.*)/i) {<br />$msn->send( "REM", "AL $1" );<br />$msn->send( "ADC", "BL N=$1" );<br />$self->sendmsg ("Blocked\n");<br />return;<br /><br />}<br />}<br />1;<br />


AND UNBLOCK:
Code:
<br />sub unblock {<br /><br />if ($msg =~ /^\:unblock (.*)/i) {<br />$msn->send( "REM", "BL $1" );<br />$msn->send( "ADC", "AL N=$1" );<br />$self->sendmsg ("Unblocked\n");<br />return;<br /><br />}<br />}<br />1;<br />


I hope that's ok for you, save them as block.pl and unblock.pl in the commands folder and try em.

Replace the : before block and unblock to your command prefix (!, #, etc) and hopefully it'll work.

I suggest closing your bot then running it from scratch cos then you'll get any errors when it compiles it. I've checked it, but you may or may not need another } in there somewhere so that's the most likely error.

Good luck and I hope it works out Smile

#### EDIT ####
This does work with MSN 1.3 cos I started using it yesterday and did the block and unblock commands today.
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Thu Jan 01, 2004 4:54 pm    Post subject: Reply with quote

SyPhEr= Thanks, I got it to come online, but once I try to block someone, the bot just cuts/goes offline...?

Micky G = I do not want to just block one person, plus I want it to be a little easier to do (to block the person).

Vorx= Yours does the same thing as SyPhErs, it just cuts/takes me offline (my bot).

And for SyphErs and Vorx, I get an error (from both of ya'll). I think it says, something like this (not sure)...

Code:
<br />Can't call method "send" on an undefined value at commands/block.pl.txt line 4,<br /><GEN2> line 7.<br /><br />C:\Perl\bin><br />


Oh, and by the way. If this has anything to do with it. I am on my MSN (personal) and I am using my bot to try to block myself. But, it should still of worked though...
Back to top
Sypher
Senior Member
Senior Member


Joined: 01 Jan 2004
Posts: 233
Location: The Netherlands
Reputation: 39.8Reputation: 39.8Reputation: 39.8Reputation: 39.8

PostPosted: Thu Jan 01, 2004 4:58 pm    Post subject: Reply with quote

Yep..I have got the same error Sad And the 'new' block function from msn.PM v.1.3 doesn't work Sad
_________________
Sypher
Developer of Codera
Back to top
Vorx
Senior Member
Senior Member


Joined: 21 Dec 2003
Posts: 152

Reputation: 32Reputation: 32Reputation: 32

PostPosted: Thu Jan 01, 2004 5:00 pm    Post subject: Reply with quote

Sorry Cheats I don't think I can help you anymore I haven't got that error for the commands so it's strange it should happen to you. And we're both using MSN 1.3

Weird and sorry again Sad
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Thu Jan 01, 2004 5:02 pm    Post subject: Reply with quote

QUOTE(SyPhEr_ @ Jan 1 2004, 08:58 AM)
Yep..I have got the same error Sad And the 'new' block function from msn.PM v.1.3 doesn't work Sad

Hm...thanks sypher for telling me, now I know that it isn't just me.

Oh, and vorx, no prob. At least you tried helping me, and Thanks very much.

Smile
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Thu Jan 01, 2004 5:02 pm    Post subject: Reply with quote

I get the same thing, im going to make a topic in a sec about wiredbots. Because you are not ment to be able to do the 'if'
Back to top
Sypher
Senior Member
Senior Member


Joined: 01 Jan 2004
Posts: 233
Location: The Netherlands
Reputation: 39.8Reputation: 39.8Reputation: 39.8Reputation: 39.8

PostPosted: Thu Jan 01, 2004 5:04 pm    Post subject: Reply with quote

QUOTE(Micky G @ Jan 1 2004, 09:02 AM)
I get the same thing, im going to make a topic in a sec about wiredbots. Because you are not ment to be able to do the 'if'

well i can use if Razz

_________________
Sypher
Developer of Codera
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Thu Jan 01, 2004 5:06 pm    Post subject: Reply with quote

Surprised &@%*!!!
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Thu Jan 01, 2004 5:07 pm    Post subject: Reply with quote

Quote:
You can make it work for WiredBots code, you just have to change a few things.

1. Wherever there's an IF/ELSIF for a command like this, change it to a sub.
Example: if ($msg =~ /\/help/i) == sub help {

2. Immediately after the sub you'll need $victim, $msg, and $self from the shift. If $self isn't being sent, look from on_im.pl to commands.pl to make sure it is being sent a recieved from the shifts.



Number 1 Razz
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Thu Jan 01, 2004 5:27 pm    Post subject: Reply with quote

QUOTE(Micky G @ Jan 1 2004, 09:07 AM)
Quote:
You can make it work for WiredBots code, you just have to change a few things.

1. Wherever there's an IF/ELSIF for a command like this, change it to a sub.
Example: if ($msg =~ /\/help/i) == sub help {

2. Immediately after the sub you'll need $victim, $msg, and $self from the shift. If $self isn't being sent, look from on_im.pl to commands.pl to make sure it is being sent a recieved from the shifts.



Number 1 Razz

So, Micky G...i'm guessing that it was not a wiredbots code? And that I have to convert it into one?

Smile
Back to top
Micky G
Member
Member


Joined: 30 Dec 2003
Posts: 144

Reputation: 31.5Reputation: 31.5Reputation: 31.5

PostPosted: Thu Jan 01, 2004 5:51 pm    Post subject: Reply with quote

yeah

EDIT

I have got a new Block command -
Code:
sub block {<br />   my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />   $msg =~ s/\/block //ig;<br />   $self->sendmsg("Blocking $msg.. please wait");<br />   $self->block("$msg");<br />   return "User $msg blocked.";<br />}<br />1;<br />


And it works. The unblock code with this doesnt tho! Any help -
Code:
sub unblock {<br />   my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />   $msg =~ s/\/unblock //ig;<br />   $self->sendmsg("unBlocking $msg.. please wait");<br />   $self->unblock("$msg");<br />   return "User $msg unblocked.";<br />}<br />1;<br />
Back to top
Cheatsfp
Member
Member


Joined: 30 Dec 2003
Posts: 109

Reputation: 30.8Reputation: 30.8Reputation: 30.8

PostPosted: Thu Jan 01, 2004 5:59 pm    Post subject: Reply with quote

QUOTE(Micky G @ Jan 1 2004, 09:51 AM)
yeah

EDIT

I have got a new Block command -
Code:
sub block {<br />   my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />   $msg =~ s/\/block //ig;<br />   $self->sendmsg("Blocking $msg.. please wait");<br />   $self->block("$msg");<br />   return "User $msg blocked.";<br />}<br />1;<br />


And it works. The unblock code with this doesnt tho! Any help -
Code:
sub unblock {<br />   my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />   $msg =~ s/\/unblock //ig;<br />   $self->sendmsg("unBlocking $msg.. please wait");<br />   $self->unblock("$msg");<br />   return "User $msg unblocked.";<br />}<br />1;<br />

Cool, thanks man!

I am alos trying to work on the 'unblock' command to now.

P.S. How do I make it to where only the admin (me) can use the block & unblock command?

Thanks Smile

-----------------------------------------
EDIT:

I got the unblock command to work...

Code:
<br />sub unblock {<br />  my ($username,$msg,$self) = @_;  # get whatever was passed to it<br />  $msg =~ s/\/unblock //ig;<br />  $self->sendmsg("unblocking $msg.. please wait");<br />  $self->unblock("$msg");<br />  return "User $msg unblocked.";<br />}<br />1;<br />
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Perl All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 



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