egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

anti action /ame

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
fredvil
Voice


Joined: 01 Dec 2005
Posts: 21

PostPosted: Fri Jan 05, 2007 9:42 am    Post subject: anti action /ame Reply with quote

does anyone here know a script that will ban user that uses action /ame.

example if bot and nick are on 2 channels and when the nick uses /ame the bot will ban him/her.

thanks a lot
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Jan 05, 2007 10:30 am    Post subject: Re: anti action /ame Reply with quote

fredvil wrote:
does anyone here know a script that will ban user that uses action /ame.

example if bot and nick are on 2 channels and when the nick uses /ame the bot will ban him/her.

thanks a lot

/ame is not a irc command, but a client "feature" sending multiple ctcp ACTIONs, so there's no way to detect the difference between /ame and multiple /me's Razz The best you can do is guess...here's a script that will ban any user doing the same action two times in a row within 5 seconds.
Code:
bind ctcp - ACTION ameban
proc ameban {n u h t a b} {
   if {[validchan $t]&&![matchattr $h nmof|mnof $t]} {
      global ameban
      set id $n!$u
      if {[info exists ameban($id)]} {
         if {$ameban($id)==$b} {
            newban [lindex [split $u @] 1] ${::botnet-nick} "ameban" 60
            return
         } {
            killtimer $ameban($id,timer)
         }
      }
      set ameban($id) $b
      set ameban($id,timer) [utimer 5 "unset [list ameban($id)]; unset [list ameban($id,timer)]"]
   }
}

(not tested)
EDIT2: variable name
_________________
Have you ever read "The Manual"?


Last edited by user on Sat Jan 06, 2007 5:31 pm; edited 5 times in total
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Fri Jan 05, 2007 11:19 am    Post subject: Reply with quote

This will ban any user for using actions.
Included an option to exclude chanops from banning.

Code:
# actban variable is setting ban time
# use 0 to make perm
set actban 10

bind ctcp - ACTION ban:act

proc ban:act { nick uhost hand dest key text } {
  #uncomment next line to exclude chanops
  #if [!isop $nick] return
  newban *!$uhost $::botnick action_ban $::actban           
}

[ edited to correct global ]
Back to top
View user's profile Send private message
DragnLord
Owner


Joined: 24 Jan 2004
Posts: 711
Location: C'ville, Virginia, USA

PostPosted: Fri Jan 05, 2007 1:08 pm    Post subject: Reply with quote

the following will give the user a global ban, and kick the person from all channels the bot is on with that nick

(tested)

Code:

# actban variable is setting ban time in minutes
# use 0 to make perm
set actban 10
 
bind ctcp - ACTION ban:act

proc ban:act { nick uhost hand dest key text } {
  #uncomment next line to exclude chanops
  #if [!isop $nick] return
  newban *!$uhost $::botnick action_ban $::actban
  foreach chan [channels] {
    if [onchan $nick $chan] { putquick "KICK $chan $nick" } 
  }
}
Back to top
View user's profile Send private message
fredvil
Voice


Joined: 01 Dec 2005
Posts: 21

PostPosted: Fri Jan 05, 2007 11:00 pm    Post subject: Reply with quote

hi user... got this error.. pls help thanks

Code:
[11:00] Tcl error [ameban]: can't read "c": no such variable
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Fri Jan 05, 2007 11:43 pm    Post subject: Reply with quote

try the edited version
_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
fredvil
Voice


Joined: 01 Dec 2005
Posts: 21

PostPosted: Sat Jan 06, 2007 2:44 am    Post subject: Reply with quote

you got it user... u the man.. thanks a lot...Smile

one more thing user... how to change the ban type to *!*@10.0.0.2 or *!*@host.domain.com
Back to top
View user's profile Send private message
user
 


Joined: 18 Mar 2003
Posts: 1452
Location: Norway

PostPosted: Sat Jan 06, 2007 9:09 am    Post subject: Reply with quote

fredvil wrote:
how to change the ban type to *!*@10.0.0.2 or *!*@host.domain.com

Code:
newban *!*@[lindex [split $u @] 1] ${::botnet-nick} "ameban" 60

_________________
Have you ever read "The Manual"?
Back to top
View user's profile Send private message
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Sat Jun 28, 2008 12:54 am    Post subject: Reply with quote

Hi, anyone can help me this script work only on one channel not global... thanks in advance Very Happy
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Jun 28, 2008 8:50 am    Post subject: Reply with quote

Sydneybabe wrote:
Hi, anyone can help me this script work only on one channel not global... thanks in advance Very Happy

It bans if a user does multiple actions within the same channel or different channels.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Sydneybabe
Op


Joined: 27 Apr 2007
Posts: 106
Location: Philippines

PostPosted: Sun Jun 29, 2008 1:06 am    Post subject: Reply with quote

Dragonlord message:
Quote:
the following will give the user a global ban, and kick the person from all channels the bot is on with that nick


i mean only work with one channel not all channels where the bot is on.
Back to top
View user's profile Send private message
holycrap
Op


Joined: 21 Jan 2008
Posts: 152

PostPosted: Fri Dec 19, 2008 2:53 pm    Post subject: Reply with quote

@ DragnLord

So, how would you do this? Notice the user with first offense "don't use /ame" and ban them the second time with a message "you have been warned."

Thanks!

Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber