ok`, this bot sits in a channel that see all the network(ircd's)
connections. Example of what the channel post, looks like this:

User tunix20 QUIT: Remote host closed the connection
User Connect mrtgbot2 from [EMAIL PROTECTED] on
irc.linuxirc.com gecos: mrtgbot
User babyg[aw] QUIT: Ping timeout: 258 seconds


so the line: if ($text =~ /User Connect (.*?)\ /
Would watch for "User Connect" text and strip everything after the nick.
Leaving me with just a nick to parse.

>From there it needs to be compared to my file for a match or partial
match. This is where my headache beings.

The code can be debugged or rewritten , which ever works. :)



On Tue, 2003-08-19 at 16:49, John Hebert wrote:
> What _does_ your code snippet below do? Do you want help in debugging the
> code below, or do you want a working alternative?
> 
> BTW, I assume you meant to say below; "I have tried this code, but (it) does
> (not) do exactly what i need."
> 
> Your code snippet is surprisingly readable for Perl :) but I'm not quite
> sure what this line does:
> 
>                 if ($text =~ /User Connect (.*?)\ /)
> 
> What does it do?
> 
> Also, what is the format for the nicks.txt file?
> 
> I like seeing coding discussion on the list. It is an opportunity to learn
> for me. Let's have more of it! :)
> 
> Thanks,
> John Hebert
> 
> -----Original Message-----
> From: Wade
> To: [email protected]
> Sent: 8/19/03 2:52 PM
> Subject: [brlug-general] perl bot
> 
> Need more help with my bot.
> Hope one of you perl geeks can help me with this.
> I need the bot to search a file for nick or nick patterns and KILL the
> nick.
> 
> I have tried this code, but does do exactly what i need.
> 
> open(LOG, "<nicks.txt") or die ("Could not open log file.");
>               @nicks = <LOG>;
>                 if ($text =~ /User Connect (.*?)\ /) {
>                 $user = $1;
>                 chomp($user);
>                 foreach $pat (@nicks) {
>                  if ($user =~ /$pat/) {
>                 print $sock "PRIVMSG $mychan :DRONE\r\n";
>                 last;
> 
> the PRIVMSG is just to test the bot to get it to print DRONE when it
> matches a nick or pattern.
> 
> So what i need is, if i have "Mark" in the file , i need the bot to kill
> mark, or if i have *1 in the file in need the bot to kill every nick
> that ends in 1.
> 
> Sounds kinda useless , but the bot i wrote before this one working in
> conjunction with another service and I would like this bot to work by
> itself.
> 
> Wade
> 
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://brlug.net/mailman/listinfo/general_brlug.net
> 
> _______________________________________________
> General mailing list
> [email protected]
> http://brlug.net/mailman/listinfo/general_brlug.net
> 

Reply via email to