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.

dccsend within control proc

Old posts that have not been replied to for several years.
Locked
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

dccsend within control proc

Post by Ofloo »

how do i get a nick into this thing (nick of the connecting user)
listen <port> script <proc> [flag]
Description: accepts connections which are immediately routed to a proc. The proc is called with one parameter: the idx of the new connection. Flag may currently only be 'pub', which makes the bot allow anyone to connect.
i wana initiate an dcc send from withing a control proc .. any one any suggestions plz would be so great full and be a real life saver .. problem is i don't have a nick to send to i could use global but its multiuser so .. :( i could use global on the idx but i can't seem to figur out a way to put $idx & $nick to gether .. to create $nick($idx)

and [dcclist] won't work either
[04:28] <Eggy> ---- -------- ----- --------- ----------------- ----
[04:28] <Eggy> 3 C0A80064 3333 (telnet) * lstn 3333
[04:28] <Eggy> 4 00000000 0 (dns) dns (ready)
[04:28] <Eggy> 6 C0A80064 4000 (script) listen:start lstn 4000
[04:28] <Eggy> 1 C0A80064 0 HQ llama@console chat flags: cptEp/0
[04:28] <Eggy> 8 50F7CDEE 6667 (server) c.eu.nl.ofloo.net serv (lag: 2)
[04:28] <Eggy> 9 8102D5A1 4588 Ofloo netadmin.ofloo.net chat flags: cpTEp/0
[04:28] <Eggy> 10 8102D5A1 4314 * netadmin.ofloo.net scri listen:control <-- curent dcc session
XplaiN but think of me as stupid
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Use an array? Check the tcl manual.

Or, make it like, listen 1234 script [list yourproc $nick] and then $nick will be the first param to your proc. But the array is a better way.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

Okay, firstly, I doubt [list yourproc $nick] is what you are after, as it would always call the proc with the bot's own nick setting, which I don't think is what you are after...

What I think you are after is, parse the dcclist, match up the idx with the one from the control idx, grab the host, parse through userlists for your bot's channel(s), find the matching user with the matching host...

Alternatively, you could have the user specify their IRC nickname from within the control proc itself as well.
User avatar
user
&nbsp;
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

Ofloo: how is the connection put under control initiated?
Have you ever read "The Manual"?
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

[dcclist] with the host won't work i tought of that what if the ircd has crypted hosts, a connect or listen command with control .. uses telnet (not crypted), ...

the array thing .. well not sur what u mean by it but the listen is used in the script liket this
listen 4000 script listen:start
outside the proc .. so ...

the array thing won't work either i think ..... but it was a nice idea tho, ..

unless i can send it to the control proc some how, also $nick = $botnick if i use it like that and if i would global the nick from the other proc using set ::nick $nick .. how would i be able to set it to the right idx cause that idx is only known from the moment they accept the dcc chat ..
listen 4000 script listen:start

proc ...{}{
putserv "PRIVMSG $nick :\001DCC CHAT chat [myip] 4000\001"
}

proc listen:start {idx} {
control $idx listen:control
}

proc listen:control {fidx arg} {
....[script]....
}
i think i need an array of some kind but i need to be able to set the right nick once an dccchat is accepted .. if it dcc chats doesn't it send its nick ?

i mean isn't there some way i could get there nick from that dcc chat ? like if they connect can't i get it some how ..? if u talke it goes like
<nick> hello
<bot> hi
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

this array thing how does that work ..? my script working all i need is this then its almost done ..
XplaiN but think of me as stupid
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

ok i got the nick imported but i have one problem, if 2 users send dcc request one after an other, then the nick is messed up .. like i type !trigger and one second later second user !trigger the first one has the same nick as the second one .. how do i solve that ??

Code: Select all

listen 4000 script listen:start 

proc ...{}{ 
  putserv "PRIVMSG $nick :\001DCC CHAT chat [myip] 4000\001" 
  set ::dccnick $nick
} 

proc listen:start {idx} { 
  set dccnick($idx) $::dccnick
  control $idx [list listen:control $dccnick($idx)]
} 

proc listen:control {nick fidx arg} {
  ....[script].... 
}
could i some how delay the dcc chat of the second if i would so
if control active delay or something


cause if i where to delay both same thing would happen only later .. so there is no point on doing that ..
XplaiN but think of me as stupid
Locked