| View previous topic :: View next topic |
| Author |
Message |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 4:26 am Post subject: somebody can help me please ? |
|
|
bind mode - "*+b" Rem_ban
proc Rem_Ban { nick host hand chan mode target } {
if {$nick != Lea} {
set banmask $target
timer 30 [list putquick "MODE $chan -b $target" ]
}
}
the base is that if one user ban someone the eggdrop will remove the ban after 30 min _________________ http://www.open-serv.net/ |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Mon Jan 18, 2010 8:36 am Post subject: |
|
|
| Code: | | { nick host hand chan mode target } | $nick = The Operator that done the mode change (in this case the ban).
I should mention that eggdrop already has a alot settings that control when it removes bans and how long they last on the channel. You can change/set this via the config file (global) or via DCC/Telnet command chanset
Example: (setting all channel bans to be removed after 30mins on my channel #test, i would issue the following command in DCC/Telnet)
.chanset #test ban-time 30
 _________________ TCL the misunderstood |
|
| Back to top |
|
 |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 3:02 pm Post subject: |
|
|
i know i already tried but without results so i'm triying to do it at a tcl code that i will put at the eggdrop _________________ http://www.open-serv.net/ |
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Jan 18, 2010 3:26 pm Post subject: |
|
|
Maybe try:
| Code: | .chanset #test -enforcebans +dynamicbans
.chanset #test ban-time 30 |
|
|
| Back to top |
|
 |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
|
| Back to top |
|
 |
Nor7on Op

Joined: 03 Mar 2007 Posts: 185 Location: Spain - Barcelona
|
Posted: Mon Jan 18, 2010 3:39 pm Post subject: |
|
|
and...
or put:
| Code: | | .chaninfo #yourchan |
and paste here your results. |
|
| Back to top |
|
 |
blake Master
Joined: 23 Feb 2009 Posts: 201
|
Posted: Mon Jan 18, 2010 5:26 pm Post subject: |
|
|
TCL_no_TK wrote this a few weeks back for me allows for the bot to set +b usernick and kick will remove ban after set amount of minutes
| Code: | bind msg ho|ho bankick cmd:bankick
proc cmd:bankick {nick host hand text} {
set chan [lindex [split $text] 0]
set user [lindex [split $text] 1]
set why [join [lrange [split $text] 2 end-1]]
set chk [join [lrange [split $text] end end]]
if {![regexp -- {^[0-9]} $chk]} {set why [join [lrange [split $text] 2 end]]} else {set bantime [join [lrange [split $text] end end]]}
if {[info exists bantime]} {
putserv "MODE $chan +b $user"
putserv "PRIVMSG ChanServ KICK $chan $user $why) (Issued By $nick"
timer $bantime [list putserv "MODE $chan -b $user"]
return 1
} else {
putserv "MODE $chan +b $user"
putserv "PRIVMSG ChanServ KICK $chan $user $why) (Issued By $nick"
return 1
}
}
|
works via private msg /msg botnick bankick chan nick reason time _________________ Blake
UKEasyHosting UKStormWatch |
|
| Back to top |
|
 |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
Posted: Mon Jan 18, 2010 8:38 pm Post subject: |
|
|
when i do the chan info i have that the ban time is setted to 30 min but when i ban it doesn't remove it.
Blake i don't wanna put the +b i wanna remove it _________________ http://www.open-serv.net/ |
|
| Back to top |
|
 |
TCL_no_TK Owner

Joined: 25 Aug 2006 Posts: 509 Location: England, Yorkshire
|
Posted: Tue Jan 19, 2010 3:10 am Post subject: |
|
|
*sign* | Code: | # forces any ban set on the channel to be removed in 30mins regardless of any channel settings
proc mode:force_unban {nick uhost hand chan mode {target ""}} {
global botnick
if {$target == ""} {
set target "$botnick"
}
# ignore unrealircd's "channel" and "GEOS (realname)" bans
if {![regexp {^~(c|r)} $target]} {
timer 30 [list pushmode $chan -b $target]
return
}
}
bind mode -|- "*+b*" mode:force_unban |
_________________ TCL the misunderstood |
|
| Back to top |
|
 |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
Posted: Tue Jan 19, 2010 6:31 pm Post subject: |
|
|
| Code: | proc mode:force_unban {nick uhost hand chan mode {target ""}} {
global botnick
if {$nick == Lea} {return}
else {
if {$target == ""} {
set target "$botnick"
}
if {![regexp {^~(c|r)} $target]} {
timer 30 [list pushmode $chan -b $target]
return
}
}
}
bind mode -|- "*+b*" mode:force_unban |
why doesn't it work ?[/code] _________________ http://www.open-serv.net/ |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue Jan 19, 2010 7:00 pm Post subject: |
|
|
First off, there's no command named 'else'. That added with tcl's behavior to terminate commands on newline makes the following break:
| Code: | if {$nick == Lea} {return}
else { |
'Else' should be another parameter for 'if', so it needs to be on the same line:
| Code: | if {$nick == Lea} {
return
} else { |
Next, try adding some putlog's in there for debugging:
| Code: | proc mode:force_unban {nick uhost hand chan mode {target ""}} {
global botnick
putlog "Ban detected: Nick: $nick ($uhost) Handle: $hand Channel: $chan Mode: $mode ($target)"
if {$nick == Lea} {
putlog "nickname is Lea, aborting"
return
} else {
if {$target == ""} {
set target "$botnick"
}
putlog "Running regular expression..."
if {![regexp {^~(c|r)} $target]} {
putlog "No match!, starting timer..."
set timer [timer 30 [list pushmode $chan -b $target]]
putlog "Timer $timer started!"
return
}
}
putlog "end of proc"
}
bind mode -|- "*+b*" mode:force_unban |
That should let you see what is going on behind the scenes.. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
KiMoW Voice
Joined: 18 Jan 2010 Posts: 6
|
|
| Back to top |
|
 |
|