News script

By xelent on Jul 18, 2008

Instructions: Copy/Paste in remote (ALT+R).
News commands;

!add-news [Adds a new news.]
!del-news [Delete news.]
!clear-news [Delete all news / clears the news list.]
!news [Shows you the news list.]

on *:load:{ set %news.num 0 | set %news.channel $$?="Enter your news channel" }
on @*:text:*:%news.channel:{
  if ($nick isop #) {
    if ($1 == !add-news) {
      if ($2) { inc %news.num | .write news.txt $2- | notice $nick Done, add $2- to news list. }
      else { notice $nick Syntax error: Usage: !add-news Line. }
    }
    if ($1 == !del-news) {
      if ($2) {
        if ($2 !isnum) { .notice $nick Syntax error: Usage: !del-news <LINE> }
        elseif ($2 <= %news.num) { .notice $nick Deleted $read(news.txt,$2) from news list. | .write $+(-,d,l,$2) news.txt | dec %news.num }
        else { .notice $nick Line $2 dowsnt exist. }
      }
      else { .notice $nick Syntax error: Usage: !del-news Line }
    }
    if ($1 == !news) { run-news %news.channel }
    if ($1 == !clear-news) { .write -c news.txt | .notice $nick Done, Remove %news.num lines from news list. | set %news.num 0 }
    if ($1 == !commands) { .msg %news.channel (- News-Commands: !news , !add-news , !del-news , !clear-news -) }
  }
}
alias run-news {
  if (%news.num != 0) {
    .mode $1 +m
    .play -a msg $1 news.txt 1
    .timerENEWS $calc(%news.num +2) 1 .mode $1 -m
  }
  else { msg $1 There is no news for now. }
}

Comments

Sign in to comment.
dma   -  Jun 19, 2016

i got got a slight problem here ... weeks ago this was working fine how do i add new news.. it's not doing it.. plz help dma irc.axon.pw #irc

 Respond  
dmarksbarber   -  Nov 19, 2012

But the question is does this run every X amount of seconds?

 Respond  
Jubbyjubbster   -  Mar 30, 2009

it works for me but it could do with a thingy where you can add people as admins for it and only admins can clear the news or delete the news

 Respond  
Jamiie   -  Oct 04, 2008

I doubt it..

 Respond  
Atm0sFeaR   -  Oct 04, 2008

i've tried it on #lenox channel, it works there, but it wont work on mine (on #uic.ut)! (.ut) might be the problem?

 Respond  
Jamiie   -  Oct 04, 2008

I clearly don't understand what your trying to explain Atm0sFeaR

 Respond  
Atm0sFeaR   -  Oct 04, 2008

strange tried one other troughs care this he's working but the own troughs #lenox.ut here lay off possibly the .ut (point) the reason for it?

 Respond  
Atm0sFeaR   -  Oct 04, 2008

ahh Thanks ^^

 Respond  
guest598594   -  Oct 04, 2008
on @*:text:*:%news.channel:{

In on text events, only people other than you can use the commands. If you wanted to use them yourself, you would need an on input or alias.

 Respond  
Atm0sFeaR   -  Oct 04, 2008

:) hihi mountaindew ^^

Thank you Jamiie! but but i dont understand :$ "ON Text" <== where?

 Respond  
guest598594   -  Oct 04, 2008

You can't trigger your own on texts.

Edit: I guess Jamiie beat me to it :P

 Respond  
Jamiie   -  Oct 04, 2008

Atm0sFeaR, being this is an "ON Text" event script, load it into a different mIRC client(ex. a bot) then try the commands from your main mIRC.

 Respond  
Atm0sFeaR   -  Oct 04, 2008

hey guy's ! i follow the insturctions Copy/Paste in remote (ALT+R). ! but dont work :( I typed !commands, !add-news but nothing! I need News script . Please help me

Thank you ^^

 Respond  
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.