mIRC Home    About    Download    Register    News    Help

Print Thread
tter #265172
14/03/19 04:44 AM
14/03/19 04:44 AM
Joined: Mar 2019
Posts: 4
H
hos Offline OP
Self-satisified door
hos  Offline OP
Self-satisified door
H

Joined: Mar 2019
Posts: 4
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

Re: tter [Re: hos] #265175
14/03/19 08:10 AM
14/03/19 08:10 AM
Joined: Jan 2004
Posts: 1,158
maroon Offline
Hoopy frood
maroon  Offline
Hoopy frood

Joined: Jan 2004
Posts: 1,158
"/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

Re: tter [Re: hos] #265181
14/03/19 03:19 PM
14/03/19 03:19 PM
Joined: Mar 2019
Posts: 4
H
hos Offline OP
Self-satisified door
hos  Offline OP
Self-satisified door
H

Joined: Mar 2019
Posts: 4
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.

Re: tter [Re: hos] #265183
14/03/19 04:08 PM
14/03/19 04:08 PM
Joined: Jan 2004
Posts: 1,158
maroon Offline
Hoopy frood
maroon  Offline
Hoopy frood

Joined: Jan 2004
Posts: 1,158
on *:input:*:{
if ($3-4 == xdcc send) { $1-3 ssend $4- | haltdef }
}

Re: tter [Re: hos] #265184
14/03/19 04:17 PM
14/03/19 04:17 PM
Joined: Mar 2019
Posts: 4
H
hos Offline OP
Self-satisified door
hos  Offline OP
Self-satisified door
H

Joined: Mar 2019
Posts: 4
thanks. the result now is 'ssend send' not 'ssend'

Re: tter [Re: hos] #265186
14/03/19 04:43 PM
14/03/19 04:43 PM
Joined: Jan 2004
Posts: 1,158
maroon Offline
Hoopy frood
maroon  Offline
Hoopy frood

Joined: Jan 2004
Posts: 1,158
sorry a typo, that $4- should have been $5-

Re: tter [Re: hos] #265187
14/03/19 04:47 PM
14/03/19 04:47 PM
Joined: Mar 2019
Posts: 4
H
hos Offline OP
Self-satisified door
hos  Offline OP
Self-satisified door
H

Joined: Mar 2019
Posts: 4
Thanks maroon. I works now