mIRC Home    About    Download    Register    News    Help

Print Thread
system voice #232290 29/05/11 10:44 AM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
What would you advise me?

Code:
on *:text:*:#: { 
  if $strip($1-) == $gettok(%questions,2,169) {
    .disable #texto
    .timers off
    correct_answer
    $voice($nick,$chan)    
  }
}

alias voice {
  if !$istok(%voice,$1,32) { 
    set %voice $addtok(%voice,$1,32)
    mode $2 +v $1
  }
}

====================== OR ======================
 
on *:text:*:#: { 
  if $strip($1-) == $gettok(%questions,2,169) {
    .disable #texto
    .timers off
    correct_answer
    if !$istok(%voice,$nick,32) { 
      set %voice $addtok(%voice,$nick,32)
      mode $chan +v $nick
    } 
  }
}

Re: system voice [Re: kwell] #232294 29/05/11 01:10 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
The benefit of using aliases/identifiers is in having them available for use in more than one place without duplicating code, or for easy access to something from the edit line. If you are going to use $voice() somewhere else, then use the alias. If this is the only place you're using it, then there's no reason to have the alias.


Invision Support
#Invision on irc.irchighway.net