mIRC Home    About    Download    Register    News    Help

Topic Options
#263988 - 18/10/18 07:36 PM Simulating nested batches with /parseline
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4297
Loc: London, UK
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
}

Top
#263990 - 18/10/18 11:13 PM Re: Simulating nested batches with /parseline [Re: Khaled]
Raccoon Offline
Hoopy frood

Registered: 18/02/03
Posts: 2504
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?
_________________________
doin´┐Ż things a particle can

Top
#263991 - 18/10/18 11:46 PM Re: Simulating nested batches with /parseline [Re: Raccoon]
Khaled Offline


Planetary brain

Registered: 04/12/02
Posts: 4297
Loc: London, UK
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.

Top