mIRC Homepage
Posted By: TravisK yes it looks like crap but works to a point - 16/03/12 08:07 PM
http://pastebin.com/xH8wESx3

line 9 echos (debug line) the correct variable but it doesn't get unset. wtf is the deal. been over 8 years since i scripted and yes it looks like poop. definitely could be done better and Ive done better in the past but forgot how.

just would like to know how to and why the variable isn't getting unset when it reaches 0 or less
Code:
on @*:join:#: {
  var %x = $var(rkick. $+ # $+ .*)
  while (%x) {
    var %knick = $gettok($var(rkick. $+ # $+ .*,%x),3,46)
    var %z = $var(rkick. $+ # $+ .*,%x).value
    if (%knick ison #) {
      kick # %knick revenge kick thx $calc(%z - 1) more
      if (%z <= 1) { unset [ $var(rkick. $+ # $+ .*,%x) ] }
      else { dec $var(rkick. $+ # $+ .*,%x) }
    }
    dec %x
  }
}

It looks like the unset parameter needs to begin with %, so pre-evaluate the $var with [ ]. Your count was also off by one, so I fixed that. And you cannot be an op at the moment you join, so your first check was redundant - just prefix the event with @ to make sure you're op.
cool thx like i said its been awhile.
Was thinking the ($nick != $me)) would take care of the rest of the script not running if i triggered the event.

and looks like @ after on takes care of it only triggering if im op, forgot all about that.


again, thanks a lot
© mIRC Discussion Forums