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.

help with server tcl

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

help with server tcl

Post by janii »

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
n
nml375
Revered One
Posts: 2860
Joined: Fri Aug 04, 2006 2:09 pm

Post by nml375 »

Moderated: Moved to "Script Request"

/NML_375
NML_375
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

noone

Post by janii »

hello can any1 help me on tht?
J
Johannes13
Halfop
Posts: 46
Joined: Sun Oct 10, 2010 11:38 am

Post by Johannes13 »

Sounds easy...
But YOU have to setup all the servers...

Ohh, and I limited it to bot masters.

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]
      }
    }
  }
}
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

ty

Post by janii »

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
J
Johannes13
Halfop
Posts: 46
Joined: Sun Oct 10, 2010 11:38 am

Post by Johannes13 »

Ok, you need at least tcl 8.5 for this.
Reinstall tcl and recompile eggdrop.

to add servers, look at this bit:

Code: Select all

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: Select all

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: 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)]
      }
    }
  }
}
Ok, one last thing: if you want that other guys than masters can use this command, change in line

Code: Select all

  bind pubm m|- * [namespace current]::dojump
m|- with the flags you want to allow. See .help whois
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

Post by janii »

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 :)
J
Johannes13
Halfop
Posts: 46
Joined: Sun Oct 10, 2010 11:38 am

Post by Johannes13 »

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: 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)
			}
		}
	}
}
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

Post by janii »

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
User avatar
speechles
Revered One
Posts: 1398
Joined: Sat Aug 26, 2006 10:19 pm
Location: emerald triangle, california (coastal redwoods)

Post by speechles »

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)
         }
      }
   }
}
Added code to de-init server list and reset it into local namespace as an array.
j
janii
Halfop
Posts: 41
Joined: Wed Aug 03, 2011 8:08 am

Post by janii »

Thanx speechless now its working perfect... and special thnx to Johannes13 for helping and working on this tcl .. thanks once again guys
Post Reply