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 

Help with tcl script
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
[3-33]
Voice


Joined: 08 Aug 2009
Posts: 6

PostPosted: Sun Aug 09, 2009 11:35 am    Post subject: Reply with quote

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?Very Happy
_________________
The end is a new begining
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Sun Aug 09, 2009 1:19 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
[3-33]
Voice


Joined: 08 Aug 2009
Posts: 6

PostPosted: Mon Aug 10, 2009 3:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
arfer
Master


Joined: 26 Nov 2004
Posts: 436
Location: Manchester, UK

PostPosted: Mon Aug 10, 2009 7:53 am    Post subject: Reply with quote

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:

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:

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

if {$str == ""} {
    putchan $chan "$nick: What? Чего надо ?"
    return 0
}


Would look rather better as :-

Code:

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
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Mon Aug 10, 2009 12:35 pm    Post subject: Reply with quote

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, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
[3-33]
Voice


Joined: 08 Aug 2009
Posts: 6

PostPosted: Mon Aug 10, 2009 12:52 pm    Post subject: Reply with quote

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 Smile
_________________
The end is a new begining
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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