Yup this is very possible..
here is an example script to do it (untested, but just to give you the idea..)
dccstuff.tcl
Code: Select all
# 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:
Hope that helps.