Code: Select all
namespace eval ::jumptrigger {
set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
bind pubm m|- * [namespace current]::dojump
proc dojump {n u h c t} {
variable serverlist
if {[string index $t 0] eq "!"} {
set srv [string range $t 1 end]
if {[dict exist $serverlist $srv]} {
jump [dict get $serverlist $srv]
}
}
}
}
Code: Select all
set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
Code: Select all
set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
foo foo.bar.dal.net
}
Code: Select all
namespace eval ::jumptrigger {
array set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
bind pubm m|- * [namespace current]::dojump
proc dojump {n u h c t} {
variable serverlist
if {[string index $t 0] eq "!"} {
set srv [string range $t 1 end]
if {[info exist $serverlist($srv)]} {
jump $serverlist($srv)]
}
}
}
}
Code: Select all
bind pubm m|- * [namespace current]::dojump
Code: Select all
namespace eval ::jumptrigger {
array set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
bind pubm m|- * [namespace current]::dojump
proc dojump {n u h c t} {
variable serverlist
if {[string index $t 0] eq "!"} {
set srv [string range $t 1 end]
if {[info exists serverlist($srv)]} {
jump $serverlist($srv)
}
}
}
}
Code: Select all
namespace eval ::jumptrigger {
if {[info exists serverlist]} { unset serverlist }
variable serverlist
array set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
bind pubm m|- * [namespace current]::dojump
proc dojump {n u h c t} {
variable serverlist
if {[string index $t 0] eq "!"} {
set srv [string range $t 1 end]
if {[info exists serverlist($srv)]} {
jump $serverlist($srv)
}
}
}
}