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.

Join Flood Protection (need help)

Old posts that have not been replied to for several years.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I've also noticed an typo mistake, from:

Code: Select all

  utimer $unlockin [list reset [string tolower $chan]]
to:

Code: Select all

  utimer $insec [list reset [string tolower $chan]]
I've also did some changes, added some new features to it and I'm doing the final tests now and preparing it to be sent to the Archive..
Once the game is over, the king and the pawn go back in the same box.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Tests where complete and succesfull. I've added a new feature to it (+njf for channels you want it enabled), made changes to the code, fixed the stuff that we discussed til now and sent it to slennox for the TCL Archive. Also, I've uploaded it here, on my *webby* :)

PS: Let me know if there are some *bugs* or something in it.
Once the game is over, the king and the pawn go back in the same box.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

caesar i tried to dl from your link but the page cannot be displayed. so i tried this code.
# njf.tcl
# version 0.3
# caesar <cezarica@prietenii.com>
# #eggdrop @ Undernet.org
# http://www.geocities.com/caesartcl/

### Description:
# An small and efective channel locker in case of an botnet join.
#
### What's new?
# o added specific channel flag, this means it will work only for channels that have +njf flag;
# o corrected some problems regarding the channel locker (thanks to ppslim for the solution
# and to Gothic-Angel for pointing this out!);
# o some other small fixes.
#
### Many thanks to:
# o MassKilla (#eggdrop @ Undernet) for the help on arrays and stuff;
# o ppslim for the solution on the channel locker modes;
# o Gothic-Angel for tryng and pointing out some problems in the previous version.
#
#
### Instructions:
# In order it to work on your channel, it must have +njf flag. Use .chanset to add/remove it.
#
### Commands:
#
# Where Flag Command Description
# ----- ---- ------- -----------
#
# PUB : N/A
#
# MSG : N/A
#
# DCC : n|n .chanset Use .chanset to set the script active for the particular channel or not.
# Example: .chanset #bla +njf
# .chanset #bla -njf
#
### Settings:
#
# What channel modes do you want to be used for locking the channel?
set modes "mR"

# Number of joins in seconds keep channel locked for?
# By default I've set it to 8 joins in 3 seconds to lock the channel for 60 seconds.
set jtu 6:4:30

### ANY EDITING AND/OR MODIFICATIONS MADE BEYOND THIS IS YOUR OWN RISK! ###

# stuff
setudef flag njf
foreach chan [channels] {
if {![channel get [string tolower $chan] njf]} { continue }
set val([string tolower $chan]) 0 }

# binds
bind join - * njf:join
bind part - * njf:part

# join
proc njf:join {nick uhost handle chan} {
global val
if {$nick == $::botnick || ![botisop [string tolower $chan]] || ![channel get [string tolower $chan] njf]} {
return
}

# fix after an .chanset on a channel
if {![info exists val([string tolower $chan])]} { set val([string tolower $chan]) 0 }

# is channel locked?
set cm [getchanmode $chan]
if {(([string match {+*[$::modes]*[::modes]*} $cm]) && ([llength [split $::modes]] == 1)) || (([string match {+*[::modes]*[::modes]* *} $cm]) && ([length [split $cm]] > 1))} { return }

# array fix
foreach channel [array names val] {
if {[string match [string tolower $chan] [string tolower $chan]nel]} {
array set val "[string tolower $chan] 0"
}
}

# continue
set nojoins [lindex [split $::jtu ":"] 0]
set insec [lindex [split $::jtu ":"] 1]
set unlockin [lindex [split $::jtu ":"] 2]
incr val([string tolower $chan])
utimer $insec [list reset [string tolower $chan]]
if {$val([string tolower $chan]) >= $nojoins} {
putquick "MODE [string tolower $chan] +$::modes"
utimer $insec [list reset [string tolower $chan]]
}
}

# reset
proc reset {chan} {
global val
incr val([string tolower $chan]) -1
return
}

# unlock
proc unlock {chan} {
putquick "MODE [string tolower $chan] -$::modes"
return
}

# array remove
proc njf:part { nick uhost hand chan msg } {
global val
if {$nick != $::botnick} {
return
}
foreach arr_part [array names val] {
if {[string match [string tolower [string tolower $chan]] $arr_part]} {
array unset val [string tolower $chan]
}
}
}

putlog "njf.tcl loaded.."
but the problem is the bot dont do unlock the channel after lock it... do u know where s the problem
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

It should unlock it after 30 seconds.. do you get any errors? Here is my web page now.
Once the game is over, the king and the pawn go back in the same box.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

yeaa... the bot doesnt do unlock channel after 30 secs. hmm let me try dl from your web. thx
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

its the same./.. it doesnt do unlock the channel... i dont know why
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

I should rebuild this tcl script cos is a bit sloppy. Duno at what the heck I was thinking when I have made it in the first place. If it dosen't unlock the channel then my guess is that you have another tcl script that may have this "unlock" proc and this causing the script not to unlock the channel. I'll make myself some time and recode it and I'll let you know when it's finished.
Once the game is over, the king and the pawn go back in the same box.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

oww ok thanks caesar! i will wait
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Code: Select all

### Settings:
# What channel modes do you want to be used for locking the channel?
set njf(modes) "m"

# Number of joins in seconds keep channel locked for?
# By default I've set it to 8 joins in 3 seconds to lock the channel for 60 seconds.
set njf(jtu) 8:3:60

#
###
#### Done with configurations, do not edit past here unless you know TCL!
###
#

##
# stuff
setudef flag njf

##
# binds
bind join - * njf:join
bind part - * njf:part

##
# join
proc njf:join {nick uhost handle chan} {
  global njvno
  set chan [string tolower $chan]
  if {[isbotnick $nick] || ![botisop $chan] || ![channel get $chan njf]} {
    return
  }
  if {![info exists njvno($chan)]} {
    set njvno($chan) 0
  }
  if {[string equal [join [lsort [split $::njf(modes) ""]] ""] [join [lsort [split [string trim [getchanmode $chan] "+"] ""]] ""]]} {
    return
  }
  set bla [split $::njf(jtu) ":"]
  set nojoins [lindex $bla 0]
  set insec [lindex $bla 1]
  set unlockin [lindex $bla 2]
  incr njvno($chan)
  utimer $insec [list njf:reset $chan]
  if {$njvno($chan) >= $nojoins} {
    putquick "MODE $chan +$::njf(modes)" -next
    utimer $unlockin [list njf:unlock $chan]
  }
}

##
# reset
proc njf:reset {chan} {
  global njvno
  incr njvno($chan) -1
  return
}

##
# unlock
proc njf:unlock {chan} {
  putquick "MODE $chan -$::njf(modes)" -next
  return
}

##
# array remove
proc njf:part {nick uhost hand chan msg} {
  global njvno
  if {![isbotnick $nick]} {
    return
  }
  foreach arr_part [array names njvno] {
    if {[string match $chan $arr_part]} {
      array unset njvno $chan
    }
  }
}
Here.. Give it a try an let me know if you encount any problems with it. :) :P

PS: Many thanks to teemu (#eggdrop @ Undernet) for helping me out with the channel modes thing. Ow you one! :mrgreen:
Once the game is over, the king and the pawn go back in the same box.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

Yes it works well BUT it lock and unlock like many times
* klik sets mode: +mR
* klik sets mode: +mR
* klik sets mode: +mR
* klik sets mode: +mR
* klik sets mode: -mR
* klik sets mode: -mR
* klik sets mode: -mR
* klik sets mode: -mR
hehehehe... i have tried to edit the code with the previous code posted but it still happen, do u have suggestion?
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

:o This modes thing happend before using another test of the channel modes thing. I have done some tests and the channel modes thing isn't returning when the channel is locked. :x
Once the game is over, the king and the pawn go back in the same box.
User avatar
hikaro
Halfop
Posts: 68
Joined: Wed Mar 10, 2004 4:29 am

Post by hikaro »

DALnet... i use it on dalnet... =p
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Allright, here is the "solution" .. replace:

Code: Select all

  if {[string equal [join [lsort [split $::njf(modes) ""]] ""] [join [lsort [split [string trim [getchanmode $chan] "+"] ""]] ""]]} { 
    return 
  }
with this code:

Code: Select all

  set tmp [split [string trim [lindex [split [getchanmode $chan]] 0] "+"] ""]
  if {[regexp -all [join [split $::njf(modes) ""] "|"] $tmp] == [string length $::njf(modes)]} {
    return
  }
and give it a try.

PS: Many thanks to teemu for helping me out with the regexp :)
Once the game is over, the king and the pawn go back in the same box.
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

Post by helpme »

How can i load this Script in the Partyline??
h
helpme
Voice
Posts: 17
Joined: Sun May 08, 2005 11:07 am

Post by helpme »

How can i load this Script in the Partyline??
Locked