mIRC Home    About    Download    Register    News    Help

Print Thread
#44062 25/08/03 08:36 AM
Joined: Aug 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Aug 2003
Posts: 2
hi, i want to save a txt file (with same name as file) with the network/channel/and user details whenever i queue a file or maybe the transfer starts. just in case i lose the connection etc, it would be easier to resume. is this possible with a script?

help appreciated..

sygenics confused

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
Short answer: yes.

As for how -- that all depends. Did you request the file in an fserve (gonna be somewhat harder then), or via a direct trigger. You could then simply do something like this: (note this may not be the most elegant way to do this... - you can also save one trigger per user this way as well...)

Code:
[color:green]; alias to save the trigger, requires manual input:[/color]
[color:green]; /trig <nick> <complete trigger>[/color]
alias trig { write [color:blue]filename.txt[/color] $network $channel $1 $2- }
[color:green] [/color]
[color:green]; this deletes a trigger in the file if the file has been completely received[/color]
on *:FILERCVD:*: { if ($read([color:blue]filename.txt[/color],s,$nick)) write $+(-dl,$readn) [color:blue]filename.txt[/color] }
[color:green] [/color]
[color:green]; this will check for the right network and channel when you join,[/color]
[color:green]; then if the nick exists in your list, send the trigger[/color]
on me:*:JOIN:#: {
[color:green]  ; opens a temporary window with all triggers with the right channel and network[/color]
  window -h @tmp
  filter -fw [color:blue]filename.txt[/color] @tmp $+(*,$network,*,$chan,*)
  var %x = $line(@tmp,0)
[color:green]  ; loop that reads lines from the window, checks for the user and sends the trigger[/color]
  while (%x) {
    var %y = $line(@tmp,%x))
    tokenize 32 %y
    if ($3 ison $chan) $4-
    dec %x
  }
[color:green]  ; clean up after yourself![/color]
  close -@ @tmp
}


Change the parts in blue. If used right this should work.



DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius
Joined: Aug 2003
Posts: 2
S
Bowl of petunias
OP Offline
Bowl of petunias
S
Joined: Aug 2003
Posts: 2
thanks for the reply, it was indeed a direct trigger in the channel and not an fserve.

i can't get it to auto respond though, it will open a file if i type /trig with the network name but thats it. i >ideally< would like it to automatically respond to a dcc get and write the network/channel/user and trigger.

not sure if i'm doing something dumb or not smile

thanks for the help tho, much appreciated

Joined: Mar 2003
Posts: 1,271
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Mar 2003
Posts: 1,271
The problem with that is that it's not possible. You can auto-detect the start of a DCC send, but there is no way to attach a trigger to it. Well, no way may be harsh, but it's not gonna be easy. You could write an on input that would save a anything you type, and as long as there is an actual nick in the trigger, you could match that with the on notice event, but that's tricky.


DALnet #Helpdesk
I hear and I forget. I see and I remember. I do and I understand. -Confucius

Link Copied to Clipboard