egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

problem with speaker bot tcl

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases
View previous topic :: View next topic  
Author Message
4mirc
Voice


Joined: 16 May 2008
Posts: 37

PostPosted: Mon May 24, 2010 10:05 pm    Post subject: problem with speaker bot tcl Reply with quote

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 Sad

can anyone fix it for me Sad


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
View user's profile Send private message Visit poster's website
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Tue May 25, 2010 11:00 am    Post subject: Reply with quote

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
View user's profile Send private message
4mirc
Voice


Joined: 16 May 2008
Posts: 37

PostPosted: Wed May 26, 2010 6:42 am    Post subject: Reply with quote

hello nml375

thanks for the reply

i fixed the script and its work 100%

thanks alot
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Support & Releases All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber