I'm trying to send info from one bot to my other bot.
What i wanna do is:
Bot one is connected and is controlling the channel. He keeps also the times from the persons that are online.
Let's say bot two connects 1 day later, then i want that bot one sends the connected time of my members (that are currently online) to my bot two. So that bot two knows for how long the members are already in the room.
I have the following for bot one:
Code: Select all
bind join - * joinproc
proc joinproc {nick uhost hand chan} {
if {[isbotnick bot_one]} {return}
set ::joined($nick) [clock seconds]
if {[string equal -nocase [nick2hand $nick] "bot_two"]} {
putbot bot_two [list clear]
foreach nick [chanlist "#my_channel"] {
if {![info exists ::joined($nick)]} {
set ::joined($nick) [getchanjoin $nick $chan]
}
putbot bot_two [list join $nick [expr [clock seconds]-$::joined($nick)]]
}
} else {
putbot bot_two [list join $nick 0]
}
}
bind bot - "clear" procbot_clear
proc procbot_clear {from-bot command arg} {
catch {unset ::joined}
}
bind bot - "join" procbot_join
proc procbot_join {from-bot command arg} {
foreach {nick ago} $arg break
set ::joined($nick) [expr [clock seconds]-$ago]
puthelp "PRIVMSG #my_channel :$nick has joined (as of [duration $::joined($nick)] ago)"
}
bot_wo has joined (as of 3 years 13 weeks 6 days 3 mins ago)
So I only see my bot_two 's info when connecting (and it's eather not the right time!). And why am i not recieving the online time (in sec's from the other users?)
Is there something wrong in the code?
Btw, i have added the same info to bot one, so if bot one isn't in channel, but bot two is, then bot one will get all the info from bot two when entering the channel.
Thnx in advance for your help.
Best regards,
Buffy