mIRC Home    About    Download    Register    News    Help

Print Thread
#201631 01/07/08 05:19 PM
Joined: Feb 2006
Posts: 22
B
BIGZIPZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Feb 2006
Posts: 22
Code:
alias /pay_high {
  set %NumberOfLines $lines("C:\Program Files\mIRC_ComicQuiz\HiLo_HighBet.txt")
  var %j = 1
  while (%j <= %NumberOfLines) {
    msg #BIGZIPZ Winner: $read("C:\Program Files\mIRC_ComicQuiz\HiLo_HighBet.txt"),%j)
    inc %j
  }
}


The preceding code is from a simple Higher or Lower game I made, and is part of the code which triggers when the outcome is Higher. As I understand it $read(filename,1) would read line 1, etc etc. Yet with my code it reads a random line even though I specify %j which is a number.

$read("C:\Program Files\mIRC_ComicQuiz\HiLo_HighBet.txt"),%j)

Am I using the syntax incorrectly? Thanks alot

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
remove the ) between the file name and the , separating the %j parameter.

Btw: looking at your code, a better way to do this is to use mIRC's /play command, as the way you're doing it will probably flood you off of the network, as the /play command has a built in delay

Also you don't need the / in the alias name.

Code:
alias pay_high {
  .msg #BIGZIPZ Winners:
  .play "C:\Program Files\mIRC_ComicQuiz\HiLo_HighBet.txt"
}

If you really want the word Winner in front of each line, then I suggest you change the msg line in your code to read
Code:
.timer 1 %j msg #BIGZIPZ Winner: $read("C:\Program Files\mIRC_ComicQuiz\HiLo_HighBet.txt",%j)

Joined: Feb 2006
Posts: 22
B
BIGZIPZ Offline OP
Ameglian cow
OP Offline
Ameglian cow
B
Joined: Feb 2006
Posts: 22
Thank you very much for your help it has helped alot.


Link Copied to Clipboard