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 

Channel Key Save.

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
CoMMy
Halfop


Joined: 24 Jul 2003
Posts: 99
Location: Cyprus

PostPosted: Sat Sep 02, 2006 9:05 am    Post subject: Channel Key Save. Reply with quote

Hi guys,

I want to create a script that will save the channel key when its currently in the channel that has it so that it will be able to rejoin the channel incase of a ping timeout or a disconnect of some sort.

Any ideas how to do this or if there is a ready script?

Thanks
_________________
(c) CoMMy (c)
Resistance is Futile!!
We Are The Borg!!
Back to top
View user's profile Send private message
krimson
Halfop


Joined: 19 Apr 2006
Posts: 86

PostPosted: Sat Sep 02, 2006 11:24 am    Post subject: Reply with quote

http://www.egghelp.org/faq.htm#034
Back to top
View user's profile Send private message Send e-mail
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sat Sep 02, 2006 12:45 pm    Post subject: Reply with quote

Untested code, but should do the trick...

Code:
bind mode - * update_key
bind raw - 324 get_key
bind need - "% key" use_key

proc update_key {bind nick host hand chan what text} {
 global chankey
 if {$what == "+k"} {
  set chankey([string tolower $chan]) $text
 }
}

proc get_key {from what text} {
 global chankey
 set params [split text]
 if {[string match "+*k*" [lindex $params 2]]} {
  set chankey([string tolower [lindex $params 1]]) [lindex $params end]
 }
 return 0
}

proc use_key {chan type} {
 global chankey
 if {[info exists chankey([string tolower $chan])]} {
  putserv "JOIN $chan $chankey([string tolower $chan])"
 }
}

_________________
NML_375, idling at #eggdrop@IrcNET
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 -> Script Requests 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