lol, you were just declaring to variables after it has been processed and put to channel.
Code: Select all
putserv "PRIVMSG $channel :$randomnick $lovesme2 $nick" randomnick lovesme2
So, your code was fine
I only added a small substitution so that you could use $nick $chan arguments within your set list, and a check to make sure randomnick wasn't botnick (and if it was, just send a silly message to chan).
Code: Select all
bind pub - .lovesme pub_lovesme
set lovesme1 {
"is in deep love with you, $nick"
"loves loves loves you, $nick"
"only loves loves $chan ..."
}
proc pub_lovesme {nick uhost hand chan arg} {
global lovesme1
set lovesme2 [lindex $lovesme1 [rand [llength $lovesme1]]]
set lovesme2 [subst -nocommands $lovesme2]
set mychanlist [chanlist $chan]
set randomnick [lindex $mychanlist [rand [llength $mychanlist]]]
if {[isbotnick $randomnick]} {puthelp "PRIVMSG $chan :Sorry, $nick, but bot love leads to botulism.."; return}
puthelp "PRIVMSG $chan :$randomnick $lovesme2"
return 0
}
Alternatively, to remove the botnick completely, and avoid the above isbotnick check, use:
Code: Select all
set mychanlist [chanlist $chan]
set rembot [lsearch $mychanlist $::botnick]
set mychanlist [lreplace $mychanlist $rembot $rembot]
set randomnick [lindex $mychanlist [rand [llength $mychanlist]]]
We explore.. and you call us criminals. We seek after knowledge.. and you call us criminals. We exist without skin color, without nationality, without religious bias.. and you call us criminals.