mIRC Home    About    Download    Register    News    Help

Topic Options
#259206 - 16/10/16 10:45 AM (TWITCH) Random message from a text file
Blinakk Offline
Nutrimatic drinks dispenser

Registered: 13/08/16
Posts: 6
Hi, I wanted to make a random quote script that writes a random message that someone ever typed in the channel.

Here is what I did:

on *:text:*:#: {
write logs.txt $nick $+ : $1-
}

on *:text:!rq*:#: {
msg # $read(logs.txt, s, $nick)
}

but it doesn't seem to work.
Thanks for the help!


Edited by Blinakk (16/10/16 11:24 AM)

Top
#259209 - 16/10/16 09:02 PM Re: (TWITCH) Random message from a text file [Re: Blinakk]
keyeslol Offline
Vogon poet

Registered: 15/05/15
Posts: 133
The correct way to read a random line is:

Code:
$read(logs.txt, n)


https://en.wikichip.org/wiki/mirc/text_files#Reading_a_Random_Line
_________________________
twitter @keyeslol

Top
#259219 - 17/10/16 01:06 PM Re: (TWITCH) Random message from a text file [Re: keyeslol]
Blinakk Offline
Nutrimatic drinks dispenser

Registered: 13/08/16
Posts: 6
Done! Thanks!


Edited by Blinakk (17/10/16 03:37 PM)

Top