chanlimit.tcl

Решение вопросов при работе с TCL скриптами.

Модератор: Модераторы

chanlimit.tcl

Сообщение team » 18 апр 2011 22:30

Вот скрипт
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: #ЬЮМЯ

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

team
 
Сообщения: 43
Зарегистрирован: 19 фев 2011 23:49
Благодарил (а): 3 раз.
Поблагодарили: 0 раз.
Версия бота: Eggdrop 1.6.21

Re: chanlimit.tcl

Сообщение tvrsh » 20 апр 2011 17:24

У меня никогда не было русских каналов, и с сузи патчем я не сильно дружу. Могу только посоветовать попробовать другой скрипт.
Have fun.
-
Получить помощь можно на каналах #egghelp в сети IrcNet.ru и #eggdrop в сети RusNet(Ключ канала eggdrop).
Перед созданием новой темы внимательно читайте Правила оформления топиков.
Аватара пользователя
tvrsh
 
Сообщения: 1230
Зарегистрирован: 19 авг 2008 16:55
Откуда: Russian Federation, Podolsk
Благодарил (а): 6 раз.
Поблагодарили: 130 раз.
Версия бота: Eggdrop 1.6.20+suzi

Re: chanlimit.tcl

Сообщение team » 20 апр 2011 21:30

а подскажи скрипт который ставит лимит на канал????
team
 
Сообщения: 43
Зарегистрирован: 19 фев 2011 23:49
Благодарил (а): 3 раз.
Поблагодарили: 0 раз.
Версия бота: Eggdrop 1.6.21

Re: chanlimit.tcl

Сообщение tvrsh » 20 апр 2011 22:07

Или в архиве ищи по слову "лимит" либо тут http://www.egghelp.org/tclhtml/3478-4-2-0-1.htm
Have fun.
-
Получить помощь можно на каналах #egghelp в сети IrcNet.ru и #eggdrop в сети RusNet(Ключ канала eggdrop).
Перед созданием новой темы внимательно читайте Правила оформления топиков.
Аватара пользователя
tvrsh
 
Сообщения: 1230
Зарегистрирован: 19 авг 2008 16:55
Откуда: Russian Federation, Podolsk
Благодарил (а): 6 раз.
Поблагодарили: 130 раз.
Версия бота: Eggdrop 1.6.20+suzi

Re: chanlimit.tcl

Сообщение Vertigo » 20 апр 2011 22:13

Попробуй этот скрипт. Там комменты на русском. Я когда-то его на своего бота ставил, он нормально работал, даже вроде на русских каналах.
Аватара пользователя
Vertigo
 
Сообщения: 107
Зарегистрирован: 20 авг 2008 23:49
Откуда: Москва
Благодарил (а): 0 раз.
Поблагодарили: 37 раз.
Версия бота: Eggdrop 1.8


Вернуться в TCL скрипты

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 10

cron