| View previous topic :: View next topic |
| Author |
Message |
CoMMy Halfop

Joined: 24 Jul 2003 Posts: 99 Location: Cyprus
|
Posted: Sat Sep 02, 2006 9:05 am Post subject: Channel Key Save. |
|
|
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 |
|
 |
krimson Halfop

Joined: 19 Apr 2006 Posts: 86
|
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sat Sep 02, 2006 12:45 pm Post subject: |
|
|
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 |
|
 |
|