This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Help with tcl script

Help for those learning Tcl or writing their own scripts.
[
[3-33]
Voice
Posts: 6
Joined: Sat Aug 08, 2009 6:18 am

Post by [3-33] »

arfer wrote:I downloaded bottalk.tcl from this site. After loading the script and restarting I was able to get my bot to respond to $nick, $nick; $nick: AND $nick alone.

[22:41] <@arfer> Osmosis
[22:41] <@osmosis> arfer: What? ×åãî íàäî ?
[22:41] <@arfer> osmosis
[22:41] <@osmosis> arfer: What? ×åãî íàäî ?
[22:42] <@arfer> osmosis, hello
[22:42] <@osmosis> arfer: Ïèâî åñòü ?
[22:42] <@arfer> Osmosis: hello
[22:42] <@osmosis> arfer: Ñêîê ãîäèêîâ òåáå ?
[22:42] <@arfer> Osmosis; what are you doing?
[22:42] <@osmosis> arfer: hello

I don't have a clue what the original poster did to break it.
Well, can you upload your bot so, i`ll use this new one and that?:D
The end is a new begining
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

It is from the Tcl archive here at www.egghelp.org/tcl.htm

No clue what you mean by my bot but that also is the latest version 1.6.19+ctcpfix
I must have had nothing to do
[
[3-33]
Voice
Posts: 6
Joined: Sat Aug 08, 2009 6:18 am

Post by [3-33] »

Well, if your eggdrop works, and my no, maybe its about what version of eggdrop i have, so would you upload or give me bot like that?
I think the problem can be in the eggdrop, also my bot is not uploaded to a shell, i start it from my machine,from a .bat file..so..
The end is a new begining
User avatar
arfer
Master
Posts: 436
Joined: Fri Nov 26, 2004 8:45 pm
Location: Manchester, UK

Post by arfer »

Sorry but I'm not prepared to upload my complete bot, not that it would necessarily do you any good anyway. I very much doubt if this issue has anything to do with your bot version. If you still believe this to be the case simply compile/install the current version.

I just thought of a possibility. Are you using an IRC client that throws in a spurious space character after typing in part of an onchan nick and using a predefined key (usually tab) for autocompletion? This used to occur with XChat, though I don't know if current versions still do that.

However, it is possible that the script author has included the following otherwise seemingly improper code segment to get rid of any such character :-

Code: Select all

proc pub_dotalkz {nick uhost hand chan rest} {

set str [lrange $rest 0 end]
The variable 'rest' is not a list and shouldn't normally be treated as one. Even if it was a list, [lrange $rest 0 end] would return all of it, which sort makes it strange that there would be a need to additionally define 'str'.

There are other parts of the script that I think look rather ugly. For example :-

Code: Select all

if {$nick == $botnick} {
    return 0
}

if {$str == ""} {
    putchan $chan "$nick: What? ×åãî íàäî ?"
    return 0
}
Would look rather better as :-

Code: Select all

if {[isbotnick $nick]} {
    return 0
}

if {[string length $str] == 0} {
    putchan $chan "$nick: What? ×åãî íàäî ?"
    return 0
}
Not that this would excuse the cross-over of string and list manipulation functions, which I have maintained by using 'string length' on the list variable 'str' as returned from the 'lrange' statement.

I'm not saying these corrections and several others in the script would resolve your problem but I am saying that I wouldn't use this script.
I must have had nothing to do
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

One thing that I thought of, thanks to arfer's mentioning of spaces...
It's not uncommon for clients/extensions to add control characters (such as bold, color, underline, etc) when using nick completion.. In this case, the pub binding will undoubtedly fail, as eggdrop does not strip these prior mask/command matching. If this is the case, your best option would be to use a pubm binding and create a suitable pattern/regular expression, possibly along with the use of the stripcodes command.
NML_375
[
[3-33]
Voice
Posts: 6
Joined: Sat Aug 08, 2009 6:18 am

Post by [3-33] »

well, i didnt say to upload your complete bot of course, i say if u can give me link, or upload the version of that bot u are using :)
The end is a new begining
Post Reply