mIRC Home    About    Download    Register    News    Help

Print Thread
#9579 04/02/03 02:59 AM
Joined: Jan 2003
Posts: 94
S
Sabby Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jan 2003
Posts: 94
Hmmm... for some reason this isnt working... works some times, but sometimes it doesnt...
check it out:

Code:
alias triviaq {
  if (!%:trivia) || (!%:trivia.f) halt
  var %f = $gettok(%:trivia.f,$rand(1, [ $calc(%:trivia.f +1) ] ),160),%l = $rand(1, [ $lines(%f) ] )
  if (%l) set %:trivia.cq %l
  else halt
  echo -a $gettok($read(%f,n,%l),1,160)
}


%:trivia.f is a list of files seperated by $chr(160)
All of the files listed in the variable do not have blank spaces, but for some reason %l isnt set some times..

I added the [ ] just to see if it would help, it didnt.


-
E-Mail: mirc_sabby@hotmail.com
Network: irc.enterthegame.com
Channel: #Helpdesk
#9580 04/02/03 08:30 AM
Joined: Dec 2002
Posts: 1,922
O
Hoopy frood
Offline
Hoopy frood
O
Joined: Dec 2002
Posts: 1,922
I think the $rand part should be:
Code:

$rand(1,$numtok(%:trivia.f,160))


otherwise, it always returns 1, which makes $gettok always return the first file in the list.

#9581 04/02/03 08:58 PM
Joined: Jan 2003
Posts: 94
S
Sabby Offline OP
Babel fish
OP Offline
Babel fish
S
Joined: Jan 2003
Posts: 94
doh thanks smile


-
E-Mail: mirc_sabby@hotmail.com
Network: irc.enterthegame.com
Channel: #Helpdesk

Link Copied to Clipboard