mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
it seems like mirc is being a bit too conservative when splitting up lines over multiple messages. i tried a:

Code:
//!raw PRIVMSG $me : $+ $str(a,$calc(511 - $len(: $+ $ial($me) PRIVMSG $me : $+ $crlf)) $+ b


which, assuming $ial($me) is not $null, should send a message of length equal to the maximum that the server is able to send to $me.

trying that on 7.04 will split up the message into 2 separate ones whereas on 6.35, for example, the whole message is received by the target ($me). does that calculation make assumptions that mirc does not and can not, or is mirc indeed too conservative?

second issue is that of splitting up ACTIONs, as in:

Code:
//me $str(a,600)


this will split up the raw message without considering that the original message was an ACTION. it will send \x01ACTION with the first message, and append \x01 to the last. would it not be more desirable to have each message sent as an action?


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Dec 2002
Posts: 344
D
Pan-dimensional mouse
Offline
Pan-dimensional mouse
D
Joined: Dec 2002
Posts: 344
While the line of text you used may work fine on the IRC server you tested it on, there is no guarantee that it will work on a different IRC server running on a different ircd software and/or configured differently. As far as I know, there is no way for mIRC to reliably determine what the character limit is on a server it is connected to, so it makes sense to use a fairly conservative value.

As for the issue with actions, I'd agree that it would be more desirable if each line was encoded properly as an action. Presumably this would also be an issue with CTCPs, although in that case, I would probably suggest that the line should simply be truncated and not split into multiple lines.

I'm actually surprised that mIRC splits lines that are sent via /raw. I would not have expected that to happen, but sure enough it does. I'm curious if this was intentional behavior. It would be nice if a script could use /raw to bypass the character limit if necessary.

Joined: Feb 2006
Posts: 546
J
jaytea Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Feb 2006
Posts: 546
Originally Posted By: drum
While the line of text you used may work fine on the IRC server you tested it on, there is no guarantee that it will work on a different IRC server running on a different ircd software and/or configured differently.


what i used simply assumed the server would send :se!nd@er PRIVMSG recipient :msg\r\n and that the total length of that message could be, at most, 512 characters. quite standard, but i suppose there are other considerations to be made (an IRCx server i tested on, for example, had a much lower line length limit. lower, even, than what mirc sent!). perhaps an option or set of options could be added along with this feature?

and i'm with you entirely on there needing to be a way to bypass this splitting :p also about CTCPs (including DCC requests), it makes more sense to have them sent as before, allowing the server to truncate them as deemed necessary


"The only excuse for making a useless script is that one admires it intensely" - Oscar Wilde
Joined: Dec 2002
Posts: 5,428
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,428
I do not think there is a way of calculating the maximum length of a text message because you have to take into account the length of your nickname and address, as well as the target nickname and address or channel name. These all form part of the server message when a PRIVSMG is sent - the maximum length will depend on all of these combined. So mIRC uses a conservative value for the maximum length, although I expect there are situations where even that may not be conservative enough.

As for CTCP messages, I will make mIRC split CTCP ACTION messages by adding/removing the CTCP ACTION prefix and control codes across multiple lines. I am not sure it would make sense to split other types of CTCP messages though, since they need to be sent as one line of text in order to work anyway. This change should be in the next version.


Link Copied to Clipboard