mIRC Home    About    Download    Register    News    Help

Print Thread
yes it looks like crap but works to a point #236670 16/03/12 08:07 PM
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

Re: yes it looks like crap but works to a point [Re: TravisK] #236671 16/03/12 08:52 PM
Joined: Jan 2004
Posts: 1,317
L
Loki12583 Offline
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,317
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.

Re: yes it looks like crap but works to a point [Re: Loki12583] #236673 16/03/12 09:09 PM
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