I think this is what you are looking for:
on *:TEXT:!addnews *:*:{
var %limit = 8
;
write news.txt $2-
while ($lines(news.txt) > %limit) { write -dl1 news.txt }
.notice $nick Added news item
}
on *:TEXT:!shownews:*:{
.notice $nick News Headlines (oldest items first)
.play -n $nick news.txt 500
}
Usage:
!addnews news item here
!shownews
To change the number of items that are maintained, change the limit number on line 2 (var %limit = 8).
-genius_at_work