AutoOp

By DragonFlare on Oct 28, 2010

I made this as a guide for someone on the Forums and decided i'd post it.

Alias aop {
  if ($1 == On) { set %aop On | echo -a Aop is Now On. }
  else { if ($1 == Off) { set %aop Off | echo -a Aop is now Off.  }
  }
}
on *:JOIN:#:{
  var %autochan #channel1,#channel2,#channel3,#channel4
  var %HaltNick Nick1,Nick2,Nick3,Nick4
  if ($chan isin %autochan && %aop == On) { 
    if ($nick isin %HaltNick) { halt }  
    if ($me isop $chan) { mode $chan +o $nick }
    else { if (%aop == Off) { Halt } 
    }
  }
}

Comments

Sign in to comment.
Jethro   -  Nov 15, 2010

I still think it's morally wrong to spread the bad coding habits. We want to learn MSL the right, efficient way...not just some self-made redundancy put into a snippet expecting it to work for Pete's sake.

 Respond  
Gummo   -  Nov 14, 2010

I'm not actually sure what your response to me was supposed to mean, but there's no need to get defensive. It's just unused code.

 Respond  
DragonFlare   -  Nov 14, 2010

Why would i delete a comment i'm speaking the truth and you all have a right to your opinion. And btw it's not bad scripting if it works as you said "Fool."

This part of the code seems pointless, also:
Code:
else { if (%aop == Off) { Halt }
}

Of course it would have to reach that point if it was on there would be no need for it if the script was always on why shut it off if it's already off Now that is pointless lol

Did you ever think i wanted it that way?
And you are right about it being a Learning site but i did not post this to learn i posted it for others and if they want to alter it good for them go for it but otherwise it stays the same.

It works and it does what it is supposed to so why change it and the code isn't "Bad" If it works so don't even say that lol Give me 2 other reasons and no BS Reasons either.

 Respond  
Jethro   -  Nov 12, 2010

At least he's considerate enough not to delete a comment thus far.

 Respond  
Gummo   -  Nov 12, 2010

I'd rather help anyone who happens to stumble across this snippet. At this rate of comments, that's highly likely.

 Respond  
Jethro   -  Nov 12, 2010

But how can you help him when he doesn't want to be helped? Perhaps you should say to him, "help me help you?" lol

 Respond  
Gummo   -  Nov 12, 2010

You fool! Assuming I only want to help him! ;)

 Respond  
Jethro   -  Nov 11, 2010

Gummo, he's not gonna budge on nor heed your helpful suggestion. He's as stubborn as a mule. I hope your time has been worthwhile though...

 Respond  
Gummo   -  Nov 11, 2010

I found the thread he posted this script in.. It was supposed to op everyone except one person (multiple people in this version) but the fact that he didn't specify anything other than "AutoOp" in this script combined with the fact that it has a list of nicknames is misleading. Anyone glancing at this might assume that it's a list of people they want to op.
This part of the code seems pointless, also:

else { if (%aop == Off) { Halt } 
}

Especially since %aop has to be on for it to reach that point.

Another note script-wise, the isin operator should not be used unless you truly know that you want that functionality.
Given a nickname list "bobby,dude,someguy" if "bob" comes online you won't op him because "bob" is in "bobby,dude,someguy".
A better conditional is if ($istok(%HaltNick,$nick,44))
That checks to see if the nickname is equal to any of the tokens between commas, as it should.

if ($chan isin %autochan && %aop == On)

Can be changed in a similar fashion to

if ($istok(%autochan,$chan,44) && %aop == On)
 Respond  
napa182   -  Nov 11, 2010

Jethro_ Said:

Watch out, napa. He's gonna bite you back and chew you up from behind. lol
lol prob will.. They must like the taste of ass..

 Respond  
Jethro   -  Nov 10, 2010

Watch out, napa. He's gonna bite you back and chew you up from behind. lol

 Respond  
napa182   -  Nov 10, 2010

lmao point in sharing ur snippet is to get comments to make it better. Just as it says when you post a snippet
These snippets abide by the Open Source Initiative (OSI) and are considered Open Source. Users can read, redistribute, and modify the source code you submit. This allows people to improve, adapt and evolove your code into something stronger and better. We encourage improvements as much as originality here at Hawkee. Always cite your original source by its URL.

So don't get bent when others make a comment
on a side note it doesn't say it's a pastebin either but rather an
Technology social network hence a place to share talk about an learn.

It's NOT that people take Hawkee to seriously, but rather they don't want to see the site get loaded with trash from people that post just to post.

DragonFlare ur opinion of " If it's not Broken why fix it " is kinda lame. In ur description you said " I made this as a guide for someone on the Forums and decided i'd post it " . The problem with that is you made ur code so inefficient in other words not a good snippet to learn from. All you are going to do is show others bad scripting habits.
Ohwell

 Respond  
Jethro   -  Nov 10, 2010

Knock yourself out, buddy.

 Respond  
DragonFlare   -  Nov 10, 2010

There we go again that is your opinion lol
It may not be Wise but it is useful lol
Every Script is useful
Just like if you posted a script i could find some reason it isn't useful
First off you are saying it isn't wise or useful when you don't even know what the script was made for The script works and it does what it was Requested to do
Again we go back to "People" Wanting others to Script like them
And if you must know this Site was made For "People to post other scripts for people" No where in the rules of the site does it say anything about people not being able to post a script for someone When it comes down to it this is just like a pastebin site Why did you post your scripts on here? For decorations? No you posted them on here so other people can use them look at that a pastebin Pfft people take Hawkee to seriously it's pathetic.

 Respond  
Jethro   -  Nov 10, 2010

Your notion of "If it ain't broke, don't fix it" doesn't apply to the general public, where your posted snippet doesn't quite fit the bill of its usefulness.

If your script was originally made for one particular person, you'd have to make sure you have another version that's gonna benefit the public use.

Giving people +o, excluding those on the list as per your snippet, easily is just not a wise practice.

This goes back to the question, "why do people keep treating Hawkee as a personal pastebin?"

 Respond  
DragonFlare   -  Nov 10, 2010

Gummo

I'd just like to point out the fact that when you said that code above was good code, Jethro_, it will actually op everyone who is NOT on the list when aop is enabled..

That's correct.

The code is scripted like that because of a Request from another server i am on.
I have no need to update it because it matches the specifications of the person who Requested it.
In other words "Don't fix what isn't broken."
And no i did not get %HaltNick form another script.

If it's not Broken why fix it because you want it to look like your scripting?
That's basically what you are saying.
See i like my Codes to be different from others.

WorldDMT how have you been?

 Respond  
WorldDMT   -  Nov 02, 2010

the variable is named %haltNick so this is to halt the "OP" to thoses nicks :p

 Respond  
Jethro   -  Nov 02, 2010

Probably, but I think he couldn't care less.

 Respond  
Gummo   -  Nov 02, 2010

I'm not sure he really thought the script through, anyway.. He has probably edited another script to be like this and ended up with %HaltNick.

 Respond  
WorldDMT   -  Oct 31, 2010

it's an EG for his code not for mine :p

 Respond  
Jethro   -  Oct 31, 2010

OK...lol Gee...I suppose you're right then. But giving an op status to everyone is never a good idea. :p He should take that into consideration.

 Respond  
WorldDMT   -  Oct 31, 2010

if u look at the main code u'll see

 if ($nick isin %HaltNick) { halt }

so he want to give an "op" to every one exept the nicks in the variable

 Respond  
Gummo   -  Oct 31, 2010

Haha, fair enough. I did check it when I saw that because I didn't figure him for such a mistake. :P

 Respond  
Jethro   -  Oct 31, 2010

You're right, Gummo. I quickly browsed the code. I didn't look at it closely! Darn it, fix the code, WorldDMT. :p

P.S. I'm reserving the "good" until he's done so.

 Respond  
Gummo   -  Oct 30, 2010

I'd just like to point out the fact that when you said that code above was good code, Jethro_, it will actually op everyone who is NOT on the list when aop is enabled..

 Respond  
Jethro   -  Oct 28, 2010

I don't like to see people fail. I like to see them improve. Accept experienced coders' suggestions and learn from them to refine their MSL. (by the way, I'm still learning; there are way too much to learn from the best!)

Unfortunately, some folks refuse to abide by that, thinking their codes are a definite must-read. The thing I sort of despise the most is to share redundant coding styles or bad habits with novice users. They may not understand much about MSL, and thus take your so-called "guide" or snippet to pass it down from one to another...and that's going to be a vicious cycle, isn't it? Perhaps they were the victims themselves...'cause that's how they were taught to code this way.

 Respond  
MashhitDK   -  Oct 28, 2010

Off-Topic?:
Not everyone is on the same level... and as said most people have their own way of coding...
So as long as the scripts / snippets posted follow the rules and actually work like intended... there's no reason to be hating...

  • Not meaning suggestions ain't welcome ;)

HATERs ! - They love to see you fall :P
ooO( Stoners... / Hippies... much more "re-tar-ded" ? ? :P )

EDIT:
It's not that I don't agree ( with some of it anyways )... was just saying... <3

 Respond  
Burrito   -  Oct 28, 2010

Sure everybody has their own coding styles, but if you use an else { if(...) { ... } } why not just use elseif? Coding style.does not mean bad coding practice. Otherwise nice code.

 Respond  
Jethro   -  Oct 28, 2010

DragonFlare wrote:

everyone has thier own Coding StyleThat is true, but you have to be sure that the code you've given or demonstrated is not redundant and ineffective. Like this one above by WorldDMT is an example of good coding. It doesn't take a genius to distinguish and realize that...

When coding, you have to put certain factors into perspective.

 Respond  
WorldDMT   -  Oct 28, 2010

put the channels in event and this is an EG

alias aop {
  if $istok(on.off,$1,46) {
    set %aop $1
    echo -a Aop is now $1
  }
}
on @!*:join:#channel1,#channel2,#channel3,#channel4#channelN:{
  if (%aop == on) && (!$istok(Nick1,Nick2,Nick3,Nick4,$nick,44)) { mode # +o $nick }
}
 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.