mIRC Home    About    Download    Register    News    Help

Print Thread
#156804 20/08/06 12:33 PM
Joined: Aug 2006
Posts: 4
L
L0j1k Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Aug 2006
Posts: 4
How do I get mIRC to put non-standard (i.e. control codes other than bold, italic, etc) into raw commands? For instance, if I wanted to generate a raw CTCP command, how would I go about having mIRC insert \001 into the command?

Thanks for any helpful replies beforehand! smile

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
$chr(1)

Joined: Aug 2006
Posts: 4
L
L0j1k Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Aug 2006
Posts: 4
So if in order to send a raw ctcpreply ping command, I would send something like this:

/RAW :flim!flim@flim.com NOTICE flim2 :$chr(1)PING 0$chr(1)

Or am I way off base? The construction of my CTCPREPLY command in raw form is correct, except for the $chr(1) part, which needs to be ^A or \001 or however you wish to put it.

Thanks again for the help ahead of time! smile

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Quote:
So if in order to send a raw ctcpreply ping command, I would send something like this:

/RAW :flim!flim@flim.com NOTICE flim2 :$chr(1)PING 0$chr(1)

Or am I way off base? The construction of my CTCPREPLY command in raw form is correct, except for the $chr(1) part, which needs to be ^A or \001 or however you wish to put it.

Thanks again for the help ahead of time! smile


Not quite. You can't attach any text to an $identifier, so instead of

$chr(1)PING 0$chr(1)

you use

: $+ $chr(1) $+ PING 0 $+ $chr(1)

You will also need to halt the original message if you wish to replace with your own, and make certain other scripts don't reply to the event, ie:

on ^*:CTCPREPLY:PING *:{
your reply here
halt
}

Joined: Aug 2006
Posts: 4
L
L0j1k Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Aug 2006
Posts: 4
OK. smile I've been trying variations on your suggestion (which I'm sure is based on a good amount of working knowledge). However, when sending my /RAW command, it seems that mIRC wants to ignore my attempt to convert the \001 into it's appropriate control code.

For instance, the following command works in that it is appropriately converted to it's control code:

//echo $chr(1)

The next command does not work:

/RAW flim!flim@flim.com NOTICE flim2 : $+ $chr(1) $+ PING 0 $+ $chr(1)

Well, I should say that it *works*, except that in my debug window, the raw traffic sent to the server treats the $+ and $chr(1) as literal strings, instead of mIRC interpreting these as they "should" be. As in the converted control code (which appears as a little square -- unprintable character).

Any ideas? Thanks again! and I appreciate your taking time to help me smile

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
/raw stuff
treats everything as literal
//raw stuff
changes %variables and $identifiers to their values

You only need the / or // at the commandline, commands inside scripts don't need either. You may also find that you need to send to their nick not to the nic!userid@host, ie:

//raw privmsg nick : $+ $chr(1) $+ PING $calc($ctime -86400) $+ $chr(1)

If you're not already doing it, you can put an "echo -s $nick $rawmsg" inside some of the events to see the actual message formats that are used.

Joined: Aug 2006
Posts: 4
L
L0j1k Offline OP
Self-satisified door
OP Offline
Self-satisified door
L
Joined: Aug 2006
Posts: 4
Excellent! smile This is what I had surmised in a roundabout way while playing with the //echo command in the meantime, although I like what you said better than what I was thinking.

I've now gotten my command constructs to work splendidly. Thanks again for your help! smile


Link Copied to Clipboard