hi there!
I'm writing a talk script for my windrop but it can't work. Here is it
#set flags
setudef flag talk
set kflag 6
set say "sin"
#bind section
bind pub - * pub:talk
proc pub:talk {nick host hand chan text} {
global botnick nanypa kflag say
if {([lsearch -exact [channel info $chan] {+talk})&&([string match $say $text])] != -1} {
set strs [lindex $nanypa [rand [llength $nanypa]]]
while {($rndnick != $nick)&&($rndnick != $botnick)} {
set chanl [chanlist $chan]
set nc [llength $chanl]
set rdnick [rand $nc]
set rndnick [lindex $chanl [expr $rdnick+1]]
}
if {[string match "NiCk" $strs]} {
set sl [string length $strs]
set sle [expr $sl-3]
for {set a 1} {$a < $sle} {incr a} {
set b [expr $a+4]
if {[string range $strs $a $b] == "NiCk"} {
set strt [string range $strs 1 [expr $a-2]]
set end [string range $strs [expr $b+2] sl]
set strs [join [list $strt $rndnick $end] " "]
}
}
}
set out [join [list $nick $strs] " "]
utimer [rand 8] [putchan $chan $out]
}
return 1
}
i give you short explanation of what procedure does:
1. get random message from list 'nanypa'
2. get random nick from channel
3. if (random nick == botnick) && (nick =='nick of speaking person') gets new random nick
4. check if message contain word 'NiCk'
5. switch word 'NiCk' with random nick from '2'
6. say message on channel
ohhh sorry it's for TCL forum my mistake