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 

[req] word x2 within 15 minutes = kick/ban

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


Joined: 31 Jul 2006
Posts: 12

PostPosted: Sat Apr 28, 2007 10:54 pm    Post subject: [req] word x2 within 15 minutes = kick/ban Reply with quote

I need a script that will kick/ban a user for using a command " !stop "
in public chat

I would like for it to kick/ban the user on the 2nd " !stop " if its within a 15 minutes of the last time. it has to be per user. as in if 1 person does it and then someone else it wont kick .. but only if its the same *!*@IP
The ban should last 1440 minutes or 24 hours.
i have tried many different ways to get this to work, and i keep falling short. any help on this matter would greatly be appreciated thank you in advanced
Back to top
View user's profile Send private message MSN Messenger
YooHoo
Owner


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Sun Apr 29, 2007 2:02 pm    Post subject: Reply with quote

use an existing "bad word" script, and modify it accordingly.
bad word scripts
Mr. Green
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
BIF
Voice


Joined: 31 Jul 2006
Posts: 12

PostPosted: Sun Apr 29, 2007 2:32 pm    Post subject: Reply with quote

been there tryed that.. everything kicks after 1 " bad word " im looking for a kick ban after 2 words within 15 minutes
Back to top
View user's profile Send private message MSN Messenger
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sun Apr 29, 2007 4:42 pm    Post subject: Reply with quote

I aint clear about what you want, I mean do you want a script to ban a user who types !stop 2 times within 15 minutes and the bot should ban him for 24 hours. If he types !stop onces the bot will do nothing right?
Back to top
View user's profile Send private message Visit poster's website
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Apr 29, 2007 6:04 pm    Post subject: Reply with quote

Code:
bind pub - !stop ban:stop

proc ban:stop {nick uhost hand chan arg} {
 if {[throttled [lindex [split $uhost @] 1] 900]} {
  putkick $chan $nick "!stop command abusement."
  newchanban $chan *!*@[lindex [split $uhost @] 1] !stop-abuse "!stop command abusement." 1440
 }
}

# user's throttled proc
proc throttled {id time} {
 global throttled
 if {[info exists throttled($id)]} {
  return 1
 } {
  set throttled($id) [clock sec]
  utimer $time [list unset throttled($id)]
  return 0
 }
}

_________________
Follow me on GitHub

- Opposing

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


Joined: 31 Jul 2006
Posts: 12

PostPosted: Sun Apr 29, 2007 9:04 pm    Post subject: Reply with quote

Thanks alot for that.. and yes iamdeath Thats extactly what i want
Back to top
View user's profile Send private message MSN Messenger
BIF
Voice


Joined: 31 Jul 2006
Posts: 12

PostPosted: Sun Apr 29, 2007 9:29 pm    Post subject: Reply with quote

Sir_Fz wrote:
Code:
bind pub - !stop ban:stop

proc ban:stop {nick uhost hand chan arg} {
 if {[throttled [lindex [split $uhost @] 1] 900]} {
  putkick $chan $nick "!stop command abusement."
  newchanban $chan *!*@[lindex [split $uhost @] 1] !stop-abuse "!stop command abusement." 1440
 }
}

# user's throttled proc
proc throttled {id time} {
 global throttled
 if {[info exists throttled($id)]} {
  return 1
 } {
  set throttled($id) [clock sec]
  utimer $time [list unset throttled($id)]
  return 0
 }
}

Just Tested this.. Works Flawlessly .. How would i go about setting it not to kick +f or ops ?
Back to top
View user's profile Send private message MSN Messenger
YooHoo
Owner


Joined: 13 Feb 2003
Posts: 939
Location: Redwood Coast

PostPosted: Sun Apr 29, 2007 10:11 pm    Post subject: Reply with quote

BIF wrote:
Just Tested this.. Works Flawlessly .. How would i go about setting it not to kick +f or ops ?
use another if statement, utilizing matchattr
_________________
Mr. Green
Johoho's TCL for beginners
Mr. Green
Back to top
View user's profile Send private message Send e-mail
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Apr 30, 2007 12:11 pm    Post subject: Reply with quote

You can add this line in the ban:stop proc:
Code:
if {[matchattr $hand f|f $chan]} {return 0}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
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