User Control Panel
Advertisements

HELP US, HELP YOU!

A Block Notes Command!

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Commands
View unanswered posts
Author Message
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Sun Feb 08, 2004 12:12 am    Post subject: Reply with quote

To Save One
Code:
     }<br />   elsif($msg =~ /^\#bnote (.*)$/)<br />    {<br />     open (DATA, ">>bnotes/bnotes.txt");<br />     print DATA "$1\n";<br />     close(DATA); <br />     $self->sendmsg("Your Reason Was Saved!");<br />    }


Read one
Code:
     }<br />    elsif($msg =~ /^\#bnotesread/)<br />    {<br />     open (DATA, "bnotes/bnotes.txt");<br />     @line = <DATA>;<br />     close(DATA);<br />     $self->sendmsg("@line"); <br />    }


Works like noyte pad type #bnote yest@test.com->I preffer this way

You need to make a folder called bnotes brw!!

Matt
Back to top
Rameses
Senior Member
Senior Member


Joined: 02 Feb 2004
Posts: 182

Reputation: 31.1Reputation: 31.1Reputation: 31.1

PostPosted: Sun Feb 29, 2004 5:45 am    Post subject: Reply with quote

Hmm.. Just an idea (not sure if anybody has done this or not), but maybe a command for blocking a username could be something like ".block person@hotmail.com because they are using profanity." It could then do

Code:
$msg =~ s/\.block //ig;


Then split the username and the reason. It'd block and add the username to the block list, but then open up the file to store the reason! I'd also save the local time and the blocker into the file that contains reasons. This way, it would ensure that you had proof that a mod blocked somebody. Say they went evil and started blocking everybody like crazy, then said "But I didn't do it!".. Well you have proof! Lol Razz
Back to top
Cer
Upgraded Agent
Upgraded Agent


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

PostPosted: Sun Feb 29, 2004 5:49 am    Post subject: Reply with quote

QUOTE(Rameses @ Feb 29 2004, 12:45 AM)
Hmm.. Just an idea (not sure if anybody has done this or not), but maybe a command for blocking a username could be something like ".block person@hotmail.com because they are using profanity." It could then do

Code:
$msg =~ s/\.block //ig;


Then split the username and the reason. It'd block and add the username to the block list, but then open up the file to store the reason! I'd also save the local time and the blocker into the file that contains reasons. This way, it would ensure that you had proof that a mod blocked somebody. Say they went evil and started blocking everybody like crazy, then said "But I didn't do it!".. Well you have proof! Lol  Razz

What if they just type ".block" (without a space)? Will it just add blank for the username and reason?

This would work better:
Code:
my ($command,$person,$reason) = split(/ /, $msg, 3);<br /><br />if (length $person == 0 || length $reason == 0) {<br />   return "You must provide a username AND reason.\n\n"<br />      . ".block myname\@nowhere.net being an idiot";<br />}<br />else {<br />   # The block code here, $person = person you're<br />   # blocking and $reason = why.<br />}


That would split the 3 variables you need at the spaces and then make sure the other two exist. So even if they type "!block" without a space, it will know that there's two variables missing.

And it's also a line shorter, as opposed to:
Code:
$msg =~ s/\.block //g;<br />my ($person,$reason) = split(/ /, $msg, 2);

_________________
Current Site (2008) http://www.cuvou.com/
Back to top
eric256
The Keymaker
The Keymaker


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

PostPosted: Sun Feb 29, 2004 6:51 am    Post subject: Reply with quote

or you could try something like

Code:
<br />elsif($msg =~ /^\#block\s+(.*)\s+(.*)$/)<br />{<br />    my $blockuser = $1;<br />    my $blockreason = $2;<br />    # do your stuff here<br />}<br />


That regex wont even match unless they include a username and reason, of course it also doesn't present an error so they may never learn the correct way to block a user.

_________________
Eric256
Proud previous owner and current admin of Bot-depot.com
Back to top
Keenie
Almost An Agent
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Sun Feb 29, 2004 9:51 am    Post subject: Reply with quote

Lucida had something like this, but it sent emails to the people she blocked Wink

nice use a regex, makes life so much easier, you could use it inside the if statement to throw back errors even instead of at the start

Code:
elsif($msg =~ /^\#block)<br />{<br />   if($msg =~ /^\#block\s+(.*)\s+(.*)$/)<br />   {<br />      my $blockuser = $1;<br />      my $blockreason = $2;<br />      # do your stuff here<br />   }<br />   else<br />   {<br />      #teach those n00bs how to do it<br />   }<br />}


altho its still about as effective as Cers
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Wed Mar 03, 2004 7:56 pm    Post subject: Reply with quote

QUOTE(Mat007 @ Feb 7 2004, 04:12 PM)
To Save One
Code:
     }<br />   elsif($msg =~ /^\#bnote (.*)$/)<br />    {<br />     open (DATA, ">>bnotes/bnotes.txt");<br />     print DATA "$1\n";<br />     close(DATA); <br />     $self->sendmsg("Your Reason Was Saved!");<br />    }


Read one
Code:
     }<br />    elsif($msg =~ /^\#bnotesread/)<br />    {<br />     open (DATA, "bnotes/bnotes.txt");<br />     @line = <DATA>;<br />     close(DATA);<br />     $self->sendmsg("@line"); <br />    }


Works like noyte pad type #bnote yest@test.com->I preffer this way

You need to make a folder called bnotes brw!!

Matt

an other n00b question... where we create the folder called bnotes??
Back to top
mat007
Almost An Agent
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Wed Mar 03, 2004 8:04 pm    Post subject: Reply with quote

This is my crapy coding make it in the main morph folder
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Wed Mar 03, 2004 8:12 pm    Post subject: Reply with quote

QUOTE(Mat007 @ Mar 3 2004, 12:04 PM)
This is my crapy coding make it in the main morph folder

I do all i am suppose to do put the code at publics folder.... create bnotes inthe main folder of morphious but hwne i type !bnote i get notting notting 0 errors :S
Back to top
jeanhub
Almost An Agent
Almost An Agent


Joined: 14 Feb 2004
Posts: 1138

Reputation: 50.7

PostPosted: Wed Mar 03, 2004 8:29 pm    Post subject: Reply with quote

thanks now it works Very Happy
Back to top
JoeX
Agent
Agent


Joined: 02 Jan 2004
Posts: 2153

Reputation: 72.7

PostPosted: Sat Mar 06, 2004 11:12 am    Post subject: Reply with quote

You know what would be good?

Make it so you view the user's seperate

_________________
Heroes NBC
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