mIRC Home    About    Download    Register    News    Help

Print Thread
#106368 29/12/04 09:20 AM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
I cant work out what im doing wrong here, this should respond to Request Number* in a channel and check to see whether the file requested is on my hard drive. If it is, it should then send to the nick asking for it. Any help would be much appreciated smile

ON *:LOAD: {
set %workingincdir $sdir(c:\,Select directory where folders with rar files are)
}
ON *:TEXT:8Request number*:#incomplete: { if ($exists($findfile(%workingincdir,$10,5))) {
msg #incomplete I have your file and am sending to you now
dcc send $nick " $+ %workingincdir [ $+ $findfile(%workingincdir,$10,5) ] $+ "
msg #incomplete !close Request Number $4
}
else {
haltdef
}
}


i script, therefore i am smirk
theres logic in there somewhere...
#106369 29/12/04 05:40 PM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
Can you give us some examples of what your channel visitors would type to request a file?

#106370 29/12/04 06:41 PM
Joined: Dec 2002
Posts: 3,547
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,547
Yeah, I was actually wondering where $10 came from.

#106371 30/12/04 12:01 AM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
Request number [ 12 ] added by nickname [ filename.rar / Original.FILE ]

I was counting [ and ] as a character.


i script, therefore i am smirk
theres logic in there somewhere...
#106372 30/12/04 10:19 AM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Well first off, "$findfile(%workingincdir,$10,[color:red]5))) "[/color] is trying to find the fifth file by that name in that directory, which obviously can't exist.
Also " $+ [color:green]%workingincdir [ $+ $findfile(%workingincdir,$10,[color:red]1)[/color] ] $+ "[/color] would become "X:\path\X\path\file.ext"
Code:
on *:text:8Request number*:#incomplete:{
  if $exists(%workingincdir $+ $10) {
    msg $nick I have your file and am sending to you now
    dcc send $nick %workingincdir $+ $10
    msg # !close Request Number $4
  }
}

#106373 31/12/04 10:37 AM
Joined: Jul 2004
Posts: 40
D
dmmrs Offline OP
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2004
Posts: 40
that works fine, however, what if i wanted it to search inside all subdirs as well? For that file, obviously.


i script, therefore i am smirk
theres logic in there somewhere...
#106374 31/12/04 04:54 PM
Joined: Aug 2003
Posts: 1,831
I
Hoopy frood
Offline
Hoopy frood
I
Joined: Aug 2003
Posts: 1,831
Code:
on *:text:8Request number*:#incomplete:{
  if $findfile(%workingincdir,$10,1) {
    msg $nick I have your file and am sending to you now
    dccsend $nick $v1
    msg # !close Request Number $4
  }
}


Link Copied to Clipboard