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.

request for a little chanlimit script

Old posts that have not been replied to for several years.
Locked
x
xuser

request for a little chanlimit script

Post by xuser »

i need a litle script for chanlimit who work on every channels but i need a simple one

something like this

so i can use .chanset #chan +nolimit if i want a channel without no limit

set pluslimit "number"

set timer "number(in seconds)"

then the procedure

......

that it :P

thank you
d
dollar
Op
Posts: 178
Joined: Tue Oct 28, 2003 3:47 pm
Location: Netherlands

Post by dollar »

Take a look at the Tcl archive on this site, thanks.
dollar (or something similar) at:
#eggdrop / #tcl - undernet
#egghelp / #tcl / #eggtcl - efnet
#eggdrop.support / #tcl - quakenet
#eggdrop - ircnet
x
xuser

Post by xuser »

i look into the tcl archive but i want something simple with onli these 2 set commands

thanks
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

there is a verry simple channe limiting script in there look again i am sur its in there no commands , .. the bot will set the limit to the number of users +<something>
XplaiN but think of me as stupid
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

bind pub n|m "autolimit" autolimit:pub 
bind join -|- * autolimit:join 

setudef str "autolimit" 

proc autolimit:start {} { 
foreach channel [channels] { 
if {[channel get $channel "autolimit"] == ""} { 
channel set $channel "autolimit" "0" 
} 
} 
utimer 60 autolimit 
} 

proc autolimit:join {nickname hostname handle channel} { 
if {![isbotnick $nickname]} { 
return 0 
} 
if {[channel get $channel "autolimit"] == ""} { 
channel set $channel "autolimit" "0" 
} 
} 

proc autolimit:pub {nickname hostname handle channel arguments} { 
global lastbind 
set argumentc [llength [split $arguments { }]] 
set option [lindex $arguments 0] 
set users [llength [chanlist $channel]] 
if {$argumentc < 1} { 
set currentlimit [channel get $channel "autolimit"] 
if {$currentlimit > 0} { 
putserv "NOTICE $nickname :Current auto-limit is: [channel get $channel "autolimit"]" 
} else { 
putserv "NOTICE $nickname :Argument should start with a '#' and a digit. (eg. #10 or on|off)" 
} 
return 
} 
if {([regexp -nocase -- {(#[0-9]+|off|on)} $option tmp result]) && (![regexp -nocase -- {\S#} $option])} { 
switch $result { 
on { 
channel set $channel "autolimit" "10" 
putserv "MODE $channel +l [expr $users + 10]" 
puthelp "NOTICE $nickname :Auto-limit is changed to: +10" 
} 
off { 
channel set $channel "autolimit" "0" 
putserv "MODE $channel -l *" 
puthelp "NOTICE $nickname :Done. Auto-limit disabled successfully." 
} 
default { 
if {([regexp {#[0-9]} $result]) && ([string index $result 0] == "#")} { 
regexp {#([0-9]+)} $result tmp result 
if {($result < 2)} { 
set result 2 
} elseif {($result > 500)} { 
set result 500 
} 
channel set $channel "autolimit" "$result" 
putserv "MODE $channel +l [expr $users + $result]" 
puthelp "NOTICE $nickname :Auto-limit is changed to: $result" 
} 
} 
} 
} else { 
puthelp "NOTICE $nickname :Argument should start with a '#' and a digit. (eg. #10 or on|off)" 
} 
} 

proc autolimit {} { 
if {![string match *autolimit* [utimers]]} { 
utimer 60 autolimit 
} 
foreach channel [channels] { 
set autolimit [channel get $channel "autolimit"] 
if {(![botisop $channel]) || ($autolimit == "0")} { 
continue 
} 
set users [llength [chanlist $channel]] 
set newlimit [expr $users + $autolimit] 
set chanmodes [getchanmode $channel] 
if {[string match *l* [lindex $chanmodes 0]]} { 
regexp {\S[\s]([0-9]+)} $chanmodes tmp currentlimit 
} else { 
set currentlimit 0 
} 
if {$newlimit == $currentlimit} {continue} 
if {$newlimit > $currentlimit} { 
set difference [expr $newlimit - $currentlimit] 
} elseif {$newlimit < $currentlimit} { 
set difference [expr $currentlimit - $newlimit] 
} 
if {($difference <= [expr round($autolimit * 0.5)]) && ($autolimit > 5)} { 
continue 
} elseif {($difference < [expr round($autolimit * 0.38)]) && ($autolimit <= 5)} { 
continue 
} 
putserv "mode $channel +l $newlimit" 
} 
} 

autolimit:start 
Set the limit with autolimit #*how many* on and turn it off with autolimit off
g
greenbear
Owner
Posts: 733
Joined: Mon Sep 24, 2001 8:00 pm
Location: Norway

Post by greenbear »

wow, thats the biggest chanliimit script i've ever seen :mrgreen:
x
xuser

Post by xuser »

yep itis big :lol: , i will try it , thanks for it :D
Locked