mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
The problem I have with this script is when it try's to regrab a file with spaces in the title name. The script replaces the spaces with underscores. Istead of the true file name. I would appreciate any imput on fixing the problem.

Code:
 

on *:getfail:*:{
  if ($window(@c2req) == $null) goto F
  if ($c2.readini(re^re) != 1) goto E
  if ($c2.readini(ON) != 1) goto E
  var %reqet = $reqet?($nick,$nopath($filename))
  var %fname = $gett($nopath($filename))
  var %tt = $nopath($filename) $+ $chr(144) $+ $nick $+ $chr(144) $+ *
  var %nick = $nick
  var %fline = $fline(@c2reqFF,%tt,1,0)
  if (%fline) %nick = $gettok($line(@c2reqFF,%fline),3,144)
  /e ccomchan: $ccomchan(%nick)
  if ($ccomchan(%nick)) && ($server) && (%reqet > 0) {
    var %del = $c2.readini(reqdel)
    %del = $iif( (%del) && (%del isnum 0-120) , %del , 0)
    if (%del == 0) goto ADD
    .timer -o 1 %del c2req.req $ccomchan(%nick) %nick %fname
    /e Waiting $u(%del) seconds before reRequesting $u(%fname)
    goto E
    :ADD
    var %t1 = $u(%nick) ( $+ $nick $+ )
    msg $ccomchan(%nick) ! $+ %nick %fname
    /e Rerequesting $u(%fname) from $iif( %nick != $nick , %t1 , $u($nick) ) after receiving $u(%reqet) bytes
  }
  else { 
    iline @c2req 1 ! $+ $nick $+ $chr(32) $+ %fname 
    var %t1 = $u(%nick) $+ ( $+ $nick $+ ) 
    /e Can't Rerequest from $nick now, so 've add $u(%fname) to the request list
  }
  :E 
  if ($window(@c2reqFF) == $null) goto F
  var %temp = $nopath($filename) $+ $chr(144) $+ $nick $+ $chr(144) $+ *
  var %fline = $fline(@c2reqFF,%temp,1,0)
  if (%fline) dline @c2reqFF %fline
  :F
  delt $nopath($filename)
}

 




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
If I get your meaning, all you need is to change underscores back to spaces for an appropriate request.

Replace your /msg line with this one:
Code:

msg $ccomchan(%nick) ! $+ %nick [color:blue]$replace([/color]%fname[color:blue],_,$chr(32))[/color]

By the way, the underscores are used for keeping compatibility with older clients, that require file names to be only a single word. for more info read /help long file names.

Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
The only problem I have with using Replace is some people have files with underscores in the file name and others have files with out the underscores in the file name. The script is set to request a file from a window but when the file is requested it removes the file name instead of leaving the file name within the window until it has been recieved. Maybe thats an option I should think about to correct the problem of missed spelled file names in a regrab.
I have used $nopath($filename) in another script and it has no problem regrabbing the file the way it is spelled .

Is there a setting in mirc that replaces spaces in file names with underscores?




Intelligence: It's better to ask a stupid question, then to prove it by not asking....
Joined: Dec 2002
Posts: 417
O
Othello Offline OP
Fjord artisan
OP Offline
Fjord artisan
O
Joined: Dec 2002
Posts: 417
Thanks for the info on the dcc send I think that may have corrected the problem




Intelligence: It's better to ask a stupid question, then to prove it by not asking....

Link Copied to Clipboard