+m -m script

By Fightingspirit on Jul 26, 2011

Hi there, My name is Fightingspirit.
A friend started teaching me scripting last week and this will be my first contribution. All comments are welcome. If u feel this little script could be done better feel free to change and post. I know there are scripts like this one out there but i wanted to script something that would make running my bot and my network easier.

This is a very basic moderation script. I made this for my bot but can be used on ur mIRC script as well

commands are
!+m
!-m
and thats it.

Thanks go to my teacher Frederik
Thank u Hawkee.com for allowing us to share our scripts and snippits.

on *:TEXT:!+m*:#:  { 
  if  ($nick isop $chan) {
    /mode # +m #
  }
  else {
    msg $chan $nick $+ : O.o what are u doing
  }
} 

on *:TEXT:!-m*:#: { 
  if  ($nick isop $chan) {
    /mode # -m #
  }
  else {
    msg $chan $nick $+ : O.o what are u doing.
  }
}

Comments

Sign in to comment.
Jethro   -  Jul 28, 2011

Good work, young grasshopper.

 Respond  
iProTopia   -  Jul 28, 2011

This one is mine

on $@*:TEXT:/^([+-]m)$/S:#: {
  if (!%flood && $nick(#,$nick,oh)) { inc -u5 %flood
    mode # $regml(1)
  }
}

And napa182 teaches good :D
I'm also a n00b

 Respond  
Fightingspirit   -  Jul 26, 2011

it is great chatting to u. I have learnt so much already and hope to learn so much more. Thanks for taking the time to teach ppl.

 Respond  
napa182   -  Jul 26, 2011

No problem Fightingspirit, and I am glad you joined.

 Respond  
Fightingspirit   -  Jul 26, 2011

thank u napa182

 Respond  
napa182   -  Jul 26, 2011

Fightingspirit There are a lot of servers out there that offer help with msl codes as well the forums on hawkee.com.
The server I linger on offers help as well, and there are few msl coders that are happy to help.
You can find the link to the server on my Profile under Location.

 Respond  
Jethro   -  Jul 26, 2011

There are various ways to come up with a code for this task. Let's find one that fits your own personalities and needs but without redundancy, of course.

 Respond  
Fightingspirit   -  Jul 26, 2011

I thank everyone for their comments. It teaches me so much. I really want to learn how to do great scripts

 Respond  
napa182   -  Jul 26, 2011

if you want to use a trigger as " ! " I would rather use " @ " an if you really want to go as far as to use ignore as a flood pro then you could do:

on $@*:TEXT:/^@([+-]m)$/S:#: {
  .ignore -cu4 $wildsite
  if ($nick(#,$nick,oh)) {
    mode # $regml(1)
  }
  else { .msg # $+($nick,:) O.o what are u doing. }
}

or if you just want to use a regular flood pro as an inc var you could do:

on $@*:TEXT:/^@([+-]m)$/S:#: {
  if (!$($+(%,f,#,$wildsite),2)) {
    inc -u4 $+(%,f,#,$wildsite)
    if ($nick(#,$nick,oh)) {
      mode # $regml(1)
    }
    else { .msg # $+($nick,:) O.o what are u doing. }
  }
}

[b]No I am in no way telling you nor anyone else to change their code nor am I saying to do it the way I showed.
All I am doing is showing a different way to go about it that is all.[/b]

 Respond  
Jethro   -  Jul 26, 2011

On second thought, though, we may as well do:

mode # $+($remove($1,!),m)
 Respond  
Jethro   -  Jul 26, 2011

GrimReaper, you can do it as such:

on @*:text:$($iif($istokcs(!+m !-m,$strip($1),32),$1)):#:{
  if ($nick isop #) { mode # $replace($1,+,+,-,-) m }
  else { msg # $nick What are you doing? o.0 }
}

Still a trigger control is to be considered...you can never be too careful.

 Respond  
napa182   -  Jul 26, 2011

Fightingspirit, you should have took a look at iProTopia's +/- m snippet as well as the comments on that link.

Also one little thing that really is my own opinion, is the use of " ! " as a trigger command. I really don't like to use it cause it can conflict with botserv commands " if your server uses Anope " so I try to limit the use of " ! " as the start of a trigger, but to each their own really.....

 Respond  
GrimReaper   -  Jul 26, 2011

Oh duh.. I knew that.. I was close tho. lol

 Respond  
Jethro   -  Jul 26, 2011

Oh GrimReaper, you need to use $istokcs() because the mode should be treated case-sensitive, so that it won't trigger on the capital M if there is one.

 Respond  
Jethro   -  Jul 26, 2011

Regex is ideal for this, and you need a trigger protection just to be on the safe side:

on $@*:text:/^!([+-])m$/S:#:{
  .ignore -u2 $nick 2 
  if ($nick isop #) {
    if ($regml(1) == +) { mode # +m }
  }
  else { msg # $nick O.o what are u doing? }
}
 Respond  
GrimReaper   -  Jul 26, 2011

You can do this code in so many different way's..

on *:TEXT:!*:#: {
  if ($nick isop #) {
    if ($istok(+m|-m,$remove($1,$chr(33)),124)) {
      mode # $remove($1,$chr(33))
    }
  }
  else { msg # $+($nick,$chr(58)) What are you doing? o.0 }
}

That's just another way of accomplishing the same output! :)

 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.