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.

private message ban

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

one last simple question for you.

If someone is opped, will it ignore thier private messages?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Not like this, it will only ignore users added to the bot.
NML_375
s
scooterh
Voice
Posts: 12
Joined: Fri May 01, 2009 10:32 pm

Post by scooterh »

if you ever have time u mind tossing something simple to ignore if the are opped at the time of msg or is that something thats alot of code?
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Not that much of a work, I'll have a look at it in a day or so.
NML_375
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Got a first draft..
Since private messages have no channel information, I'm currently making the assumption that being opped in any channel your eggdrop knows off is sufficient to avoid being banned.

Checks for a single channel, or a set of channels could be accomplished as well, with some additional coding. Using undernet's Cservice banlists would also require information on what channels to apply the ban on, so I'm sticking with eggdrop's internal banlist for now.

Code: Select all

bind msgm - * msgmDoBan

proc msgmDoBan {nick host handle text} {
 if {[matchattr "ofvb|ofv" $handle] || [isop $nick]} {
  return 1
 }
 newban [maskhost "${nick}!${host}"] $::botnick "Automated Ban: Do not msg bots" 0
 return 0
}
NML_375
User avatar
Ashoq
Voice
Posts: 11
Joined: Sat Jul 17, 2010 4:35 pm

Post by Ashoq »

nice :) its works !

but ! how can i !unban (cuse it bans again :P )
how can u ban $address like *!*@host.org


thnks :D
User avatar
username
Op
Posts: 196
Joined: Thu Oct 06, 2005 9:20 am
Location: Russian Federation, Podolsk
Contact:

Post by username »

Ashoq wrote:...
how can u ban $address like *!*@host.org
...
Change

Code: Select all

newban [maskhost "${nick}!${host}"] $::botnick "Automated Ban: Do not msg bots" 0
to

Code: Select all

newban *!*@[lindex [split ${host} "@"] 1] $::botnick "Automated Ban: Do not msg bots" 0
In $uhost you get adress like *!ident@host and you need to split it by "@" into two parts and add "*!*@" to the second part.
Архив TCL скриптов для ботов Eggdrop/Windrop:
http://egghelp.ru/
Post Reply