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 

help with server tcl

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


Joined: 03 Aug 2011
Posts: 41

PostPosted: Tue Dec 06, 2011 9:24 pm    Post subject: help with server tcl Reply with quote

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
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Wed Dec 07, 2011 10:40 am    Post subject: Reply with quote

Moderated: Moved to "Script Request"

/NML_375

_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Fri Dec 30, 2011 4:01 pm    Post subject: noone Reply with quote

hello can any1 help me on tht?
Back to top
View user's profile Send private message
Johannes13
Halfop


Joined: 10 Oct 2010
Posts: 46

PostPosted: Tue Jan 31, 2012 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Fri Feb 10, 2012 7:37 pm    Post subject: ty Reply with quote

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
View user's profile Send private message
Johannes13
Halfop


Joined: 10 Oct 2010
Posts: 46

PostPosted: Sun Feb 12, 2012 11:10 am    Post subject: Reply with quote

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
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Mon Feb 13, 2012 2:28 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
Johannes13
Halfop


Joined: 10 Oct 2010
Posts: 46

PostPosted: Mon Feb 13, 2012 4:17 pm    Post subject: Reply with quote

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
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Wed Feb 15, 2012 6:47 pm    Post subject: Reply with quote

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
View user's profile Send private message
speechles
Revered One


Joined: 26 Aug 2006
Posts: 1398
Location: emerald triangle, california (coastal redwoods)

PostPosted: Thu Feb 16, 2012 4:27 am    Post subject: Reply with quote

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
View user's profile Send private message
janii
Halfop


Joined: 03 Aug 2011
Posts: 41

PostPosted: Mon Feb 20, 2012 6:31 pm    Post subject: Reply with quote

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
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