PDA

View Full Version : tcl eggdrop scripting



KC2UGV
03-29-2010, 11:40 AM
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.

KC2UGV
03-29-2010, 03:06 PM
ok, so I kind of got this working thus far:

dxclusterbot.tcl

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

#!/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:

#!/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.

F4GUG
04-30-2013, 12:18 PM
Hello

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

9548
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