Well, this isn't complete by any means. There's probably a faster way to do it, but I couldn't really think of one off the top of my head.
alias checkmode {
var %i = 1 , %pos = 1
if ($regex($1,/[beIkl]/)) {
while ($mid($1,%i,1)) {
var %v1 = $v1
if ($istok(+ -,%v1,32)) { var %mode = %v1 }
elseif ((%mode == - && $istokcs(b e I,%v1,32)) || (%mode == + && $istokcs(b e I k l,%v1,32))) {
inc %pos
echo -ag Mode %mode %v1 takes $ $+ %pos which is: $ [ $+ [ %pos ] ]
}
inc %i
}
}
}
You can use it as a basis to do whatever you want, using "on rawmode" with it.
Example:
//checkmode +l+IemiMR-eImib 5 Rand1!*@* Rand2!*@* Rand3!*@* Rand4!*@* Doofus!nightshade@blues.com
(Granted, you don't see two +es in a row ever, since the server will combine them if there is no -'s between them. But that isn't the point, the functionality just needs to be there for it.)
Would give you:
Mode + l takes $2 which is: 5
Mode + I takes $3 which is: Rand1!*@*
Mode + e takes $4 which is: Rand2!*@*
Mode - e takes $5 which is: Rand3!*@*
Mode - I takes $6 which is: Rand4!*@*
Mode - b takes $7 which is: Doofus!nightshade@blues.com