egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

chan limit when joining several channels

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Thu Jun 11, 2015 3:08 pm    Post subject: chan limit when joining several channels Reply with quote

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:
##############################
## ------------------------ ##
## 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 ", "])"
}
Back to top
View user's profile Send private message
simo
Owner


Joined: 22 Mar 2015
Posts: 941

PostPosted: Sat Jun 13, 2015 10:44 am    Post subject: Reply with quote

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



Quote:
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
Back to top
View user's profile Send private message
Arnold_X-P
Master


Joined: 30 Oct 2006
Posts: 221
Location: DALnet - Trinidad - Beni - Bolivia

PostPosted: Tue Jul 07, 2015 10:07 pm    Post subject: Reply with quote

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:

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 ", "])"
}

_________________
Very Happy thanks to that they help, that others learn Very Happy
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
primus
Voice


Joined: 31 Jul 2015
Posts: 12
Location: West Coast

PostPosted: Fri Jul 31, 2015 11:03 pm    Post subject: Reply with quote

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..
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Aug 01, 2015 11:10 am    Post subject: Reply with quote

Quote:
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:)
_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.


Last edited by SpiKe^^ on Sat Aug 01, 2015 2:36 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
primus
Voice


Joined: 31 Jul 2015
Posts: 12
Location: West Coast

PostPosted: Sat Aug 01, 2015 1:48 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Sat Aug 01, 2015 2:18 pm    Post subject: Reply with quote

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
.
Back to top
View user's profile Send private message Visit poster's website
primus
Voice


Joined: 31 Jul 2015
Posts: 12
Location: West Coast

PostPosted: Sat Aug 01, 2015 6:44 pm    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
primus
Voice


Joined: 31 Jul 2015
Posts: 12
Location: West Coast

PostPosted: Sat Aug 01, 2015 6:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
primus
Voice


Joined: 31 Jul 2015
Posts: 12
Location: West Coast

PostPosted: Sat Aug 01, 2015 9:18 pm    Post subject: Reply with quote

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:

# 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$$!!!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber