mIRC Homepage
Posted By: Khaled Simulating nested batches with /parseline - 18/10/18 06:36 PM
The latest beta has IRCv3 nested batch support.

As most servers do not support this feature, /parseline can be used to simulate it in mIRC while connected to a server.

Code:
// simulate server support of these tokens
t {
  parseline -itqp :irc.host CAP * ACK :batch
  parseline -itqp :irc.host CAP * ACK :draft/labeled-response
}

// simple batch events mixed with non-batch events
t10 {
  parseline -itqp :irc.host BATCH +simple
  parseline -itqp @batch=simple :nick!user@host NOTICE $me :Message 4
  parseline -itqp :nick!user@host NOTICE $me :Message 1
  parseline -itqp @batch=simple :nick!user@host NOTICE $me :Message 5
  parseline -itqp :nick!user@host NOTICE $me :Message 2
  parseline -itqp @batch=simple :nick!user@host NOTICE $me :Message 6
  parseline -itqp :nick!user@host NOTICE $me :Message 3
}
t11 {
  parseline -itqp :irc.host BATCH -simple
}

// nested batches
t20 {
  parseline -itqp :irc.host BATCH +outer
  parseline -itqp @batch=outer :irc.host BATCH +inner
  parseline -itqp @batch=outer :nick!user@host NOTICE $me :Message 2
  parseline -itqp @batch=inner :nick!user@host NOTICE $me :Message 1
}
t21 {
  parseline -itqp @batch=outer :irc.host BATCH -inner
}
t22 {
  parseline -itqp :irc.host BATCH -outer
}

// interleaving batches
t30 {
  parseline -itqp :irc.host BATCH +1
  parseline -itqp @batch=1 :nick!user@host NOTICE $me :Message 1
  parseline -itqp :irc.host BATCH +2
  parseline -itqp @batch=2 :nick!user@host NOTICE $me :Message 4
  parseline -itqp @batch=1 :nick!user@host NOTICE $me :Message 2
  parseline -itqp @batch=2 :nick!user@host NOTICE $me :Message 5
  parseline -itqp @batch=1 :nick!user@host NOTICE $me :Message 3
  parseline -itqp @batch=2 :nick!user@host NOTICE $me :Message 6
}
t31 {
  parseline -itqp :irc.host BATCH -2
}
t32 {
  parseline -itqp :irc.host BATCH -1
}
If / when it's possible to augment lines already printed to a channel (etc, non-custom) window, each line would have some sort of behind-the-scenes tagging?

I'm not sure how this feature is beneficial as implemented today. Is there a $line($chan,%i).batch property or anything of the sort?
Posted By: Khaled Re: Simulating nested batches with /parseline - 18/10/18 10:46 PM
This is simply implementing support for IRCv3 nested batches. Its utility is dependent on the type of information that the server wants to provide. There is no difference between a batched event and a normal event. The only difference is that the server is telling the client not to process the batched events until end of batch is received. Once that is received, all the cached lines are processed as normal events.

I have provided the above example /parselines to allow beta-testers to test out the nested batch parsing to make sure it is working correctly.
© mIRC Discussion Forums