| View previous topic :: View next topic |
| Author |
Message |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Thu Aug 24, 2006 6:02 pm Post subject: timed bans |
|
|
| 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. |
|
| Back to top |
|
 |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Fri Aug 25, 2006 6:02 am Post subject: additional |
|
|
| Will also need to exempt ops/halfops/voices from the banning, any one have any ideas or can point me in right direction ? |
|
| Back to top |
|
 |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Fri Aug 25, 2006 1:36 pm Post subject: . |
|
|
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: |
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 ? |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Fri Aug 25, 2006 10:39 pm Post subject: |
|
|
| That's because people don't have modes the moment they join, Try using a delayed check by means of a utimer. |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Aug 26, 2006 8:27 am Post subject: |
|
|
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: | 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, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Sat Aug 26, 2006 9:15 am Post subject: perfect |
|
|
| Perfect - thank you il give it a go, really it was only for channel permissions but bot permissions added also will work great. |
|
| Back to top |
|
 |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Sat Aug 26, 2006 9:23 am Post subject: one more question |
|
|
sorry one more question:
if i used
| Code: |
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] |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Aug 26, 2006 9:28 am Post subject: |
|
|
I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)
| Code: | | bind join - "#channel *" timed_bans |
I'd suggest something like this otherwize:
| Code: | | if {[string tolower $chan] == "#channel"} { |
_________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
X-Ception Voice
Joined: 20 May 2005 Posts: 37 Location: Earth
|
Posted: Sat Aug 26, 2006 9:33 am Post subject: |
|
|
| nml375 wrote: | I'd rather solve that within the actual binding (otherwize you'd have to care for upper/lowercase in channel-name)
| Code: | | bind join - "#channel *" timed_bans |
I'd suggest something like this otherwize:
| Code: | | if {[string tolower $chan] == "#channel"} { |
|
Thank you once more - appreciated. |
|
| Back to top |
|
 |
|