| View previous topic :: View next topic |
| Author |
Message |
4mirc Voice

Joined: 16 May 2008 Posts: 37
|
Posted: Mon May 24, 2010 10:05 pm Post subject: problem with speaker bot tcl |
|
|
hello
i used to use this tcl for 5 years and its work good
but suddenly i dont know what happen to not work again
can anyone fix it for me
| Code: |
set adtext {
"textherer"
"textherer"
"textherer"
"textherer"
"textherer"
"textherer"
"textherer"
}
set ad-at- 15
#######DO NOT EDIT BELOW THESE LINES#######
set notnick "$botnick"
set notnick [string tolower ${nick}]
if {![info exists {ald}]} {
global notnick chan ad-at- adtext
set ald 1
timer ${ad-at-} printing
}
proc printing {} {
global notnick channels ad-at- adtext
set printochan [lindex $adtext [rand [llength $adtext]]]
amsg "$printochan"
timer ${ad-at-} printing
}
putlog "\002\<admin\> Specker Bot is Load \<admin\>\002"
proc amsg { arg } {
foreach chan [channels] {
putserv "privmsg $chan:$arg"
}
} |
Regards |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Tue May 25, 2010 11:00 am Post subject: |
|
|
There are two main issues with that code:
First, in the amsg proc, there's no space inbetween the channel and the message (with the colon-prefix). $chan:$arg should be $chan :$arg
Secondly, the "list" of messages is not a proper list, and your script may break if there's any { or } characters within. The proper way of doing this is to use the list command to build/set the list.
Further, the code has some spurious global commands at aglobal context. This is not an error, but a pointless line of code that only makes the code harder to read. _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
4mirc Voice

Joined: 16 May 2008 Posts: 37
|
Posted: Wed May 26, 2010 6:42 am Post subject: |
|
|
hello nml375
thanks for the reply
i fixed the script and its work 100%
thanks alot |
|
| Back to top |
|
 |
|