mIRC Home    About    Download    Register    News    Help

Print Thread
Getting dcc send/recieve windows to open #151520 18/06/06 04:39 PM
Joined: Mar 2004
Posts: 138
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 138
I know this is a double post but it seems that either people don't have any idea how to do what it is I want or it's not possible or it's gone so far it's on another page and not being viewed so I am reposting. Sorry for being so persistant but I am really in need of some help on this matter.

Code:
on *:dialog:dccbar:init:0: {
  $mdx.load
  mdx SetDialog $dname style
  mdx SetControlMDX $dname 2 listview report infotip single rowselect > $mircdir $+ \script\mdx\views.mdx
  did -i $dname 2 1 headerdims 319 150 130 130 130 130 130 150
  did -i $dname 2 1 headertext Filename $chr(9) User Name $chr(9) Status $chr(9) Size $chr(9) $chr(37) Complete $chr(9) Rate $chr(9) Time Left $chr(9) Elasped Time
  did -i $dname 2 1 setbkg color $color($color(background))
  did -i $dname 2 1 settxt bgcolor $color($color(background))
  did -i $dname 2 1 settxt color $color($color(normal text))
  mdx SetFont $dname 2 -10 700 Tahoma
  dll script\dlls\hOS.dll DockWindow $dname bottom
  did -i $dname 2 1 seticon normal 0 72,script\icons\beos.icl
  did -i $dname 2 1 seticon normal 0 71,script\icons\beos.icl
}

on *:dialog:dccbar:dclick:2: {
  [color:red]/windows -x get[/color]
}

alias dccbar {
  if (!$dialog(dccbar)) { dialog -m dccbar dccbar }
  else { dll script\dlls\hOS.dll UndockWindow $dname bottom }
}

alias dccbar.update {
  if ($dialog(dccbar)) {
    var %sel = $did(dccbar,2).sel
    if ($calc($get(0) + $send(0)) != $calc($did(dccbar,2).lines -1)) { goto refresh }
    var %g = 1
    while $get(%g) {
      did -o dccbar 2 $calc(%g +1) +r 1 $chr(160) $get(%g).file $chr(9) $get(%g) $chr(9) $cap($get(%g).status) $chr(9) $regsize($get(%g).size,1) $chr(9) $get(%g).pc $+ % $chr(9) $round($calc($get(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($get(%g).size - $get(%g).rcvd) / $get(%g).cps)).sec $chr(9) $sduration($get(%g).secs).sec $chr(4) Nick: $get(%g) $crlf File: $get(%g).file $crlf Progress: $get(%g).pc $+ %
      inc %g
    }
    var %g = 1
    while $send(%g) {
      did -o dccbar 2 $calc(%g + $get(0) +1) +r 2 $chr(160) $send(%g).file $chr(9) $send(%g) $chr(9) $cap($send(%g).status) $chr(9) $regsize($send(%g).size,1) $chr(9) $send(%g).pc $+ % $chr(9) $round($calc($send(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($send(%g).size - $send(%g).rcvd) / $send(%g).cps)).sec $chr(9) $sduration($send(%g).secs).sec $chr(4) Nick: $send(%g) $crlf File: $send(%g).file $crlf Progress: $send(%g).pc $+ %
      inc %g
    }
    did -c dccbar 2 %sel
    goto end
    :refresh
    did -r dccbar 2
    var %g = 1
    while $get(%g) {
      did -a dccbar 2 $calc(%g +1) +r 1 $chr(160) $get(%g).file $chr(9) $get(%g) $chr(9) $cap($get(%g).status) $chr(9) $regsize($get(%g).size,1) $chr(9) $get(%g).pc $+ % $chr(9) $round($calc($get(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($get(%g).size - $get(%g).rcvd) / $get(%g).cps)).sec $chr(9) $sduration($get(%g).secs).sec $chr(4) Nick: $get(%g) $crlf File: $get(%g).file $crlf Progress: $get(%g).pc $+ %
      inc %g
    }
    var %g = 1
    while $send(%g) {
      did -a dccbar 2 +r 2 $calc(%g + $get(0) +1) 2 $chr(160) $send(%g).file $chr(9) $send(%g) $chr(9) $cap($send(%g).status) $chr(9) $regsize($send(%g).size,1) $chr(9) $send(%g).pc $+ % $chr(9) $round($calc($send(%g).cps /1024),1) kb/s $chr(9) $sduration($calc(($send(%g).size - $send(%g).rcvd) / $send(%g).cps)).sec $chr(9) $sduration($send(%g).secs).sec $chr(4) Nick: $send(%g) $crlf File: $send(%g).file $crlf Progress: $send(%g).pc $+ %
      inc %g
    }
    :end
  }
}

alias cap {
  return $upper($mid($1-,1,1)) $+ $mid($1-,2,$len($1-))
}

alias title {
  if ($dialog(dccbar)) { dccbar.update }
}

alias regsize {
  var %s = $1
  if ($len(%s) <= 4) { return $round($calc(%s /1024),$2) KB }
  elseif ( $len(%s) > 4 && $len(%s) <= 6) { return $round($calc(%s /1024),$2) KB }
  elseif ($len(%s) >= 7) { return $round($calc($calc(%s /1024) /1024),$2) MB }
}


I am concerned with at the moment is getting the
incoming/outgoing windows to open when I dclick on the
corrisponding line when I am getting or sending a file. The
section in red is where the problem lies. Incase it matters, in
mirc options under display I have Include DCC's unchecked
so that the dcc windows aren't showing because the info for
those windows show in the dialog docked at the bottom. I
just want/need the windows to open when I dclick. Thanks
for any help on the matter.

Re: Getting dcc send/recieve windows to open #151521 18/06/06 09:56 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Assuming that %line contains the text of the line selected

var %w = $+("Get $gettok(%line,2,9) $gettok(%line,1,9),") | if ($len(%w) <= 92) { window -x %w }

the <= 92 check is becuase if the "GET <NICK> <FILE>" is over that mirc cant use the window name, this might have been corrected in 6.17 i havent checked. That or using its window handle in 6.17 might work.

Re: Getting dcc send/recieve windows to open #151522 19/06/06 06:18 AM
Joined: Mar 2004
Posts: 138
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 138
First off, thank you for responding, i was beginning to think no one knew a way to get it done. However, I'm not sure where I should put the code you gave me. Can you let me know thanks again.

Re: Getting dcc send/recieve windows to open #151523 19/06/06 09:07 AM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
Is that code not yours?, becuase if it was u should have been able to understand what i said and use it where u need.

Anyway with luck this would work, im not great with dialogs so im guessing the $did here

where u had
Code:
on *:dialog:dccbar:dclick:2: {
  /windows -x get
}

replace with
Code:
[code]on *:dialog:dccbar:dclick:2: {
  var %line = [color:blue]$did(dccbar,2,1).seltext[/color], %w = $+("Get $gettok(%line,2,9) $gettok(%line,1,9),") | if ($len(%w) &lt;= 92) { window -x %w }
}


The blue section represents the selected line, so if i have that wrong u need to correct it.

Re: Getting dcc send/recieve windows to open #151524 19/06/06 01:59 PM
Joined: Mar 2004
Posts: 138
D
Darkmnm Offline OP
Vogon poet
OP Offline
Vogon poet
D
Joined: Mar 2004
Posts: 138
Once again, thank you for your help. Unforfunitly i'm still getting /window: invalid parameters (line 267, system1.hss)
and I've played with the coding and it just doesn't seem to be working. Most of the code was mine but since I did it I've changed so much from peoples suggestions and comments I've gotten myself lost in the mess. I'm not new to coding but I'm also very much not as advanced in coding as many other are due to time restraints in my life. I was pretty sure that the code went in that section but after all the problems I've had with getting this to work I've become very insecure with myself and just wanted to make definately sure I was right because anymore errors from this thing without me double checking would just make me go bonkers. Anyway, thank you again for your responce and help in the matter. It's greatly appreciated.

Re: Getting dcc send/recieve windows to open #151525 19/06/06 11:06 PM
Joined: Sep 2003
Posts: 4,230
D
DaveC Offline
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
where it does the window command add to the front of it ///ECHO -st / then instead of the command it well echo it to the status window, then u can try the command manually and see whats wrong with it, (if it doesnt become blatently obvious just by looking at it)