mIRC Home    About    Download    Register    News    Help

Print Thread
#95026 21/08/04 01:46 PM
Joined: Aug 2004
Posts: 10
B
BigP Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Aug 2004
Posts: 10
I get a lot of private messages I dont want which usually contain specific text.

Can I use the on open command with ^ to log the text to another window and close the pm ?

#95027 21/08/04 03:49 PM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
For logging all queries:
Code:
on ^*:OPEN:?: {
 if (!$window(@Privates)) { window -e @Privates }
 echo -lbftm @Privates $+(<,$nick,>) $1-
 haltdef
}

For loggin specified text:
Code:
on ^*:OPEN:?: {
 if ($istok($strip($1-),[color:red]text here[/color],32)) {
  if (!$window(@Privates)) { window -e @Privates }
  echo -lbftm @Privates $+(<,$nick,>) $1-
  haltdef
 }
}
I think this should do it smile

Zyzzyx.

Last edited by Zyzzyx26; 21/08/04 03:52 PM.

"All we are saying is give peace a chance" -- John Lennon
#95028 21/08/04 03:58 PM
Joined: Mar 2004
Posts: 359
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Mar 2004
Posts: 359
Code:
on ^*:open:?:*sex*: { haltdef | write pmlog.txt $nick said $2- }


This would write anything with the word sex to a txt file. You wouldn't see the window opening, though. You coud use /loadbuf to load the text in that file to a @window. /help /loadbuf

EDIT: Zyzzyx beat me to the post :tongue:

Last edited by LostServ; 21/08/04 03:59 PM.
#95029 21/08/04 05:17 PM
Joined: Aug 2004
Posts: 10
B
BigP Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Aug 2004
Posts: 10
Thanks guys.

I used the first example laugh

#95030 22/08/04 12:03 AM
Joined: Aug 2004
Posts: 10
B
BigP Offline OP
Pikka bird
OP Offline
Pikka bird
B
Joined: Aug 2004
Posts: 10
This works great but I need a little more help.

As well as logging pm's I would like to put their whois info into the same window so I can ban them for spamming links to viruses etc.

Is this possible ?

#95031 22/08/04 12:30 AM
Joined: Feb 2004
Posts: 714
Z
Hoopy frood
Offline
Hoopy frood
Z
Joined: Feb 2004
Posts: 714
I will use the code for specific text.
Code:
on ^*:OPEN:?: {
 if ($istok($strip($1-),[color:red]text here[/color],32)) {
  if (!$window(@Privates)) { window -e @Privates }
  echo -lbftm @Privates $+(<,$nick,>) $+($chr(40),$address,$chr(41)) $1-
  haltdef
 }
}
This code will echo, in that @Privates window, the nick and the address of the person, plus the message. Eg:

<John> (office@fedex.com) Want to send a package?? Use FedEX!!

With this info you're already able to ban them. If you want the code to actually /whois a person, then the code gets a bit larger:
Code:
on ^*:OPEN:?: {
 if ($istok($strip($1-),[color:red]text here[/color],32)) {
  if (!$window(@Privates)) { window -e @Privates }
  echo -lbftm @Privates $+(&lt;,$nick,&gt;) $1- 
  haltdef
  .enable #Whois
  whois $nick
  .timerWhois $+ $nick 1 5 .disable #Whois
  }
}
#Whois off
raw 311: echo @Privates $+(&lt;,$nick,&gt;) $1-
raw 319: echo @Privates $+(&lt;,$nick,&gt;) $1-
raw 312: echo @Privates $+(&lt;,$nick,&gt;) $1-
raw 330: echo @Privates $+(&lt;,$nick,&gt;) $1-
raw 317: echo @Privates $+(&lt;,$nick,&gt;) $1-
raw 318: echo @Privates $+(&lt;,$nick,&gt;) $1-
#Whois end
This last one I'm not sure its going to work, but as I said, with the 1st one you can already place a ban.

As an aside note: If you want yo use more than just 1 text to detect the spam, add || ($istok($strip($1-),other text here,32)) to the 1st IF. Eg:

on ^*:OPEN:?: {
; The code below is the 1st IF
if ($istok($strip($1-),text here,32)) || ($istok($strip($1-),other text here,32)) || ($istok($strip($1-),yet other text,32)) || ... {


Hope this helps smile

Zyzzy.

Last edited by Zyzzyx26; 22/08/04 12:36 AM.

"All we are saying is give peace a chance" -- John Lennon

Link Copied to Clipboard