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.

auto limit & kick report & kicked count

Old posts that have not been replied to for several years.
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

auto limit & kick report & kicked count

Post by cambodia »

1 -i have try few limit chan script already do anybody can recommend dynamic auto limite ? most the script i use it limit channel by minute i wanna litmit it by join/part user ,

example after user join/part it will count user in channel and +l to limit number that we set any suggestion tcl ?

2 - i have try lot tcl already i can't find one tcl that msg to specify #channe or log file when it got kick from channel

example : when my bot got kicked from my #testing it will display " i got kick from #testing by nick ip with reason blah blah ... "

any recommend tcl ?

3 - wanna know any small script that display " nick is 34th person who got kicked out from channel by nick " when user get kick out from channel

all answer is apprecate and please moderator forgive if tcl is exist and i can't find it out

peter
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Channel Limiter (logical):

Code: Select all

##
# Commands
##
#
# chanset <#channel> <+/->limit
#   This enables (+) or disables (-) the channel limiter for the particular channel.
#   Pre-set to number of users in channel + 5.
#     Command console:  Dcc

setudef flag limit

bind time - "* * * * *" time:ChanLimit

# time:ChanLimit start

proc time:ChanLimit {min hour day month year} {
    foreach chan [channels] {
        if {![channel get $chan limit]} {
		continue
	}
	set newlimit [expr [llength [chanlist $chan]] + 5]
	set currentlimit [currentlimit $chan]
	if {$currentlimit < [expr $newlimit - 1] || $currentlimit > [expr $newlimit + 1]} {
	    sendcmd "mode $chan +l $newlimit"
	}
    }
}

# time:ChanLimit end

# currentlimit start

proc currentlimit {chan} {
    set currentmodes [getchanmode $chan]
    if {[string match "*l*" [lindex $currentmodes 0]]} {
	return [lindex $currentmodes end]
    }
    return 0
}

# end currentlimit
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

thank for code is it limite when join/part or specific time ?
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

Will automatically change limit on join/parts. :)
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

Thanks for code but can let me know do i need to save as tcl or i can put it inside my conf file ?

and how about other two tcl ? :D
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

cambodia wrote:Thanks for code but can let me know do i need to save as tcl or i can put it inside my conf file ?

and how about other two tcl ? :D
Yes, you can put it inside your conf file.

Code: Select all

bind kick - * relay:kick

proc relay:kick {nick uhost hand chan targ rsn} {
 if {[string equal -nocase $::botnick $targ]} {
  putlog "Kicked from $chan by $nick!$uhost with reason "$rsn""
 }
}
This will display the information in the bot's partyline when kicked from any channel.

Code: Select all

bind kick - * thirty:fourth
bind time - "00 00*" reset:kicked

proc thirty:fourth {nick uhost hand chan targ rsn} {
global kicked
set knick "[string tolower $nick]"
set chan "[string tolower $chan]"
 if {![info exists kicked($knick:$chan)]} { set kicked($knick:$chan) 0 }
 incr kicked($knick:$chan)
 if {$kicked($knick:$chan) == 34} {
  putserv "PRIVMSG $chan :$targ is the 34th nick to be kicked by $nick"
 }
} 

proc reset:kicked {args} {
global kicked
 foreach kick [array names kicked] {
  array unset kicked $kick
 }
}
This should say in channel the 34th user kicked by each nick and reset the number every day.
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

ha ha ha you confuse with my purpose , i mean one kick they will save kick and count 1 then when another user got kick it will count 2 , and next it will increase ... and don't reset the kick and count will we use command !resetkick then it will reset

and the kick can it save to log file or message to channel instead of partyline ?

and i guess the autolimit not work maybe i will try again tomorrow when my channel crow .
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

cambodia wrote:ha ha ha you confuse with my purpose , i mean one kick they will save kick and count 1 then when another user got kick it will count 2 , and next it will increase ... and don't reset the kick and count will we use command !resetkick then it will reset

and the kick can it save to log file or message to channel instead of partyline ?

and i guess the autolimit not work maybe i will try again tomorrow when my channel crow .
1. You still aren't clear about what you want your bot to do
2. The message will be saved in your eggdrop.log, however you can change putlog to whetever you want.
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

cambodia wrote:and i guess the autolimit not work maybe i will try again tomorrow when my channel crow .
Did you set .chanset #channel +limit via DCC with your bot?

If you did you would have seen the bot set +l *if* channel mlock is not set -l. It's a logical limiter which means it's designed not to fill a channel with those annoying timed limits being set. On a netsplit, when the bot returns it will normally set an initial limit of 5 and a few seconds later adjust it to the correct level i.e. number of users in channel +5.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

error found

Post by cambodia »

.chanset #khmer +limit
Successfully set modes { +limit } on #khmer.
[01:02] #PeteR# chanset #khmer +limit
[01:03] Tcl error [time:ChanLimit]: invalid command name "sendcmd"
[01:03] #khmer: mode change '+v theavy' by ChanServ!services@uirc.net
[01:04] Tcl error [time:ChanLimit]: invalid command name "sendcmd"

look like it don't know "sendcmd "

then i try to change to putserv instead of sendcmd and it +l 5 correct
but after one user join or i left/join it won'tdo any action seem stuck up
-------------------------------------------------------------------------------
[01:08] #khmer: mode change '+l 13' by khmer!peter@uirc-6C4DF0F9.us
[01:08] #khmer: mode change '+v Guest27196' by Cobra!Cobra@bot.uirc.net
[01:08] #khmer: mode change '-v Guest27196' by Cobra!Cobra@bot.uirc.net
[01:09] #khmer: mode change '+qo Guest27196 Guest27196' by ChanServ!services@uirc.net
[01:10] @#khmer (+trnl 13) : [m/9 o/3 h/0 v/1 n/5 b/0 e/- I/-]
-------------------------------------------------------------------------------
what 's the problem ? :)
User avatar
Alchera
Revered One
Posts: 3344
Joined: Mon Aug 11, 2003 12:42 pm
Location: Ballarat Victoria, Australia
Contact:

Post by Alchera »

woops LOL

Add this proc under the end of the limiter procs. Sorry I forgot as I use these two in a combined channel control script and just extracted the limiter bit and forgot about the sendcmd proc. :oops:

Code: Select all

# sendcmd - sends a command to the server

proc sendcmd {text} {
        putquick "$text"
}
# end sendcmd
**Edited**
* Estelle has quit (Ping timeout)
* Enfield sets channel limit to 44
* Zendal has quit (Ping timeout)
* Hours has quit (Ping timeout)
* Enfield sets channel limit to 43
As you can see, it works!

Remember the keyword logical! There's an allowance so that the limit is not set on every single join/part. Sometimes 2 - 3 users have to join/part for the limit to be adjusted; sometimes just one.
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

:roll: thank for your code , anyway do the other two code is work as
1 - when bot got kicked out from channel it will save it to one special log ( different from other log ) that contain only bot got kicked ( and if possible same time /msg to #channel and write " i got kicked from #channel by nick ident@ip with reason ...... " ) can you give me this code

2 - the kick counter is increasing one by one when someone got kicked out from channel ( not just by bot even by chanserv ) and .msg to channel every time the counter increase
ex : nick is 1st user got kicked out by me
nick is 2nd user got kicked out by chanserv
nick is 3rd user got kicked out by otherbot
nick is 4th user got kicked out by me
...................

can it be done ?

sorry for bother you guy and thank lot fo your helpful tcl and script
i'm learning how to write it now when i know it i won't bother you much
and i will be help newbies in this forum too bc i'm interesting in this
i never try tcl before i know only asp only :)
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

set bkickfile "bkick.log"
set bkickrelay "#channel"

bind kick - * relay:kick 

proc relay:kick {nick uhost hand chan targ rsn} {
 if {[string equal -nocase $::botnick $targ]} { 
  logbkick "Kicked from $chan by $nick!$uhost with reason: $rsn"
  puthelp "PRIVMSG $::bkickrelay :Kicked from $chan by $nick!$uhost with reason: $rsn"
 } 
}

proc logbkick {text} {
puts [set fs [open $::bkickfile a]] "$text"
close $fs
}
This will log into bkick.log whenever someone kicks your bot and will msg it to the channel you set in bkrelay.

Code: Select all

bind kick - * thirty:fourth 
bind pub o !resetc reset:count

proc thirty:fourth {nick uhost hand chan targ rsn} { 
global kicked 
set chan "[string tolower $chan]" 
 if {![info exists kicked($chan)]} { set kicked($chan) 0 } 
 incr kicked($chan) 
   putserv "PRIVMSG $chan :$targ is user $kicked($chan) kicked by $nick" 
} 

proc reset:cout {nick uhost hand chan arg} { 
global kicked 
 foreach kick [array names kicked] { 
  array unset kicked $kick 
 } 
}
This will say for example "nick is user 24 kicked by nick2" and !resetc public command will reset the number.
User avatar
cambodia
Halfop
Posts: 73
Joined: Sun Aug 22, 2004 1:03 am
Location: cambodia

Post by cambodia »

kiss sir_fz :oops:
kiss alchera :oops:

i will try it but wanna tell sir_fz the script kick:count ( you miss n hahah )
anyway i will load it and auto limit is work good

( PS : i saw one guy have bot always +l immediately when ppl join/part )
------------------------------------------------------------------
[18:43:34] * Dron3 sets mode: +l 40
[18:55:26] * Joins: ^moon^ (~Moon@202.176.246.161)
[18:56:26] * Parts: ^moon^ (~Moon@202.176.246.161)
[18:57:33] * Dron3 sets mode: +l 41
[18:58:33] * Dron3 sets mode: +l 40
------------------------------------------------------------------
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

Code: Select all

setudef flag limit 

bind join - * jp:ChanLimit 
bind part - * jp:ChanLimit

proc jp:ChanLimit {nick uhost hand chan {arg ""}} { 
if {![channel get $chan limit]} { return 0 } 
 set newlimit [expr [llength [chanlist $chan]] + 5] 
 putserv "mode $chan +l $newlimit"  
}
This will set limit on join/part. But, in my opinion, Alchera's way is better than this one.
Locked