Top

Announce Script

Please Register to submit score.
Average Score  5.0
Scores Submitted  1
Date Added  Sep 14, 2007
Last Updated  Sep 14, 2007
Tags  announce  chan  irc  lavamike  mirc  stuff 

Introduction

Some Setup Required (You should know what your doing...)

If you type !a <text> it sets <text> in the announce, to view announcements type !announce and it supports multiple announcements...to delete announcements i didnt include because it's buggy...if you know what your doing you shouldn't have a problom...

Grab the Code

Comments

  (7)  RSS
xDaeMoN
Comments: 696
 
mIRC Snippet:  Announce Script
Posted on Sep 14, 2007 11:22 am
You can combine these 2 On Text events in 1 remote file, just make sure that you put the 2nd event (with the !announce) before the other.

Or better yet, combine them into just 1 On text event. Then use $level to determine the level of the user.

GL =)
lavamike
Comments: 1
 
mIRC Snippet:  Announce Script
Posted on Sep 14, 2007 11:40 am
Thanks, Edited.
simplicity
Comments: 17
 
mIRC Snippet:  Announce Script
Posted on Sep 14, 2007 3:09 pm
This is moderate. There are a few errors I found though.

1. $read(A.txt) will return a random line from your announcements. Try using this code:

Code:

var %x = 1
while (%x <= $lines(A.txt)) {
 ; This line returns if the total number of lines in a text is more than 1
 .timer 1 2 msg $chan $read(A.txt,%x) | inc %x
 ; This line broadcasts to the channel the announcements with a timer. This is to prevent flooding. The $read(A.txt,%x) reads a specific line in the text. The %x varaible will add 1 to its current number each time. And until the events ends, it will keep on msging the channel with the %x line in the txt file.
}


Remove the ; comments if you end up using the code. I just wanted to explain what everything does. ;)

2. There needs to be a space between the $read and the closing bracket.

3. Remove the /'s (not really an error). It's better coding that way. ;)

Other then that, nice idea. I recommend you add a feature to remove a specific line of text from the txt file.
napa182
Comments: 742
 
mIRC Snippet:  Announce Script
Posted on Sep 14, 2007 6:16 pm
or you can just do it this way but it's up too you...
Code:
on *:text:*:#: {
  if (($nick isop #) || ($nick ishop #)) {
    if (($1 == !announce) && (!$2)) {
      msg $chan Please select a announcement number 1 - $lines(A.txt)
    }
    elseif (($1 == !announce) && ($read(A.txt, n) == $null)) {
      msg $chan There Are No Announcement's At This Time.
    }
    elseif (($1 == !announce) && ($read(A.txt, n, $2) == $null)) {
      msg $chan Sorry $nick But That Announcement Number Does Not Exist. Please Pick A Announcement Number (1 -  $lines(A.txt) $+ )
    }
    elseif ($1 == !announce) {
      msg $chan Reading Announcement $2 of $lines(A.txt) $+ : $read(A.txt, n, $2)
    }
    elseif ($1 == !a) {
      write A.txt $2- 
      msg $chan Announcement:  $2- Has Been Added! As Announcement Number $lines(A.txt)
    }
    elseif ($1 == !dela) {
      msg $chan Deleteing Announcement Number $2 $+ : Of $read(A.txt, n, $2)
      write -dl $+ $2 A.txt
    }
    elseif (($1 == !counta) && ($lines(A.txt) == 0)) {
      msg $chan There Are No Announcement's To Count.
    }
    elseif ($1 == !counta) {
      msg $chan $nick I Have A Total Of $lines(A.txt) Announcement's So Far.
    }
  }
}

mountaindew
Comments: 1,380
 
mIRC Snippet:  Announce Script
Posted on Sep 16, 2007 6:21 pm
Code:
on *:TEXT:!announce:#:{
  var %annouce = 1
  while (%announce <= $lines(a.txt) {
    msg $chan 4The Announcement %announce $+ :3 $read(A.txt) | inc %announce
  }
}


that can read all the announcements
napa182
Comments: 742
 
mIRC Snippet:  Announce Script
Posted on Sep 16, 2007 6:31 pm
eh why flood the channel thats if there are 10+ announcements
mountaindew
Comments: 1,380
 
mIRC Snippet:  Announce Script
Posted on Sep 16, 2007 6:48 pm
well if theyre announcements, they must be important :P

Please Register or Login to start posting comments.
Bottom