mIRC Home    About    Download    Register    News    Help

Print Thread
#243612 03/12/13 11:20 PM
Joined: Nov 2013
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2013
Posts: 19
Is there a way i can setup a script so that it randomizes what text it says?

i have a script on my bot that plays a text every 1800 seconds
But i want to know if it can, play a different text every 1800 seconds without me having too make another script.

this is my current script
on *:TEXT:!followon:#: {
if ($nick isop #) {
.timerLinks 0 1800 msg # If you are enjoying the stream make sure to follow
}
}

Can somebody please help me ? Thanks smile

Joined: Jan 2004
Posts: 1,358
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Jan 2004
Posts: 1,358
$!read(file.txt,n) will read a random line of text from your file.

Joined: Nov 2013
Posts: 19
D
Pikka bird
OP Offline
Pikka bird
D
Joined: Nov 2013
Posts: 19
So in the script how would i set that up?
Sorry i am a noob too this

Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Make a text file in your mIRC dir (type "/run ." to open the mIRC dir) with each message on a separate line (with NO blank lines).
Change "filename.txt" in this code to whatever you named the file.
Code:
on *:TEXT:!followon:#:{
  if ($nick isop #) {
    .timerLinks 0 1800 msg # $!read(filename.txt,n)
    .timerLinks -e
  }
}

The second 'timerLinks' line above executes the timer immediately, so you see the first message right away. If you don't want that to happen, delete that 2nd line.


Link Copied to Clipboard