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?
thanks
"/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
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.
on *:input:*:{
if ($3-4 == xdcc send) { $1-3 ssend $4- | haltdef }
}
thanks. the result now is 'ssend send' not 'ssend'
sorry a typo, that $4- should have been $5-
Thanks maroon. I works now