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.

Getting a chan key

Old posts that have not been replied to for several years.
Locked
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Getting a chan key

Post by ^DooM^ »

Hi there.

I'm not new to eggdrop's but i am fairly new to scripting. I have written about 10 scripts for my personal use mainly !trigger related scripts and i am trying to write a script to retrive the key from a channel i specify that the bot is in. :D

I have gotten so far but the bot seems to retrieve the number of people in the channel rather than the key that is set. :cry:

All i need is the line that retrieves the channel key if any of you could possibly help me.

Here is the proc i have written to retrieve the key

proc currentkey {chan} {
set currentmodes [getchanmode $chan]
if {[string match "*k*" [lindex $currentmodes 0 ]]} {
return [lindex $currentmodes end]
}
return 0
}

please try not to laugh at my code too much :lol:

Thanks in advance. Jon. :wink:
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Code: Select all

lindex [split $currentmodes] 1
User avatar
^DooM^
Owner
Posts: 772
Joined: Tue Aug 26, 2003 5:40 pm
Location: IronForge
Contact:

Post by ^DooM^ »

thanks user. worked a treat :D
Locked