Truk   -  Feb 13, 2014

Help please: I need a timer that will make an announcement in an IRC chat every 20 minutes. I have a text file with many one line of text (announcements) that I need the script cycle through and post in chat. So at either 0 minutes from start or 20 minutes from start I need line 1 from the text file to display in chat and then at minute 40 line two and then after say 5 or 6 lines in the text file can it start back at line 1. I have tried a timer with the play command but it does not always work properly.


PennyBreed  -  Feb 13, 2014

I assume you're using mIRC. This should work for you.

This alias will play one line at a time from the file. You need to change SomeFile.txt to the path to your text file, and #myChan to your channel.

alias play_announcement {
  var %f = SomeFile.txt
  if (%on_announce == $null || %on_announce > $lines(%f)) { set %on_announce 1 }
  msg #myChan $read(%f,%on_announce)
  inc %on_announce 1

Then just set a timer like this (1200 is the delay, which is 20mins * 60seconds):

/timer.announce 0 1200 play_announcement
Truk  -  Feb 21, 2014

Thanks so much!! This solved the problem.

Sign in to comment

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.