This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Special anti Advertising Script

Old posts that have not been replied to for several years.
P
Phazer

Special anti Advertising Script

Post by Phazer »

Does someone know how to do this?

I want an anti advertising script that does kick on every #blabla message, but _not_ on #mychannelname.

Please help!

Phazer
User avatar
ReaLz
Op
Posts: 121
Joined: Sat Oct 19, 2002 5:33 am
Location: Athens, Greece

Post by ReaLz »

Code: Select all

bind pubm - "#* *#*" pubm_invs

proc pubm_invs {nick host hand chan args} {
if {![string match "*$chan*" $args]} {
set mask "*!*@[lindex [split $host @] 1]"
newban $mask Spam "\00220 minutes\002 ban for \002Spaming\002 within \002$chan\002 " 20
return 1
}
}
«A fantastic spaghetti is a spaghetti that does not exist»
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Well, it seems a bit buggy. Do a test like this: bla bla bla #mychan bla bla bla #something and it returns when should be banning. :)
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

A quick solution may be something like this:

Code: Select all

bind pubm - {* *#*} my:spam

proc my:spam {nick uhost hand chan text} {
  foreach bla [split $text] {
    if {[string match "#*" $bla]} {
      if {[validchan $bla]} {
        continue
      }
      set mask "*!*@[lindex [split $uhost @] 1]" 
      newban $mask Spam "\00220 minutes\002 ban for \002Spaming\002 within \002$chan\002 " 20
      break
    }
  }
}
Once the game is over, the king and the pawn go back in the same box.
P
Phazer

Post by Phazer »

Thank you guys! Works without problems.. great!

Greets,
Phazer
k
kurt_nirvana
Voice
Posts: 16
Joined: Thu Jun 05, 2003 7:52 am

with #...

Post by kurt_nirvana »

works nice, but how to make to dont ban when the ppl say only # ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Right before the:

Code: Select all

if {[string match "#*" $bla]} {
add this:

Code: Select all

if {[string match "#" $bla]} { continue }
Once the game is over, the king and the pawn go back in the same box.
k
kurt_nirvana
Voice
Posts: 16
Joined: Thu Jun 05, 2003 7:52 am

coool

Post by kurt_nirvana »

coooooool. thx :)
k
kurt_nirvana
Voice
Posts: 16
Joined: Thu Jun 05, 2003 7:52 am

ops

Post by kurt_nirvana »

one more thing... how to make for dont ban ops when say #chan ?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Right before the:

Code: Select all

foreach bla [split $text] {
add:

Code: Select all

if {![botisop $chan] || [isop $nick $chan]} { return }
Once the game is over, the king and the pawn go back in the same box.
k
kurt_nirvana
Voice
Posts: 16
Joined: Thu Jun 05, 2003 7:52 am

:D

Post by kurt_nirvana »

thx again :) [[[[]]]]
r
rileyvrh
Voice
Posts: 13
Joined: Tue Jun 24, 2003 11:27 am
Location: orange texas
Contact:

Post by rileyvrh »

ok got another twist to this scripting that i been trying to do, i want the bot to be able to set unoped and send x on undernet a msg to ban the person who is spaming wihtout the bot being oped?
Being a Coach Potato is All its cracked up to Be!!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

In this case drop the "![botisop $chan]" and add before the "break" this lines:

Code: Select all

if {[string match "*@*.users.undernet.org" $uhost]} {
putserv "PRIVMSG X :ban $chan $mask 336 100 add a reason here.."
}
Once the game is over, the king and the pawn go back in the same box.
r
rileyvrh
Voice
Posts: 13
Joined: Tue Jun 24, 2003 11:27 am
Location: orange texas
Contact:

Post by rileyvrh »

ceasar if this works i'll shave my head with your name in it.
Being a Coach Potato is All its cracked up to Be!!
r
rileyvrh
Voice
Posts: 13
Joined: Tue Jun 24, 2003 11:27 am
Location: orange texas
Contact:

Post by rileyvrh »

<Cowgyrl> [17:40] Tcl error in file 'bot4.con':
<Cowgyrl> [17:40] wrong # args: should be "proc name args body"
<Cowgyrl> while executing
<Cowgyrl> "proc my:spam {nick uhost hand chan text} {
<Cowgyrl> if {[string match "*@*.users.undernet.org" $uhost]} {
<Cowgyrl> putserv "PRIVMSG X :ban $chan $mask 336 100 spami..."
<Cowgyrl> (file "scripts/spam.tcl" line 3)
<Cowgyrl> invoked from within
<Cowgyrl> "source scripts/spam.tcl"
<Cowgyrl> (file "bot4.con" line 1100)

This is what the tcl looks like ? Can see what i did wrong?

bind pubm - {* *#*} my:spam

proc my:spam {nick uhost hand chan text} {
if {[string match "*@*.users.undernet.org" $uhost]} {
putserv "PRIVMSG X :ban $chan $mask 336 100 spaming"
} || [isop $nick $chan]} { return }
foreach bla [split $text] {
if {[string match "#" $bla]} { continue }
if {[string match "#*" $bla]} {
if {[validchan $bla]} {
continue
}
set mask "*!*@[lindex [split $uhost @] 1]"
newban $mask Spam "\00220 minutes\002 ban for \002Spaming\002 within \002$chan\002 " 20
break
}
}
}
Being a Coach Potato is All its cracked up to Be!!
Locked