mIRC Home    About    Download    Register    News    Help

Print Thread
#255834 25/11/15 03:53 AM
Joined: Apr 2010
Posts: 969
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
With the addition of parseline, scripts can now handle non-standardized CAP modules, but currently there is no way for scripts to register such capabilities with mIRC's native CAP support. The only workaround is to hijack CAP negotiations via parseline events which comes with its own sort of troubles. I suggest adding event handling for CAP negotiations and possibly a way to alter the list of natively supported CAP modules.


Code:
on *:CAP:LIST|LS|ACK|NAK:matchtext:{}


LIST|LS|ACK|NAK|END
The CAP sub-event to listen for.
Can be a wildcard.


matchtext
For LIST, LS, ACK this is the list of modules the server responded with
For NAK it is the characters that caused the request to fail


$capevent
Returns the CAP sub-event that triggered the event
Only usable from with in the CAP event


/capmodule -x module
Adds the specified module to the list of modules mIRC will request for the current connection CAP negotiations

-x: removes the specified module


$capmodule(module|n)
If the specified module is in the list of CAP modules to request, the module name is returned.
If n is specified, the nth module to in the list is returned.


Example:
Code:
on *:CAP:*:*:{

  ; check if the network is 'somenet'
  ; and the cap event is either LS or LIST
  if ($network == somenet && ($capevent == LS || $capevent == LIST)) {

    ; check if 'ModA' is not in the cap module list
    ; and the server supports ModA
    if (!$capmodule(ModA) && ModA isin $1-) {

      ; add 'ModA' to the list of modules to Request
      capmodule ModA
    }

    ; check if 'ModB' is in the list of modules to request
    if ($capmodule(ModB)) {

      ; remove it from the list
      capmodule -x ModB
    }
  }
}

Last edited by FroggieDaFrog; 25/11/15 05:24 AM.

I am SReject
My Stuff
Joined: Dec 2008
Posts: 1,515
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2008
Posts: 1,515
Very good idea +1.


Need Online mIRC help or an mIRC Scripting Freelancer? -> https://irc.chathub.org <-
Joined: Apr 2010
Posts: 969
F
Hoopy frood
OP Offline
Hoopy frood
F
Joined: Apr 2010
Posts: 969
bump


I am SReject
My Stuff
Joined: Mar 2008
Posts: 93
B
Babel fish
Offline
Babel fish
B
Joined: Mar 2008
Posts: 93
SGTM. Ship it! cool


Link Copied to Clipboard