Originally Posted By: JB_uk
Hi there, I'm just stuck working out how to start and alias after a timer expires. The alias itself is working fine but I'm trying to get it to start after a timer has finished. Shown below.
Code:
on *:text:!test:#: {
  timer.PlayerNo 1 125 msg # $lines(Name.txt) people are taking part.
  timer.Time 1 150 /howmany
}


alias HowMany {
  if ($lines(Name.txt) == 1) goto oneplayer
  elseif ($lines(Name.txt) == 2) goto twoplayers
  elseif ($lines(Name.txt) == 3) goto threeplayers
  elseif ($lines(Name.txt) == 4) goto fourplayers
  elseif ($lines(Name.txt) == 5) goto fiveplayers
  elseif ($lines(Name.txt) == 6) goto sixplayers
  :oneplayer
  msg # There is One Player in the game.
  :twoplayers
  msg # There are Two Players in the game.
  :threeplayers
  msg # There are Three Players in the game.
  :fourplayers
  msg # There are Four Players in the game.
  :fiveplayers
  msg # There are Five Players in the game.
  :sixplayers
  msg # There are Six Players in the game.
}

I'm just wondering if there is another way for me to put an alias after a short stop ie a timer.

Cheers

timer.Time 1 150 howmany CHANNELNAME <--You'll have to pass this information to the alias via $chan or via some other method.


msg $1 There are Six Players in the game. <--we use the 1st source of information passed to the alias which was the channel name.


if ($lines(Name.txt) == 1) { msg $1 There is One Player in the game. } <--No need for gratuitous use of gotos.