News Bot

By Aucun50 on Dec 30, 2008

This is a news script commands are:
!AddNews (News)
!News (Shows all News)
!DelNews (Word to search for)

Copy and paste in remotes.

on *:TEXT:*:#: {
  if ($nick isop $chan) {
    if (!addnews == $strip($1)) { 
      if (!$2) { .msg $chan Please specify some news for me to add. } 
      if (!$read(News.txt, w, $2- *)) && ($2) { write News.txt News item added by $nick on $fulldate $+ : $2- | .msg $chan News Added. | halt }
      if ($read(News.txt, w, $2- *)) && ($2) { write -dw $+ * $+ $2- $+ * News.txt | write News.txt News item added by $nick on $fulldate $+ : $2- | .msg $chan News Added. | halt }
    }
    if (!delnews == $strip($1)) {
      if ($nick isop $chan) { write -dw $+ * $+ $2 $+ * News.txt | msg $chan News Item Deleted }
      else { msg $chan Your Not Oped }
    }
    if (!oldnews == $strip($1)) { write -c News.txt | msg $chan All News Deleted }
  }
  if (!news == $strip($1)) {
    /play $chan News.txt 
    else { msg $chan Your not oped }
  }
}

Comments

Sign in to comment.
01857131016   -  Jul 28, 2016

love me

 Respond  
dma   -  Mar 02, 2016

wish i can just pull up one at a time it floods

 Respond  
dma   -  Oct 18, 2015

dont wont works any more in 2015

rebel9  -  Oct 23, 2015

Script works fine.

dma  -  Oct 27, 2015

yeah i t was my bad

Sign in to comment

jackster35-1   -  Jan 28, 2010

cool script i recomend making it so only bot owner can add news....

 Respond  
Cazz   -  Jul 22, 2009

You're*

otherwise nice script

 Respond  
TomKat   -  Jun 23, 2009

Sorry... it works fine. My idiocy..

Thanks so much again!

 Respond  
TomKat   -  Jun 23, 2009

This is great, and after modifying it some to work for my purpose, I have it -almost- working great! However, I'm having some struggles with getting to write new news to the text file. This is the modified segment of the code, but I dont think I changed anything important. Sorry I dont know how to insert code into here :(

n17= if (!problems == $strip($1)) {
n18= if (!$2) { .msg $chan Please specify the problem you're having. }
n19= if (!$read(problems.txt, w, $2- )) && ($2) { write problems.txt Problem reported by $nick on $fulldate $+ : $2- | .msg $chan Problem reported. Thank You. | halt }
n20= if ($read(problems.txt, w, $2-
)) && ($2) { write -dw $+ $+ $2- $+ problems.txt | write problems.txt Problem reported by $nick on $fulldate $+ : $2- | .msg $chan Problem reported, Thank You. | halt }
n21= }

Sometimes the user gets a message "Problem reported, Thank You."
I also get "Problem reported by $nick on added to the text file but no data. Some help would be extremely appreciated! And thanks so much to Aucun for PunkTuRed for your work on this!

 Respond  
ch7   -  Mar 31, 2009

This looks great. I could use something similar to this for my bot but to be honest I dont have clue on how to change it.
would be great if you did
!news story
and it would search the document for the word / nick story and post just the information on that one only.

please have a look at what I could do with and see if you can help out. I really think this news bot (with a bit of a tweek) would work well.

http://www.hawkee.com/phpBB2/viewtopic.php?p=91267#91267

 Respond  
PuNkTuReD   -  Mar 30, 2009

no its pretty much channel only

if you would like a re-write, just say so and im sure Aucun will slap one together for ya tho

 Respond  
Abtehi   -  Mar 30, 2009

can i query the bot and add the news there instead of using the main?

 Respond  
PATX   -  Mar 13, 2009

useless really.... could just use a factoid script eg patxbot.tk or others.

 Respond  
undertaker28   -  Jan 26, 2009

champion tnx so much :-)

 Respond  
Aucun50   -  Jan 26, 2009

Fixed, thank you for pointing that out

 Respond  
undertaker28   -  Jan 26, 2009

cant get it to read all the news only reads the 1st lineof the news

 Respond  
PuNkTuReD   -  Dec 30, 2008

just do you know i didnt test the !oldnews
write -c News.txt

 Respond  
Aucun50   -  Dec 30, 2008

The update was done 99% by PunkTuReD
And 1% from me copying it and pasting it :)

 Respond  
PuNkTuReD   -  Dec 30, 2008

rewrite

on *:TEXT:*:#: {
  if ($nick isop $chan) {
    if (!addnews == $strip($1)) { 
      if (!$2) { .msg $chan Please specify some news for me to add. } 
      if (!$read(News.txt, w, $2- *)) && ($2) { write News.txt News item added by $nick on $fulldate $+ : $2- | .msg $chan News Added. | halt }
      if ($read(News.txt, w, $2- *)) && ($2) { write -dw $+ * $+ $2- $+ * News.txt | write News.txt News item added by $nick on $fulldate $+ : $2- | .msg $chan News Added. | halt }
    }
    if (!delnews == $strip($1)) {
      if ($nick isop $chan) { write -dw $+ * $+ $2 $+ * News.txt | msg $chan News Item Deleted }
      else { msg $chan Your Not Oped }
    }
    if (!oldnews == $strip($1)) { write -c News.txt | msg $chan All News Deleted }
  }
  if (!news == $strip($1)) {
    if (!$read(News.txt.txt, w,* $+ $2- $+ *)) { haltdef }
    if ($read(News.txt, w,* $+ $2- $+ *)) { .msg $chan $read(News.txt, w,* $+ $2- $+ *) }
  } 
}
 Respond  
Aucun50   -  Dec 30, 2008

Update coming soon.

 Respond  
PuNkTuReD   -  Dec 30, 2008

you should point out that when using
!DelNews (Word to search for)

the word they are searching for needs to be the first word in the news

s scan for a line beginning with this word
w scan for a line containing this wildcard

if you change to w

make it

write -dw $+ $+ $2- $+ textfile.txt

6 from me

 Respond  
slacker   -  Dec 30, 2008

hmm by ur title i thought this was a real news bot that shows headline news storys. =/
anyways maybe add some flood pros to it.

 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.