mIRC Home    About    Download    Register    News    Help

Print Thread
(TWITCH) Random message from a text file #259206 16/10/16 09:45 AM
Joined: Aug 2016
Posts: 6
B
Blinakk Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Aug 2016
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!

Last edited by Blinakk; 16/10/16 10:24 AM.
Re: (TWITCH) Random message from a text file [Re: Blinakk] #259209 16/10/16 08:02 PM
Joined: May 2015
Posts: 133
K
keyeslol Offline
Vogon poet
Offline
Vogon poet
K
Joined: May 2015
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
Re: (TWITCH) Random message from a text file [Re: keyeslol] #259219 17/10/16 12:06 PM
Joined: Aug 2016
Posts: 6
B
Blinakk Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Aug 2016
Posts: 6
Done! Thanks!

Last edited by Blinakk; 17/10/16 02:37 PM.