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.

chan limit when joining several channels

Support & discussion of released scripts, and announcements of new releases.
Post Reply
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

chan limit when joining several channels

Post by simo »

greetings , i use this channel limiter wich seems to work well only when using in multi channels and the bot is restarted it doesnt calculate users currently in channel and adding channel limit instead it sets +l 3 wich is channel limit
locking channel leaving no space for anyone to join

would it be possible to make it calculate for all channels where the script is active the correct chan limit so channel is not locked

Code: Select all

##############################
## ------------------------ ##
## 10. Channel Limit Script ##
## ------------------------ ##
##############################


#Channels in which to activate limiting, this should be a list like
#"#elephants #wildlife #etc". Leave it set to "" if you wish to activate
#limiting on all channels the bot is on.
set cl_chans ""

#Limit to set (number of users on the channel + this setting)
set cl_limit "3"

#Limit grace (if the limit doesn't need to be changed by more than this,
#don't bother setting a new limit)
set cl_grace "1"

# Frequency of checking whether a new limit needs to be set (in seconds)
set cl_utimer "8"


bind join - "*" limit:chng:on:bot:join

proc limit:chng:on:bot:join {nick uhost hand chan} {
 global cl_chans limit_delay
 if {[isbotnick $nick] && ([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] != -1)} {
  set limit_delay([string tolower $chan]) 1
  utimer 3 [list unset limit_delay([string tolower $chan])]
  }
}

proc cl_dolimit {} {
  global cl_chans cl_limit cl_grace cl_utimer limit_delay
  utimer $cl_utimer cl_dolimit
  foreach chan [string tolower [channels]] {
    if {$cl_chans != ""} {
     if {([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] == -1)} { continue }
    }
    if {[info exists limit_delay($chan)]} { continue }
    if {![botisop $chan]} { continue }
    set numusers [llength [chanlist $chan]]
    set newlimit [expr $numusers + $cl_limit]
    if {[string match "*l*" [lindex [getchanmode $chan] 0]]} {
      set currlimit [string range [getchanmode $chan] [expr [string last " " [getchanmode $chan]] + 1] end]
    } else {
      set currlimit 0
    }
    if {$newlimit == $currlimit} { continue }
    if {$newlimit > $currlimit} {
      set difference [expr $newlimit - $currlimit]
    } elseif {$currlimit > $newlimit} {
      set difference [expr $currlimit - $newlimit]
    }
    if {$difference <= $cl_grace} { continue }
     putquick "MODE $chan +l $newlimit" -next
    }
}

proc cl_startlimit {} {
  global cl_utimer
  if {[string match "*cl_dolimit*" [utimers]]} { return 0 }
  utimer $cl_utimer cl_dolimit
}

cl_startlimit 

if {$cl_chans == ""} {
  putlog "Loaded chanlimit.tcl v1.5 by slennox (active on all channels)"
} else {
  putlog "Loaded chanlimit.tcl v1.5 by slennox (active on: [join $cl_chans ", "])"
}
s
simo
Revered One
Posts: 1071
Joined: Sun Mar 22, 2015 2:41 pm

Post by simo »

this is what happens and bear in mind at that time there are no joins parts quits :


22:05:34 22:05:34   Join :   EagleEye   eagle@168.235.76.154
22:05:34 ChanServ Sets Mode on #ChatHeaven to: +o EagleEye
22:05:49 @EagleEye Sets Mode on #ChatHeaven to: +l 6
22:06:30 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:39 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:48 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:06:53 @EagleEye Sets Mode on #ChatHeaven to: +l 78
22:07:04 @EagleEye Sets Mode on #ChatHeaven to: +l 78
User avatar
Arnold_X-P
Master
Posts: 226
Joined: Mon Oct 30, 2006 12:19 am
Location: DALnet - Trinidad - Beni - Bolivia
Contact:

Post by Arnold_X-P »

I found the flaw for which the tcl was slowing down the limit
earlier putquick "MODE $chan +l $newlimit"-next

the correct thing is putserv "MODE $chan +l $newlimit"-next

friend does not modify at all either the tcl is well formed
on line 2 users auto limit to +5 = auto limit to +l 7 perfect bros

Code: Select all

22:36] * sedition sets mode: -l
[22:36] <sedition> :P
[22:36] * JulieTh sets mode: +l 7

##############################
## ------------------------ ##
## 10. Channel Limit Script ##
## ------------------------ ##
##############################


#Channels in which to activate limiting, this should be a list like
#"#elephants #wildlife #etc". Leave it set to "" if you wish to activate
#limiting on all channels the bot is on.
set cl_chans "#tcls #eggdrop"

#Limit to set (number of users on the channel + this setting)
set cl_limit "5"

#Limit grace (if the limit doesn't need to be changed by more than this,
#don't bother setting a new limit)
set cl_grace "2"

# Frequency of checking whether a new limit needs to be set (in seconds)
set cl_utimer "8"


bind join - "*" limit:chng:on:bot:join

proc limit:chng:on:bot:join {nick uhost hand chan} {
 global cl_chans limit_delay
 if {[isbotnick $nick] && ([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] != -1)} {
  set limit_delay([string tolower $chan]) 1
  utimer 3 [list unset limit_delay([string tolower $chan])]
  }
}

proc cl_dolimit {} {
  global cl_chans cl_limit cl_grace cl_utimer limit_delay
  utimer $cl_utimer cl_dolimit
  foreach chan [string tolower [channels]] {
    if {$cl_chans != ""} {
     if {([lsearch -exact [split [string tolower $cl_chans]] [string tolower $chan]] == -1)} { continue }
    }
    if {[info exists limit_delay($chan)]} { continue }
    if {![botisop $chan]} { continue }
    set numusers [llength [chanlist $chan]]
    set newlimit [expr $numusers + $cl_limit]
    if {[string match "*l*" [lindex [getchanmode $chan] 0]]} {
      set currlimit [string range [getchanmode $chan] [expr [string last " " [getchanmode $chan]] + 1] end]
    } else {
      set currlimit 0
    }
    if {$newlimit == $currlimit} { continue }
    if {$newlimit > $currlimit} {
      set difference [expr $newlimit - $currlimit]
    } elseif {$currlimit > $newlimit} {
      set difference [expr $currlimit - $newlimit]
    }
    if {$difference <= $cl_grace} { continue }
     putserv "MODE $chan +l $newlimit" -next
    }
}

proc cl_startlimit {} {
  global cl_utimer
  if {[string match "*cl_dolimit*" [utimers]]} { return 0 }
  utimer $cl_utimer cl_dolimit
}
cl_startlimit
if {$cl_chans == ""} {
  putlog "Loaded chanlimit.tcl v1.5 by slennox (active on all channels)"
} else {
  putlog "Loaded chanlimit.tcl v1.5 by slennox (active on: [join $cl_chans ", "])"
}
.:an ideal world:. www.geocities.ws/chateo/yo.htm
my programming place /server ix.scay.net:7005
p
primus
Voice
Posts: 12
Joined: Fri Jul 31, 2015 10:43 pm
Location: West Coast

Post by primus »

Ive been having a similar issue, but I think it may be a combined issue...

I run bots on undernet, all are eggdrop1.6.21

I tried using just about all TCL scripts involving Channel Limiting, this includes single channel scripts and multi channel scripts. The same issue exist with all of them in the same manner.

Even have a similar issue with getops3.0c.tcl and older versions...

I am begining to think it could be an eggdrop issue?

Right now I use both of slennox's scripts, chanlimit1.5.tcl and the above mentioned getops.

The channel limit seams to correctly set for one or two channels, but it seams as if a couple others set lower than the amount of users in the channel. ex: 20 users, bot sets limit to +l 10

Sometimes if I rehash, it corrects itself, but later reverts to the above mentioned issue. .restart starts the issue instantly...

If a bot or shell restarts, then bot tries to rejoin, the getops script tries to raise the limit above the users, but some bots set it lower causing a flood of +l mode changes each with a different amount.

I have seen a few comments about a simple change to the limit script, but the same issue exist, and yet still have the issue with getops... getops is the least of my worries, but the limit issue is aggravating...

Im focussed at the scripts by slennox...

I used to use mc.limit.tcl, but it dissapeared sometime ago and would love to have it back if someone has a copy floating around so I can try it... Would be greatly appreciated..
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

I am begining to think it could be an eggdrop issue?
I have done quite a bit of testing on this deal and agree with you that it is an Eggdrop issue.

Edit: er maybe not:)
Last edited by SpiKe^^ on Sat Aug 01, 2015 2:36 pm, edited 1 time in total.
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
p
primus
Voice
Posts: 12
Joined: Fri Jul 31, 2015 10:43 pm
Location: West Coast

Post by primus »

I will be recompiling with 1.3.28 on one of my shells to see if it makes a difference later today.

I have noticed other issues too with other certain scripts, bots not properly setting channel specific flags for users through sharing. I could go on, but its all small stuff, not trying to make this look like a huge ordeal...
User avatar
SpiKe^^
Owner
Posts: 831
Joined: Fri May 12, 2006 10:20 pm
Location: Tennessee, USA
Contact:

Post by SpiKe^^ »

Please try the channel lock script at this link -> http://forum.egghelp.org/viewtopic.php?t=17090&start=2
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
p
primus
Voice
Posts: 12
Joined: Fri Jul 31, 2015 10:43 pm
Location: West Coast

Post by primus »

SpiKe^^ wrote:
I have done quite a bit of testing on this deal and agree with you that it is an Eggdrop issue.

Edit: er maybe not:)
Maybe not? Tried with 1.3.28 and scripts relevant to the version (which is most), not having the same issue until eggdrop 1.6... Even 1.5.4 yielded same as 1.3.28, all working...

Unfortunately, My shells will not 'make' older versions of eggdrop, so I tested on FreeBSD 9.3 on my own box and all went well...

So now to figure out what the issue is between the script and eggdrop1.6.21

unless I'm missing something...
p
primus
Voice
Posts: 12
Joined: Fri Jul 31, 2015 10:43 pm
Location: West Coast

Post by primus »

Oh yeah, simo,

1. the limit I recommend is at least 5 to 8 over the top amount of users.

2. Set grace to 2 (if limit is 5) or 4 (if limit is eight)

3. and set the amount of seconds to like 300, which equals 5 minutes. 8 seconds is rather quick and any floodbots can easily defeat 8 seconds...

just an fyi
p
primus
Voice
Posts: 12
Joined: Fri Jul 31, 2015 10:43 pm
Location: West Coast

Post by primus »

Ok, found the issue....

The entire problem I was having (face/palm) was in the bots config...

This fixed getops and chanlimit...

An easy way to check if your bot is reading the amount of users correctly is to dcc chat bot, in partyline .channel #yourchannel

If its not reading correctly, open your bots config, find "net-type" and make sure it set correct...

Code: Select all

# What is your network?
#   0 = EFnet
#   1 = IRCnet
#   2 = Undernet
#   3 = DALnet
#   4 = +e/+I/max-modes 20 Hybrid
#   5 = Others
set net-type 2
I feel like an a$$!!!
Post Reply