mIRC Homepage


Posted By: hos

tter - 14/03/19 04:44 AM

I need to capture a command before it is executed and change send to ssend:
original command:
/msg LuckyCharms xdcc send #639
new command
/msg LuckyCharms xdcc ssend #639

I came accross this
on 1:input:*:{ msg $target $replace($1-, send, ssend) | haltdef }

but this does not execute.

how do i do it?
Posted By: maroon

Re: tter - 14/03/19 08:10 AM

"/msg" and your magically delicious target is already part of $1-, so when you use $target as part of the message, it inserts the value for $target and the word /msg into the string. If this is a query window, the $target is the other nick. If this is a channel window, the $target is $chan.

Also, you're trapping ALL inputs, even those which don't contain that word.

Perhaps something like:
var %a /msg & xdcc ssend
if (%a !iswm $1-4) return
msg $2-3 send $5- | halt

It's probably best to refer to yourself as level * instead of 1
Posted By: hos

Re: tter - 14/03/19 03:19 PM

Let me make it clear
a channel declares a new file is available:

NewFile XYZ ( /msg LuckyCharms xdcc send #639 )

Normally I copy the command "/msg LuckyCharms xdcc send #639" and paste it in the channel.
If I want to get the file using secure SSL xdcc then i add a 's' to 'send': "/msg LuckyCharms xdcc ssend #639".

Sometime I forget to add the 'S' and the file download is not secure. I want a script to change 'send' to 'ssend' to automate this.
Posted By: maroon

Re: tter - 14/03/19 04:08 PM

on *:input:*:{
if ($3-4 == xdcc send) { $1-3 ssend $4- | haltdef }
Posted By: hos

Re: tter - 14/03/19 04:17 PM

thanks. the result now is 'ssend send' not 'ssend'
Posted By: maroon

Re: tter - 14/03/19 04:43 PM

sorry a typo, that $4- should have been $5-
Posted By: hos

Re: tter - 14/03/19 04:47 PM

Thanks maroon. I works now
© 2020 mIRC Discussion Forums