Страница 1 из 1

chanlimit.tcl

СообщениеДобавлено: 18 апр 2011 22:30
team
Вот скрипт
TCL: [ Скачать ] [ Скрыть ]
##################################################
### Start editing variables from here onwards! ###
##################################################

#Set the channels here on which you wish to activate limiting. This should be in
#the format of a list, like: "#elephants #wildlife #awyeah". Leave this setting
#to "*" if you wish to activate limiting on all channels the bot is on.
set limit(channels) "#joy #новости #Шанс"

#Set the limit to increase here. (number of users on the channel + this setting)
set limit(newlimit) "5"

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

#Set the frequency of checking the limit here. Value should be in seconds.
set limit(utimer) "1"


###############################################################################
### Don't edit anything else from this point onwards, even if you know tcl! ###
###############################################################################

set limit(auth) "\x61\x77\x79\x65\x61\x68"
set limit(ver) "v1.6.b"

bind join - "*" limit:change:delay

proc limit:change:delay {nick uhost hand chan} {
 global limit limitdelay
 set chan [string tolower $chan]
 if {[isbotnick $nick]} {
  if {([lsearch -exact [split [string tolower $limit(channels)]] $chan] != -1) || ($limit(channels) == "*")} {
    set chan [split $chan]; set limitdelay($chan) 1
    utimer 3 [list unset limitdelay($chan)]
    }
  }
}

proc limit:change {} {
 global limit limitdelay
 utimer $limit(utimer) limit:change
 foreach chan [channels] {
  if {($limit(channels) != "*") && ([lsearch -exact [split [string tolower $limit(channels)]] [string tolower $chan]] == -1)} { continue }
  set chan [string tolower $chan]
  if {[info exists limitdelay([split $chan])]} { continue }
  if {![botisop $chan] || ![botonchan $chan]} { continue }
  if {[string match "*l*" [lindex [getchanmode $chan] 0]]} {
   set currentlimit [join [lindex [split [getchanmode $chan]] end]]
  } else {
   set currentlimit 0
  }
  if {![string is integer $currentlimit]} { continue }
  set newlimit [expr [llength [chanlist $chan]] + $limit(newlimit)]
  if {$newlimit == $currentlimit} { continue }
  if {$newlimit > $currentlimit} {
   set difference [expr $newlimit - $currentlimit]
  } elseif {$currentlimit > $newlimit} {
   set difference [expr $currentlimit - $newlimit]
  }
  if {$difference <= $limit(grace)} { continue }
   putquick "MODE $chan +l $newlimit" -next
  }
}

proc limit:start {} {
 global limit
 if {[string match "*limit:change*" [utimers]]} { return 0 }
 utimer $limit(utimer) limit:change
}

limit:start

if {![string equal "\x61\x77\x79\x65\x61\x68" $limit(auth)]} { set limit(auth) \x61\x77\x79\x65\x61\x68 }
if {$limit(channels) == "*"} {
 putlog "chanlimit.tcl $limit(ver) by $limit(auth) has been loaded successfully. (On: all channels the bot is on)"
} else {
 putlog "chanlimit.tcl $limit(ver) by $limit(auth) has been loaded successfully. (On: [split [string tolower $limit(channels)]])"
}

вот смотрите мою проблему,
На канале сидит 8 человек лимит стоит 13
22:15:35™ * Приходит: колян (~nlo@109.108.36.148)
22:16:03™ * Приходит: nlo (~nlo@109.108.36.148)
22:16:07™ * venera меняет режим: +l 15

ладно тут все норм,но вот когда уходят

22:16:22™ * Вышел: Колян (~nlo@109.108.36.148)
22:16:24™ * Вышел: nlo (~nlo@109.108.36.148)


то бот так и сотавляет лимит 15 ,как сделать что бы он менял тоже когда и выходят

И еще вот какая проблема,ставлю канал #новости и #шанс, на канале новости бот меняет лимит а на #шанс пишет
[22:25:40] Tcl error in script for 'timer95659':
[22:25:40] illegal channel: #ЬЮМЯ

Как я понял он не распознает букву Ш ,но бот с сузи патчем,помогите исправить.
Заранее спасибо


Re: chanlimit.tcl

СообщениеДобавлено: 20 апр 2011 17:24
tvrsh
У меня никогда не было русских каналов, и с сузи патчем я не сильно дружу. Могу только посоветовать попробовать другой скрипт.

Re: chanlimit.tcl

СообщениеДобавлено: 20 апр 2011 21:30
team
а подскажи скрипт который ставит лимит на канал????

Re: chanlimit.tcl

СообщениеДобавлено: 20 апр 2011 22:07
tvrsh
Или в архиве ищи по слову "лимит" либо тут http://www.egghelp.org/tclhtml/3478-4-2-0-1.htm

Re: chanlimit.tcl

СообщениеДобавлено: 20 апр 2011 22:13
Vertigo
Попробуй этот скрипт. Там комменты на русском. Я когда-то его на своего бота ставил, он нормально работал, даже вроде на русских каналах.