Results 1 to 3 of 3

Thread: tcl eggdrop scripting

  1. #1
    Orca Whisperer
    Join Date
    Oct 2009
    Location
    Buffalo, NY
    Posts
    22,593

    tcl eggdrop scripting

    Is there already an animal for eggdrop that connects (via telnet) to a server, and echoes it into an IRC channel?

    I'm looking to write this script, but I figure someone must have done it already. If I need to, I'll hack apart a telnet library for tcl, but not looking forward to debug testing of it.

    Specifically, I'm looking to dump a dx cluster into an IRC channel, via eggdrop.
    Big Giant Meteor 2020 - We need to make Earth Great Again

    http://www.coreyreichle.com

  2. #2
    Orca Whisperer
    Join Date
    Oct 2009
    Location
    Buffalo, NY
    Posts
    22,593

    Re: tcl eggdrop scripting

    ok, so I kind of got this working thus far:

    dxclusterbot.tcl
    Code:
    # dxcluster_bot
    # ver 0.1
    # kc2ugv 28 MAR 10
    # licensed under the GPL vr 2 or later
    
    # to connect to the cluster, issue a .cluster_connect
    #
    # to disconnect from the cluster, issue a .cluster_disconnect
    #
    
    set vDxClusterBotVersion 1.0
    
    
    
    
    listen 12345 script IncomingConnection
    
    proc IncomingConnection {idx} {
    
     #We've got a new incoming connection, hand it over to our "handler"
     control $idx IncomingTransmission
    }
    
    proc IncomingTransmission {idx text} {
     #Did we recieve a new line, or did the remote end close the connection?
     if {$text != ""} {
    
      #Slit the text into a list and retrieve the command..
      set data [split $text]
      set command "write"
    
      #.. and see what we're supposed to do.
      #Hint: this would be a nice place to add a command for authentication...
      switch $command {
       write {
    
        #Use list-element 1 as channel, and the rest as the message to be sent
        #Considder adding a check whether the connection has authenticated or not yet.
        #Atleast we do check that it's a valid channel..
        if {[validchan [set chan "#testingdxcluster"]]} {
         puthelp "PRIVMSG $chan :[join $text]"
        }
       }
      }
     } else {
      #remote connection closed, do some cleanup here if needed
      #Hint: here you would un-authenticate the idx (connection identifier)
      #For now tho, we'll just do a putlog for fun
      putlog "Remote connection $idx dropped"
     }
    }
    But, I had to hack it with Expect:
    Code:
    #!/usr/bin/expect -f
    spawn telnet dxc.ab5k.net
    expect "Please enter your call: "
    send "kc2ugv\r"
    interact
    And then this script, to put it all together:
    Code:
    #!/bin/bash
    ~/egg/eggdrop clusterbot.conf
    ~/egg/dxcluster_login.exp | nc localhost 12345
    Not pretty, but functional. It does what it's supposed to do. I know I can get that expect stuff into the tcl script somehow.
    Big Giant Meteor 2020 - We need to make Earth Great Again

    http://www.coreyreichle.com

  3. #3
    Newbie F4GUG's Avatar
    Join Date
    Apr 2013
    Location
    Gironde (33) - FRANCE
    Posts
    5
    Hello

    I ask this day to dxsummit if they allow me to use their pages.

    dxwatch-by-eggdropIRC.jpg
    http://hamradiochat.org/dxwatch-by-eggdropIRC.png

    I have an irc server under construction for hamradio and i prepare an eggdrop who (in futur) send by channel all spot by frequency.
    It is not perfect but i have just a last little problem before to have a good program

    I hope to create an attraction for our youth geeks to find new hamradio, It is too hard in France to found new OMs

    best regards

    GUG
    use a simple english please, TY

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •