Eggdrop TCL人工智能限时

Eggdrop TCL Artificial Intelligence in a limited time

我要Eggdrop回复最近30分钟加入频道的用户。应忽略在频道上超过 30 分钟的所有其他用户。

set canalativo "#testes"

bind pubm - "*regist*canal*" pub:regchan

proc pub:regchan { nick uhost handle chan arg } {
global canalativo

if {[string match -nocase "$canalativo" $chan]} {

putserv "PRIVMSG $chan :$nick para registar um canal escreve o comando: /ChanServ register #CANAL DESCRICAO-DO-CANAL" } 
 }

您可以保存一个包含用户及其加入时间的数组。像(未经测试):

set canalativo "#testes"
array set joinedUsers {}

bind pubm - "*regist*canal*" pub:regchan
bind join - "*!*@*" pub:joinchan

proc pub:regchan { nick uhost handle chan arg } {
    global canalativo joinedUsers

    # Check if - this is the correct channel
    #          - the user is in the array of joined users
    #          - the time the user joined is 1800 seconds ago or less
    if {
        [string match -nocase "$canalativo" $chan] && 
        [info exists joinedUsers($nick)] && 
        [clock seconds]-$joinedUsers($nick) <= 1800
    } {
        putserv "PRIVMSG $chan :$nick para registar um canal escreve o comando: /ChanServ register #CANAL DESCRICAO-DO-CANAL"
    }

    # Remove the user from the array if it is there
    catch {unset joinedUsers($nick)}
}

proc pub:joinchan { nick uhost handle chan } {
    global joinedUsers

    # Add the user and the time they joined to the array
    set joinedUsers($nick) [clock seconds]
}

这只是最基本的。您可能想要添加检查诸如昵称更改(例如,可能告诉他们将他们的昵称分组在一个帐户下)或重新加入(由于 disconnects/netsplits)之类的事情。此外,如果他们已经注册,您可能不希望机器人告诉他们。