Optional +v -v for ChatSpace

By CommonKnowledge on Jan 23, 2012

Here's another snippet that I put together, While being on my server, I got tired of giving people Strict Moderation Voice and them not wanting it and having to remove it. so i came up with this. Pretty self-explanatory , basically, if a chatter wants their mode on Strict Moderation Voice can type !green, and the bot with issue them strict moderation voice, if they later decide they don't want it, because they are bipolar or something, all they have to do is type !ungreen. the bot will then take their Strict Moderation Voice status.

Changed the Green stuff to + or - V

On ^*:Text:*:#:{ 
  if ($strip($1) == !+v) {
    mode $chan +v $nick 
    msg $chan Here ya go, $nick
  }
  if ($strip($1) == !-v) {
    mode $chan -v $nick 
    msg $chan There ya go, $nick
  }
}

Comments

Sign in to comment.
PyThOn   -  Jan 29, 2012

http://www.hawkee.com/snippet/8799/ This i also another example of something similar to what you have created here. Take a hint that not everyones Nicklist will show up as the color green so + -V would be more suitable.Other wise nice snippet.

 Respond  
CommonKnowledge   -  Jan 26, 2012

MakiMaki goes to a server i go to also :P

 Respond  
blackvenomm666   -  Jan 25, 2012

makimaki i talk to commonknowledge in chatrooms. therefore i explain what i need to there:P haha

 Respond  
CommonKnowledge   -  Jan 25, 2012

Ladies, Take your quarrel off my snippet post pl0x. makimaki, thanks for the last comment, thank you all for the suggestions.

 Respond  
  -  Jan 25, 2012

would you like some cheese with that?
I pointed out you had a valid point and stated a likely fact you would make a post in regards to the op flag in the on text event. as you have many times in the past.

as for jaytea's post I fully agree with it..
The only person that bother to post the code and still be in the same format that the poster posted was blackvenomm666 and the only one to go and explain the code tho still did not explain why it was used was Abcdefmonkey

I find it rather rude that no one bother to go hey good job and here is how I do it and this is why. the user is a new coder and no one bother to explain as they butchered the post making it "Better" when in fact it was fine how it was.
before any one goes and rewrites some ones work.. at least explain why so they can learn.. and be sure its better.. not just look cooler.

 Respond  
Jethro   -  Jan 25, 2012

Perhaps refine was a wrong word. Example was the one that should be used. jaytea always has something discouraging, depending on whom he comes across, to say of the comments he sees otherwise. I don't, and will never, claim myself as a regex God but am here to help with the best of my knowledge. And MakiMaki, what makes you think I'll take my time to "go on" about your comments when you've tagged along after jaytea? What good does that do?

 Respond  
  -  Jan 25, 2012
On @*:Text:*:#:{ 
var %i $strip($1)
  if (%i == !green) {
    mode # +v $nick 
    msg # Here ya go, $nick
  }
  elseif (%i == !ungreen) {
    mode # -v $nick 
    msg # There ya go, $nick
} }

donno for sure about the local var use or just having the strip command twice I am sure jaytea can better say if it be better or not, replaced the $chan with #.. I get drilled about elseif use so I been using it more. and added a check if your oped.. as Jethro will go on about it ... he prob right it s a good idea to have if the op you hold is not all the time

 Respond  
  -  Jan 25, 2012

hmmmmm

 Respond  
jaytea   -  Jan 25, 2012

Just a little refinement on the regex suggestion:

you haven't "refined" it by making the contents of the event bulkier than in Wader's example.

and once again, the original code is the cleanest and most suitable of the bunch :/

 Respond  
blackvenomm666   -  Jan 24, 2012

jethro == regex god

 Respond  
Stewie1k94   -  Jan 24, 2012

Yeah true, it was a good example though, to be fair.

 Respond  
Jethro   -  Jan 23, 2012

Yeah...ok. :P

Actually, though, you could do:

.msg # $iif($regml(1) = un,Th,H) $+ ere ya go, $nick

The extra letter e is not needed. :P

That didn't enter my my mind when I posted my example...

 Respond  
Stewie1k94   -  Jan 23, 2012

Just want to say though Jethro, you should of put:

.msg # $iif($regml(1) = un,Th,he) $+ ere ya go, $nick

Like:

.msg # $iif($regml(1) = un,The,He) $+ re ya go, $nick
 Respond  
Stewie1k94   -  Jan 23, 2012

Jethro's "regex" suggestion actually work's. xD

 Respond  
Jethro   -  Jan 23, 2012

Just a little refinement on the regex suggestion:

on @$*:text:/^[!.@](un)?(green)$/Si:#:{
 mode # $iif($regml(1) = un,-,+) $+ v $nick
 .msg # $iif($regml(1) = un,Th,he) $+ ere ya go, $nick
}
 Respond  
Abcdefmonkey   -  Jan 23, 2012

@CommonKnowledge

Tokenize just sets the $1 $2 etc spots that are separated by the character specified. For example

 tokenize 58 hey:hi:whats up

Separates each of those into $1 $2 $3 respectively because they're separated by $chr(58) which is the colon ( : ). So, $1 = hey $2 = hi $3 = whats up

In Blackvenom666's snippet he used

tokenize 32 $strip($1-)

This does exactly as the example I showed you for a better understanding. Except his is separated by a space ($chr(32))

Hope that helps. :) Also, you can refer to //help in mIRC for anything else. Other than that, feel free to ask any questions :)

 Respond  
CommonKnowledge   -  Jan 23, 2012

I mean i know what you have the $strip($1-) there for, but Tokenize has me confused -.-

 Respond  
CommonKnowledge   -  Jan 23, 2012

tokenize 32 means what?

 Respond  
blackvenomm666   -  Jan 23, 2012
On ^*:Text:*:#:{ 
tokenize 32 $strip($1-)
  if ($1 == !green) {
    mode $chan +v $nick 
    msg $chan Here ya go, $nick
  }
  if ($1 == !ungreen) {
    mode $chan -v $nick 
    msg $chan There ya go, $nick
  }
}
 Respond  
blackvenomm666   -  Jan 23, 2012

wader he's new to scripting lets try to leave the regex out of it for now. haha

 Respond  
CommonKnowledge   -  Jan 23, 2012

Does that change anything? or is that the same thing just written differently?

 Respond  
Wade   -  Jan 23, 2012
on $*:TEXT:/^[!@.](un)?green/Si:#: {
    mode $chan $iif($regml(1),-,+) $+ v $nick
    msg $chan $iif($regml(1),Th,H) $+ ere ya go, $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.