This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Send text fast without server?

Old posts that have not been replied to for several years.
Locked
t
tR
Voice
Posts: 19
Joined: Wed Dec 12, 2001 8:00 pm

Send text fast without server?

Post by tR »

Hi,

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.
I
Iridium

Post by Iridium »

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:

Code: Select all

putdcc $idx "Hellow there!"
Hope that helps.
Locked