mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2003
Posts: 27
T
TravisK Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2003
Posts: 27
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

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
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.

Joined: Sep 2003
Posts: 27
T
TravisK Offline OP
Ameglian cow
OP Offline
Ameglian cow
T
Joined: Sep 2003
Posts: 27
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


Link Copied to Clipboard