mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2020
Posts: 8
A
armyn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2020
Posts: 8
Hi

Here is my code before the explanation:

Code
alias initialize_coloring {
  ; reset all entries in the clist
  var %compteur = 4
  while (%compteur <= $cnick(0,1)) {
    echo -a %compteur $cnick(%compteur)
    .cnick -r $cnick(%compteur)
    Inc %compteur 1
  }
}


I have the impression that this code it does not delete all entries cnick, probably because there are rows that no longer exist, so it does not delete everything.
Do you know how to do a while that reads not from beginning to end but rather from end to beginning? (reverse)

Cdt

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
Just keep removing the first entry

Code
while ($cnick(1)) { .cnick -r 1 }

Joined: Jan 2020
Posts: 8
A
armyn Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
A
Joined: Jan 2020
Posts: 8
It seems to be solved with this code.
It erases all cnicks except the first 3 (@, %, +v)

Code
alias initialize_coloring {
  ; reset all entries in the clist
  var %compteur = $cnick(0,1)
  while (%compteur > 3) {
    ;echo -a %compteur $cnick(%compteur)
    .uncolor_nick $cnick(%compteur)
    dec %compteur 1
  }
}

Joined: Jul 2006
Posts: 4,149
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,149
Why is your counter starting at 4?

Code
alias initialize_coloring {
 var %compteur $cnick(0,1)
 while (%compteur > 4) {
    echo -a %compteur $cnick(%compteur)
    .cnick -r $cnick(%compteur)
    dec %compteur
  }
}


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard