mIRC Home    About    Download    Register    News    Help

Print Thread
#172118 05/03/07 09:20 PM
Joined: Dec 2005
Posts: 22
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Dec 2005
Posts: 22
Someone helped me with a similar request in another thread but im trying to figure htis loop thing out. I want it to that only ops in my channel can type !addmedia text
i.e

!addmedia george bush is short - www.www.com
msg $chan Your Article was submitted.

This info gets stored into a .txt file which then gets played a specific channel. Each line from the txt file being playing every 10 minutes. When it gets to the end of the file i want it to start again like a continued process.

A command like !startmedia to start the playing of the file and !stopmedia would be handy aswell. Any help appreciated.

Last edited by spirit_cro; 05/03/07 09:20 PM.
spirit_cro #172131 06/03/07 02:30 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Try this:

Code:
on *:text:!addmedia *:#: {
  if ($nick isop $chan) {
    write media.txt $2-
  }
  msg $chan Your article was added.
}

on *:text:!startmedia:#: {
  if ($nick isop $chan) {
    .timerPlayMedia 0 600 PlayMedia $chan
  }
}

on *:text:!stopmedia:#: {
  if ($nick isop $chan) {
    .timerPlayMedia off
  }
}

alias PlayMedia {
  if ($me !ison $1) { return }
  inc %PlayMedia.line
  msg $1 $read(media.txt,%PlayMedia.line)
  if (%PlayMedia.line == $lines(media.txt)) {
    unset %PlayMedia.line
  }
}


Note that when you start it, it will not display a media item until the 10 minute mark, and will then display one every 10 minutes after that and will repeat the text file continuously until it's stopped. If you are not in the channel, it will not send the message.


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard