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.

timed bans

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

timed bans

Post by X-Ception »

I'm in need of a script that will for every user that joins set a timer that will ban the user 15 mins later unless user has already parted the channel.
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

additional

Post by X-Ception »

Will also need to exempt ops/halfops/voices from the banning, any one have any ideas or can point me in right direction ?
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

.

Post by X-Ception »

Ok gave it a go but its still nto right, +v +o users are kicked well actually all users regardlss of time in there are kicked after 15 mins :(

Code: Select all

bind join - * timed_bans

proc timed_bans {nick uhost hand chan} {
global botnick
  set ipmask [lindex [split [maskhost $nick![getchanhost $nick $chan]] "@"] 1]
  set userm [lindex [split [getchanhost $nick $chan] "@"] 0]
  set userhost *!*$userm@$ipmask
if {[isop $nick $chan]} {
puthelp "NOTICE $nick : \[DW\]-> Hello $nick Happy Opping"
putlog "\[DW\]-> $nick is a channel operator for $chan"
} else {
if {[isvoice $nick $chan]} {
puthelp "NOTICE $nick : \[DW\]-> Hello $nick Happy Helping"
putlog "\[DW\]-> $nick is a helper for $chan"
} else {
if {$nick == "nick" || $nick == $botnick} {
putlog "\[DW\]-> Don\'t want to ban myself or Gridlock really :P"
} else {
timer 15 [list putquick "MODE $chan +b $userhost"]
timer 15 [list putquick "KICK $chan $nick *pop*."]
# Logging/Debugging
timer 15 [list putlog "\[RS\]-> $nick was kicked and banned after using 15 mins"]
}
}
}
}
Help ?
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

That's because people don't have modes the moment they join, Try using a delayed check by means of a utimer.
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Actually, I guess you really wanna check permissions within the bot:

isop only checks wether the nickname has been opped on the channel or not, rather than look at the userlist and see wether they've got +o permission (same goes for isvoice)

Code: Select all

proc timed_bans {nick uhost hand chan} {
 global botnick
 if {$nick == $botnick || [matchattr $hand "+bflomn|flomn" $chan]} {
  return 0
 } else {
  timer 15 [list do_kick $nick $uhost $chan]
 }
}

proc do_kick {nick host channel} {
 if {[isop $nick $channel] || [isvoice $nick $channel]} {
  return 0
 } else {
  pushmode $channel +b [maskhost "$nick!$host"]
  putkick $channel $nick "*pop*"
  putlog "\[RS\]-> $nick was kicked and banned after using 15 mins"
 }
}
The above script checks both isop/isvoice and flags +o/+v etc

edit: Keep in mind tho, that this code does not handle nick-changes. You'll need something abit more complex for that...
NML_375
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

perfect

Post by X-Ception »

Perfect - thank you il give it a go, really it was only for channel permissions but bot permissions added also will work great.
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

one more question

Post by X-Ception »

sorry one more question:
if i used

Code: Select all

	if {$chan == "#channel"} {
would that ensure the proc only apply's to #channel ? ( forgot to mention its to only run for one channel, not all the bots within[/code]
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)

Code: Select all

bind join - "#channel *" timed_bans
I'd suggest something like this otherwize:

Code: Select all

if {[string tolower $chan] == "#channel"} {
NML_375
X
X-Ception
Voice
Posts: 37
Joined: Fri May 20, 2005 3:12 am
Location: Earth
Contact:

Post by X-Ception »

nml375 wrote:I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)

Code: Select all

bind join - "#channel *" timed_bans
I'd suggest something like this otherwize:

Code: Select all

if {[string tolower $chan] == "#channel"} {
Thank you once more - appreciated.
Post Reply