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.

getchanhost

Help for those learning Tcl or writing their own scripts.
Post Reply
G
Gust
Voice
Posts: 15
Joined: Wed Jun 28, 2006 12:53 pm

getchanhost

Post by Gust »

Hi,

i am using the following code in my script:

Code: Select all

bind pub o|o !ident ident_script

proc ident_script { nick uhost hand chan arg } {
	set txt [split $arg]
	set player [lindex $txt 0]
	append ident "*!*" [getchanhost $player $chan]
	puthelp "PRIVMSG $chan :$ident"
}
It's a stupid script i wrote, because i had some problems with an invite script that also uses getchanhost...

But I discovered that the script above only works good if my eggdrop is only on 1 channel... If I try the script when my eggdrop is on multiple channels, the bot output is:

Code: Select all

*!*
Somebody know how to fix that?

Thanks!
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

Hint: the channel argument is optional.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
G
Gust
Voice
Posts: 15
Joined: Wed Jun 28, 2006 12:53 pm

Post by Gust »

Could you give me some more information?

Because i am new to tcl-scripting, i don't really understand what you are trying to say...

Thanks!
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

There is no more information, everything can be assumed :P.
- the topic/function I am talking about is 'getchanhost'
- the channel argument of course refers to '$chan'
- and optional means, you can remove it
- hint means: try and see what happens!
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
G
Gust
Voice
Posts: 15
Joined: Wed Jun 28, 2006 12:53 pm

Post by Gust »

OK, tried to remove $chan argument, but still the same problem...

This is the script i've tried...

Code: Select all

bind pub o|o !ident ident_script 

proc ident_script { nick uhost hand chan arg } { 
   set txt [split $arg] 
   set player [lindex $txt 0] 
   append ident "*!*" [getchanhost $player] 
   puthelp "PRIVMSG $chan :$ident" 
}
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

whats the result? still "*!*"? If its "*!*" there is no such nick on any channel the bot is on. Otherwise you would have found a bug in eggdrop which I cannot reproduce. Make sure there are no invisible characters involved (maybe use stripcodes?!).
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
G
Gust
Voice
Posts: 15
Joined: Wed Jun 28, 2006 12:53 pm

Post by Gust »

Yups, still "*!*"

No error, and the user is on the channel...

It works when the bot is only on 1 channel...
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

check the channel records (.channel #chan in partyline), maybe the bot does not have proper host entries for one of the channels.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
Post Reply