mIRC Home    About    Download    Register    News    Help

Print Thread
#187877 14/10/07 03:56 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
Example 1
Code:
on *:JOIN:%channel: { 
  if ($nick = %top1winr) || ($nick = %top2winr) || ($nick = %top3winr) || ($nick = %top4winr) || ($nick = %top5winr) || ($nick = %top6winr) || ($nick = %top7winr) || ($nick = %top8winr) || ($nick = %top9winr) || ($nick = %top10winr) {
    .mode %channel +v $nick 
  }
}


or Example 2
Code:
on *:JOIN:%channel: { 
  var %i 1
  while (%i <= 10) {
    if ($nick = %top $+ %i $+ winr) { .mode %channel +v $nick | return }
    inc %i
  }
}


Thanks

Last edited by kwell; 14/10/07 03:56 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Ideally you'd change your script a bit and use hidden option number 3:

Code:
on *:JOIN:%channel: { 
  if ($istok(%topwinrs, $nick, 32)) .mode %channel +v $nick
}


...where %topwinrs is a variable containing each nickname separated by a space.

If for some reason you can't or don't want to change the rest of your script to store the nicknames that way, I'd use the while loop method. I don't know if it's faster but it's definitely less ugly.


Spelling mistakes, grammatical errors, and stupid comments are intentional.
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
thanks schaefer31
One question, as you can shorten this code ?

Code:
if (á isin $gettok(%trivias.temp,2,42)) || (é isin $gettok(%trivias.temp,2,42)) || (í isin $gettok(%trivias.temp,2,42)) || (ó isin $gettok(%trivias.temp,2,42)) || (ú isin $gettok(%trivias.temp,2,42)) || (Á isin $gettok(%trivias.temp,2,42)) || (É isin $gettok(%trivias.temp,2,42)) || (Í isin $gettok(%trivias.temp,2,42)) || (Ó isin $gettok(%trivias.temp,2,42)) || (Ú isin $gettok(%trivias.temp,2,42)) { set %accent Response with accent } | else { unset %accent } 

Last edited by kwell; 14/10/07 07:25 PM.
Joined: Dec 2002
Posts: 2,962
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 2,962
Code:
if ($count($gettok(%trivias.temp,2,42), á, é, í, ó, ú, Á, É, Í, Ó, Ú) { set %accent Response with accent }
else { unset %accent }


Spelling mistakes, grammatical errors, and stupid comments are intentional.

Link Copied to Clipboard