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 }
}
}
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!
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.
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- $+ *) }
}
}
Script works fine.