News Script

By Trav on May 28, 2007

Ok this script is very simple all you do is type
!post {newshere}

And it'll set what you replace {newshere} with as %news

Then when someone types !news
It'll say what you set for %news :D

Also only you can do it :D

on *:text:!news:#: {
  msg $chan News: %news 
}

on *:text:!post*:#: {
  if ( $nick ==  YOURNICKNAMEHERE ) {
    set %news $2- < Posted by $nick >
  }

Comments

Sign in to comment.
N1nja   -  Nov 11, 2010

Thanks, slowly getting it

 Respond  
Jethro   -  Nov 09, 2010

N1nja, I hope my example will serve you good for a reference:> *on $:text:/^!(news|post)\b/iS:#:{
; the above line is regex, which will match both the commands !news and !post respectively. The caret sign (^) will make sure the commands start with an exclamation mark, and the \b character will make sure the commands end with !news and !post; no more or less.
if (!%p) {
inc -u3 %p
; this is a trigger protection that will initiate the command every 3 seconds.
[b]if ($regml(1) == news) {
.msg # $iif(%news,News: $v1,No News is available yet!)
}[/b]
; if the command is !new, it'll message every one the latest news to the current channel; if not, it'll say otherwise.
[b]elseif (!$2) && ($nick == YourNickHere) {
.msg # $nick $+ , incorrect syntax: !post YourNewsHere
}[/b]
; if the allowed person enters the command !post without the news, it'll tell him or her how to enter it correctly.
[b]elseif ($nick == YourNickHere) {
set %news $2- < Posted by $nick >)
.msg # $nick $+ , the news has been set successfully!
}[/b]
; if the parameter has been set correctly, the command was a success.
[b]elseif ($nick != YourNickHere) {
.msg # $nick Access denied!
}[/b]
; If other disallowed users attempt to post a news, he or she will get told access denied.
}
}**

 Respond  
N1nja   -  Nov 09, 2010

Because i just needed to make a small announcement script that doesn't need more than one entry at a time. I'm very new to this so it helped me understand a few things due to it being straight forward

 Respond  
Jethro   -  Nov 09, 2010

The snippet is not well scripted. It's lacking a number of checks and the %news can only store one info at a time. It can be overwritten by another news anytime before or after it's posted. I wonder why you'd find such a snippet for reference.

 Respond  
N1nja   -  Nov 09, 2010

This helped me with a function i been working on for a few days, shot dude

FYI: Your missing the closing bracket :)

 Respond  
Zeroodemon   -  May 31, 2007

Yeah, cool idea though.

 Respond  
Chevy   -  May 29, 2007

That will only hold one News:
And you can make it to hold more.
Also:Your Trigger Command !News Members Will Be Able To Flood You With That Command So Why Not Make A Halting On It So $nick will only be able to hit once. And....The !Post For if ( $nick == YOURNICKNAMEHERE ) { Will Not Work Properly Being A ! Command Start So Why Not Make It /Post So It Will Read Correctly And Also Be Able To Pick Up $nick In The Message.

But Its not bad...Just Work On It Some.

 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.