| View previous topic :: View next topic |
| Author |
Message |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Mon Nov 10, 2008 4:16 pm Post subject: SIMPLE kick/ban w/timer |
|
|
Hello !
I tryed but no sucess =D
I just want a simple ban/script like
.noflame $nick
+ban $nick
+kick $nick ( NO FLAME !!! )
(after 1 hour)
-ban $nick
Thanks !
GaRfWeN |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Nov 11, 2008 4:33 pm Post subject: |
|
|
Hopefully, you did not want it to just ban the nickname for the banmask :S
If you did, then let me know so i can change it. Here it is anyway, | Code: | set noflame_access "o|o" ;# access flags for public command
# "global-flag"|"channel-flag"
set noflame_message "NO FLAME !!!" ;# kick/ban message
set noflame_time "100" ;# time to remove ban after this many minets
proc noflame:pub {nick host handle channel text} {
global noflame_message noflame_time
if {([llength $text] == 0)} {
puthelp "NOTICE $nick :Syntax: .noflame <nickname>"
return 0
}
set target [lindex [split $text] 0]
if {(![onchan $target $channel])} {
puthelp "NOTICE $nick :I dont see $target on this channel."
return 0
} else {
if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
if {([botisop $channel]) || ([botishalfop $channel])} {
putserv "KICK $channel $target :$noflame_message"
putserv "MODE $channel +b $banmask"
timer $noflame_time [list pushmode $channel -b $banmask]
return 1
} else {
puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
return 0
}
}
}
proc noflame:checksettings {} {
global noflame_message noflame_time noflame_access
if {($noflame_access == "")} {
putlog "noflame.tcl: invalid access flags set, should be <globalflag>|<channelflag> (setting it to default o|o)"
set noflame_access o|o
} else {
bind pub $noflame_access .noflame noflame:pub
}
if {($noflame_time < 0) || ($noflame_time == 999)} {
putlog "noflame.tcl: invalid ban time, should be above 0 and below 999. (setting it to default 100)"
set noflame_time 100
}
if {($noflame_message == "") || ([llength $noflame_message] > 200)} {
putlog "noflame.tcl: invalid kick messag. (setting to default \"Please do not flame in this channel\")"
set noflame_message "Please do not flame in this channel"
}
return
}
putlog "loaded noflame.tcl"
return [noflame:checksettings] | haven't had time to test it, sorry. least you know where to find me, if it dosen't  _________________ TCL the misunderstood |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Thu Nov 13, 2008 1:20 pm Post subject: Ty. |
|
|
Hello !
1st ty.
Theres something wrong on the code, because the eggdrop does not kick/ban.
The other commands are working fine.
Guess its something over here:
| Code: |
set target [lindex [split $text] 0]
if {(![onchan $target $channel])} {
puthelp "NOTICE $nick :I dont see $target on this channel."
return 0
} else {
if {([string match "*!~*@*" "$target![getchanhost $target $channel]"])} {set banmask [maskhost [regsub "~" "$target![getchanhost $target $channel]" "*"]]} else {set banmask [mashost "$target![getchanhost $target $channel]"]}
if {([botisop $channel]) || ([botishalfop $channel])} {
putserv "KICK $channel $target :$noflame_message"
putserv "MODE $channel +b $banmask"
timer $noflame_time [list pushmode $channel -b $banmask]
return 1
} else {
puthelp "NOTICE $nick :unable to kick/ban $target (i'm not oped)"
return 0
}
}
}
|
Cumps,
GaRfWeN |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Thu Nov 13, 2008 2:54 pm Post subject: |
|
|
Could you give more details please? They only way from that, which the bot couldn't be kicking and banning someone was if they where not A Channel Operator or Channel HalfOp (if supported). other than that, it would be becouse the nickname you supplyed wasn't on the bots channel where you used the command. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Thu Nov 13, 2008 3:59 pm Post subject: |
|
|
Nop, the egg has op (im runnig it on qnet, #cs.gthr.pt)
When i type wrong nick he notices me, and also when i just dont put any nick.
It just doesnt works on the kick/ban acting: he does nothing. |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Fri Nov 14, 2008 1:43 am Post subject: |
|
|
Ok after testing the script my self, I've found no problems. The bot seems to be kicking and banning as it should given its a little fast to kick. but not really seeing any problem with that. | Quote: | [05:30:48] <@Me> .noflame Flamer
[05:30:49] * Flamer was kicked by bot (NO FLAME !!!)
[05:30:50] * bot sets mode: +b *!*noident@*.flame.org | The Bot Not oped on the channel seems to work | Quote: | [05:31:11] <@ME> .noflame Flamer
[05:31:11] -bot- unable to kick/ban Flamer (i'm not oped) | And when the nickname isn't on the channel it works fine. | Quote: | [05:31:04] <@Me> .noflame Flamer
[05:31:05] -bot- I dont see Flamer on this channel. | I got the same thing on Quakenet so i doubt it was a problem the syntax. I'd check out if anything on your bot could be preventing it from kicking and banning or an other script
Example: do you use some kind of "maskhost fixing script" that could be causing the problem? since the "maskhost" is used in this script. _________________ TCL the misunderstood |
|
| Back to top |
|
 |
garfwen Halfop
Joined: 12 Mar 2008 Posts: 61
|
Posted: Sat Nov 15, 2008 5:51 pm Post subject: |
|
|
hey.
Nop have no idea.
I search a little and i found a script... with some edits:
| Code: |
bind PUB - .noflame pub:timeban
proc pub:timeban {nickname hostname handle channel arguments} {
if {[llength [set arguments [split $arguments]]] < 1} {
putquick "NOTICE $nickname :Usage: !timeban nickname"
} elseif {![onchan [set nick [lindex $arguments 0]] $channel]} {
putquick "NOTICE $nickname :I don't see $nick on $channel!"
} else {
if {[isop $nickname $channel]} {
putquick "MODE $channel +b $nick"
putquick "KICK $channel $nick :\026 Flame não é permitido, ban 60 minutos. Regras: http://gather.dotsi.pt \026"
timer 60 [list putquick "MODE $channel -b $nick"]
}
}
}
|
This1 is working on my egg.
Ty TCL_no_TK.
GaRfWeN |
|
| Back to top |
|
 |
|