i need to send to a user one query result from Mysql. The problem ist that the result can be very long and then the bot lags until all columns are done. Is there a possiblility to open from tcl a dcc chat or something without the user have to login and send them the results directly? Now works with File DCC, but this is not very usable. thanx in advance.
# you need a port number to listen on so that we can send DCC chats
# alternatively, I've also binded .getsql on the partyline to it,
# where you can comment out this line, and the m
set sql-theport "12345"
listen $sql-theport script sqlaccept
bind dcc n getsql sqlmovecontrol
bind msg n getsql sqlmsgcreatecontrol
proc sqlmovecontrol { hand idx args } {
control $idx "sqldcc"
}
proc sqlmsgcreatecontrol {nick host hand args} {
putserv "PRIVMSG $nick :\001DCC CHAT [myip] $sql-theport"
putserv "NOTICE $nick :I have sent you a dcc chat, please accept."
}
proc sqlaccept { idx } {
sqlmovecontrol "" $idx ""
}
proc sqlcontrol { idx text } {
# code to 'control' the dcc chat goes here..
if {$text == ""} {
#client closed connection.. kill it
return 1;
}
if {$text == ".exit"} {
# return them to the partyline/kill the dcc
putdcc $idx "See you later."
killdcc $idx
}
if {$text == ".query"} {
# code to query the sql db goes here
}
}
May take some fiddling, I advise you don't use this if you don't know what you're doing and ask for more help. The binds are .getsql on the partyline or "getsql" in a private message (both only avaliable to owners)
You need to write the code to handle people. To say something to the other end of the person in the dcc chat do: