| View previous topic :: View next topic |
| Author |
Message |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Tue Dec 06, 2011 9:24 pm Post subject: help with server tcl |
|
|
hello i want a tcl for dalnet like this
!punch
and the bot shall jump to punch.va.us.dal.net
!krypt
and the bot shall jump to krypt.ca.us.dal.net
and only specified users shall use this command in the channel any help will be appreciated thank you |
|
| Back to top |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Wed Dec 07, 2011 10:40 am Post subject: |
|
|
Moderated: Moved to "Script Request"
/NML_375 _________________ NML_375, idling at #eggdrop@IrcNET |
|
| Back to top |
|
 |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Fri Dec 30, 2011 4:01 pm Post subject: noone |
|
|
| hello can any1 help me on tht? |
|
| Back to top |
|
 |
Johannes13 Halfop
Joined: 10 Oct 2010 Posts: 46
|
Posted: Tue Jan 31, 2012 2:04 pm Post subject: |
|
|
Sounds easy...
But YOU have to setup all the servers...
Ohh, and I limited it to bot masters.
| Code: |
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]
}
}
}
} |
|
|
| Back to top |
|
 |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Fri Feb 10, 2012 7:37 pm Post subject: ty |
|
|
thank you for the help but i need a further help with thanx
problem is this code is working with eggdrop v1.6.20, on FreeBSD 7.3-RELEASE-p10.
but not on
eggdrop v1.6.20, on FreeBSD 8.0-RELEASE-p6.
i get this error in party line on freebsd 8.0
Tcl error [::jumptrigger::dojump]: invalid command name "dict"
any help regarding this is appreciated
and how can i add few nicks to use the !punch !krypt command in place of just bot masters |
|
| Back to top |
|
 |
Johannes13 Halfop
Joined: 10 Oct 2010 Posts: 46
|
Posted: Sun Feb 12, 2012 11:10 am Post subject: |
|
|
Ok, you need at least tcl 8.5 for this.
Reinstall tcl and recompile eggdrop.
to add servers, look at this bit:
| Code: | set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
}
|
If you want to add foo,
you want to change it to
| Code: |
set serverlist {
punch punch.va.us.dal.net
krypt krypt.ca.us.dal.net
foo foo.bar.dal.net
}
|
(I don't know the names of all dal net servers, so foo is just an example.
And I'm too lazy to look them up for you.
mhh, I might create a version based on arrays, that will work with tcl 8.4
| Code: | 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)]
}
}
}
}
|
Ok, one last thing: if you want that other guys than masters can use this command, change in line | Code: | | bind pubm m|- * [namespace current]::dojump | m|- with the flags you want to allow. See .help whois |
|
| Back to top |
|
 |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Mon Feb 13, 2012 2:28 pm Post subject: |
|
|
thnx for helping so much
but m still having problem running this code now i got the below error
<(Trivia> [22:12:27] can't set "serverlist(punch)": variable isn't array
<(Trivia> while executing
<(Trivia> "array set serverlist {
<(Trivia> punch punch.va.us.dal.net
<(Trivia> krypt krypt.ca.us.dal.net
<(Trivia> choopa choopa.nj.us.dal.net
<(Trivia> under underworld.se.eu.dal.n..."
<(Trivia> (in namespace eval "::jumptrigger" script line 2)
<(Trivia> invoked from within
<(Trivia> "namespace eval ::jumptrigger {
<(Trivia> array set serverlist {
<(Trivia> punch punch.va.us.dal.net
<(Trivia> krypt krypt.ca.us.dal.net
<(Trivia> choopa choopa.nj.us.dal.ne..."
<(Trivia> (file "scripts/server.t
<(Trivia> [22:12:27] * CONFIG FILE NOT LOADED (NOT FOUND, OR ERROR)
<(Trivia> [11] Chat closed
Please help resolving this error  |
|
| Back to top |
|
 |
Johannes13 Halfop
Joined: 10 Oct 2010 Posts: 46
|
Posted: Mon Feb 13, 2012 4:17 pm Post subject: |
|
|
make sure there is no older script that uses the ::jumptrigger namespace.
And make sure there is no set jumptrigger {...} statement, only array set jumptrigger {...}
(.rehash with the new script without unsetting jumptrigger::serverlist could have caused this)
ohh, and I made some mistakes.. (I should use paste.tclhelp.net to check it)
| Code: | 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)
}
}
}
} |
|
|
| Back to top |
|
 |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Wed Feb 15, 2012 6:47 pm Post subject: |
|
|
still not working same error
if its not working on array thn do lemme knw how to install tcl 8.5 in my eggdrop bot |
|
| Back to top |
|
 |
speechles Revered One

Joined: 26 Aug 2006 Posts: 1398 Location: emerald triangle, california (coastal redwoods)
|
Posted: Thu Feb 16, 2012 4:27 am Post subject: |
|
|
| Code: | 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)
}
}
}
} |
Added code to de-init server list and reset it into local namespace as an array. _________________ speechles' eggdrop tcl archive |
|
| Back to top |
|
 |
janii Halfop
Joined: 03 Aug 2011 Posts: 41
|
Posted: Mon Feb 20, 2012 6:31 pm Post subject: |
|
|
| Thanx speechless now its working perfect... and special thnx to Johannes13 for helping and working on this tcl .. thanks once again guys |
|
| Back to top |
|
 |
|