mIRC Home    About    Download    Register    News    Help

Print Thread
#203050 05/08/08 08:55 PM
Joined: Sep 2007
Posts: 109
K
kwell Offline OP
Vogon poet
OP Offline
Vogon poet
K
Joined: Sep 2007
Posts: 109
Something like this would be the basis of my trivia...

Code:
alias start {
  msg # question
  .timerhint-1 1 5  hint-1
  .timerhint-2 1 10  hint-2
  .timerhint-3 1 15  hint-3
}
alias hin-1 { 
  unset %stop
  msg # hint
}
alias hin-2 { 
  if (%stop) { halt }
  msg # hint
}
alias hin-3 { 
  if (%stop) { halt }
  msg # hint
  .timerout 1 5  out
}
alias out {
  if (!%stop) { msg # Time out | .timerstart 1 6 start }
  else { msg # Wins nick | .timerstart 1 6 start }
}
on *:TEXT:*:#: { 
  answer ok 
  set %stop $true
  out
}


As could avoid answers out of time ?
How could prevent more than 1 winner?

It will be welcome any kind of opinion
thx

kwell #203060 05/08/08 11:47 PM
Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
1) Your timers are calling hint-1, hint-2 & hint-3, yet your aliases for the hints are hin-, hin-2, & hin-3.. ie: you're missing the t in each of the alias names.

2) There is nothing in the code to store the winning nick (if there is one), also the answer alias is missing so I can't check that.

As to multiple winners, if you store the nick as soon as you can (ie: pass it from the ON TEXT event to the answer alias) only the first nick will be held, depending on the timing of the answers and the lag on the bot.

I often run into that problem with an auction script I run, as people complain that they had a higher bid than the winner before the bot announced that the auction was over. Normally these 'bids' come in during the last second of the auction, but aren't received by the bot until after the auction is over, due to internet lag.


Link Copied to Clipboard