Top

Mode flatlist.


mIRC Code
+ 0 likes
Please Register to submit score.
Bookmark and Share
Average Score  0.0 (of 0 scores)
Date Added  Aug 26, 2009
Last Updated  Aug 26, 2009
Tags  flatlist  mode  parser 

Introduction

This uses and manipulates a mode string, and returns a flatlist, for easier parsing, so for example:

+ooo-v+b moo1 moo2 moo3 moo4 *!*@quakenet.org

would return:

+o moo1 +o moo2 +o moo3 -v moo4 +b *!*@quakenet.org

Grab the Code

alias flatlist { 
  var %mode = $gettok($1-,1,32), %params = $gettok($1-,2-,32),%x = 1,%y = 1,%m = 0, %p = 1,%result,%sign = +
  while ($mid(%mode,%x,1)) { 
    var %d = $ifmatch
    if (%d == -) { var %m = 1 | var %sign = - }
    elseif (%d == +) { var %p = 1 | var %sign = + }
    if ($istok(o v b k l,%d,32)) && (!$istok(+ -,%d,32)) { 
      if (%m == 1) { inc %y | var %result = %result $+(%sign,%d) $gettok($1-,%y,32) }
      elseif (%p == 1) { inc %y | var %result = %result $+(%sign,%d) $gettok($1-,%y,32) }
    }
    inc %x
  }
  !return %result
}

Comments

  (0)  RSS

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom