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.

somebody can help me please ?

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

somebody can help me please ?

Post by KiMoW »

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
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

Code: Select all

 { 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

:)
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

Post by KiMoW »

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
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

Maybe try:

Code: Select all

.chanset #test -enforcebans +dynamicbans
.chanset #test ban-time 30 
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

Post by KiMoW »

yup i know but no results
User avatar
Nor7on
Op
Posts: 185
Joined: Sat Mar 03, 2007 8:05 am
Location: Spain - Barcelona
Contact:

Post by Nor7on »

and...

Code: Select all

global-ban-time 30 
or put:

Code: Select all

.chaninfo #yourchan
and paste here your results.
b
blake
Master
Posts: 201
Joined: Mon Feb 23, 2009 9:42 am
Contact:

Post by blake »

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: Select all

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
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

Post by KiMoW »

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
User avatar
TCL_no_TK
Owner
Posts: 509
Joined: Fri Aug 25, 2006 7:05 pm
Location: England, Yorkshire

Post by TCL_no_TK »

*sign*

Code: Select all

# 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
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

Post by KiMoW »

Code: Select all

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]
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

First off, there's no command named 'else'. That added with tcl's behavior to terminate commands on newline makes the following break:

Code: Select all

  if {$nick == Lea} {return}
  else {
'Else' should be another parameter for 'if', so it needs to be on the same line:

Code: Select all

if {$nick == Lea} {
  return
} else {
Next, try adding some putlog's in there for debugging:

Code: Select all

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
K
KiMoW
Voice
Posts: 6
Joined: Mon Jan 18, 2010 4:18 am
Contact:

Post by KiMoW »

yup :p thank you
Post Reply