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.

Dcc Chat

Old posts that have not been replied to for several years.
Locked
O
Onytron

Dcc Chat

Post by Onytron »

i have write a script on dcc chat request like: putserv "PRIVMSG $nick :\001DCC CHAT chat $ip $port\001" and he reply me
Client: Idiotbot (0.0.0.24)
Time: Thu Jul 18 20:18:20 2002
-
Acknowledging chat request...
-
Unable to connect
-
DCC session closed

and all is write in programmation i will paste you the code.



bind pub - !fserv PubFserv

proc PubFserv {nick host hand chan arg} {
putserv "NOTICE $nick :Initiating DCC chat..."
set port [listen 0 script "Onytron:grab [split $nick] [split $host] pub"]
putserv "PRIVMSG $nick :\001DCC CHAT chat [dnslookup [lindex [split $host @] 1] Onytron:lookup] $port"
return 0
}


proc Onytron:grab {nick host idx} {
global botnick
putdcc $idx "Connection a $botnick..."
putdcc $idx "Connection accepter ..."
control $idx "Onytron:FTF [split $nick] [split $host] [split $port]"
putdcc $idx "$tcontrol"
return 0
}

proc Onytron:FTF {nick host port idx text} {
putdcc $idx "Bienvenu sur le Fserv de Onytron"
}

proc Onytron:lookup {ip host status} {

return $ip
}


if you have the answer tell me please i search it since 2 weeks.
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

The problem is with your DNS lookup command.

It is not designed to return the reply on the spot.

You pass it the address to lookup, and the script to pass the reply to. Simalar to the way you tell the listen command to call a script, once a connection has been made.

The dnslookup command is asyncronous (spelling?), meaning, once called, it will do the lookup in the background, allowing the bot to continue working. Once the reply is known, it calls the script, and finishes off.

You would have to send the CTCP message in the lookup command, rather than in the first portion of the script.
O
Onytron

Post by Onytron »

May you write me an example because i've try many possibility and nothing work

if you show me an example i will understand. And if you talk french i would be better :)

or write it in english thanks you
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

couple of issues:

one: the address in the DCC CHAT longip port must be the bot's address .. not the user's ..

two: listen 0 .. I don't believe that returns a port does it?

anyways, here is an example:

Code: Select all

bind pub - !fakedcc pub:fakedcc

proc findopenport {} {
  global reserved-portrange
  scan ${reserved-portrange} "%d:%d" lower upper
  for {$i = $lower} {$i < $upper} {incr i} {
    if {![catch {socket -server blah $i] fd]} {
      close $fd
      return $i
    }
  }
  error "no ports available"
}

proc pub:fakedcc {nick uhost hand chan arg} {
  if {[catch {findopenport} port]} {
    puthelp "NOTICE $nick :Cannot dcc chat you since I can't find an open ort"
    putlog "No open ports to dcc chat $nick!$uhost"
    return 0
  } {
    listen $port script "dcc:incoming $port" pub
    puthelp "NOTICE $nick :Sending you a dcc chat ..."
    puthelp "PRIVMSG $nick :\001DCC CHAT chat [myip] $port\001"
  }
}

proc dcc:incoming {port idx} {
   control $idx dcc:text
   listen $port off
}

proc dcc:text {idx text} {
  if {$text == ""} {
    return 0
  }
  putlog "Text from $idx: $text"
}
Jen wanted to insert this happy face :evil: this code is completely untested .. but it should work.
O
Onytron

Post by Onytron »

yes it return a port :)

and now it's work perfectly thansk you :)
g
guppy
eggdrop engineer
Posts: 199
Joined: Mon Sep 24, 2001 8:00 pm
Location: Canada
Contact:

Post by guppy »

wow I learn something everyday.

I wonder if that respects reserved-portrange though ... hope so since I wrote that setting ...

Jeff
Locked