Spanky commented on a Page, !rules (add/del/list)  -  Apr 01, 2009

iv sorta got it working :/ its not perfect but still..


alias loc return $iif($chan,$v1,$nick)

on $*:text:/^!rules\b/Si:*:{
  tokenize 32 $strip($1-)
  if ($2 == add) && ($nick isop $chan) {
    inc %rules
    if ($3) {
      writeini rules.ini $chan %rules $3- Added by $nick
      msg $chan 4" $+ $3- $+ " Added as a rule by $nick $+ .
    }
  }
  if ($2 == del) && ($nick isop $chan) {
    if ($3) {
      if ($readini(rules.ini,$chan,$3)) {
        remini rules.ini $chan $3- Added By $nick
        .msg $chan 4Removed $3- from rules list.
        dec %rules
      }
    }
    else {
      msg $chan 4No such Rule entry.
      .notice $nick 4To see the list of Rule List Entries, type !Rules <list>
    }
  }
  if ($2 == list) && ($ini(rules.ini,$chan,0)) {
    .msg $loc 4Displaying A List Of Rules For $loc $+ :
    var %a 1, %z $ini(Rules.ini,$chan,0)
    while (%a <= %z) {
      .msg $loc 04 $+ $ini(rules.ini,$chan,%a) $readini(rules.ini,$chan,$ini(rules.ini,$chan,%a))
      inc %a
    }
    .msg $chan 4End of list. %z entry(s) displayed.
  }
  elseif ($2 == list) && (!$ini(rules.ini,$chan,0)) {
    .msg $loc 04Sorry $nick $+ , there are currently no rules for $chan $+ .
  }
}

i know its not "perfect" but it works.. :)

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.