Set mode

By Xavia on Aug 22, 2011

This is my snippet number 2 !!

This snippet well add a Nick to an .ini file and then the naxt time the user is join'in a chan the bot is in :)

The bot can only set mode to the modes there a under the bots mode

NOTICE! Well only works if the BOT min are OP'ed!!

Like, if the bot have Owner, then the bot can do the all, set all mode. But if the bot onlu have OPs, then the bot can MaX set mode the HALFOP So you understand? I'm say'ing that if the onlye have mode ADMIN so the bot can onlye set to OP :)

HOW TO 1) Paste the snippet into your remote :) 2) !ADD for add'ed a nick in the .ini file ooO( And the next time the user joins a chan where the bots is, the bot well set mode )

Sorry my bad english ^^

Thx to MashhitDK for giv'ing me the start snippet :)


If you have any problems, you can drop by Project-X. Irc://Anonymous.dyndns.dk:6667/Xavia

on *:TEXT:!ADD*:#: {
  if (!$2) { msg # Something goes wrong?  ooO(   !ADD <LvL> <NiCK>4 ) }
  elseif ($nick !isop $chan) { msg # No $nick you are not an OP! }
  elseif ($2 == $readini(AutoJoin.ini,$strip($3),MODE)) { msg # Something wos not right $readini(AutoJoin.ini,$strip($3),MODE) 4) }
  ;*** Error message
  elseif (!$istok(voice halfop op admin owner,$strip($2),32)) && ($3 !ison $chan)   { msg $chan Nope, thats was not right ( $upper($1) OWNER/ADMIN/OP/HALFOP/VOiCE <NiCK> )
  }
  ;****************************************************************************************************************************************************************************************
  ;*** SAVE
  else {
    writeini -n AutoJoin.ini $replace($strip($3),[,@,],~,|,-) MODE $upper($strip($2))
    msg # The Nick its now save'd ind my database ( $2 )
  }
  ;****************************************************************************************************************************************************************************************
}
;****************************************************************************************************************************************************************************************
on *:JOIN:#:if ($readini(AutoJoin.ini,$replace($nick,[,@,],~,|,-),MODE) != $null) && ($me isop $chan) { MODE # $+($replace($readini(AutoJoin.ini,$replace($nick,[,@,],~,|,-),MODE),OWNER,+qao,ADMiN,+ao,OP,+oh,HALFOP,+vh,VOICE,+v),vIe) $nick $nick $nick $nick $nick $nick }

Comments

Sign in to comment.
Xavia   -  Aug 24, 2011
on *:TEXT:!ADD*:#: {
tokenize 32 $1-
  if (!$2) { msg # Something goes wrong?  ooO(   !ADD <LvL> <NiCK>4 ) }

is that what you mean Jetro_ ?

More
 Respond  
Jethro   -  Aug 23, 2011

I was not being offensive. Pardon me if I sounded that way to you, Matcou. I was stating the fact that instead of pointing out the fallacy, why not demonstrate what you mean by what you say? Not every user at Hawkee has knowledge in MSL. A picture's worth a thousand words.

Everyone can submit a snippet or script, but that doesn't necessarily mean he or she understands it.

More
 Respond  
Matcou   -  Aug 23, 2011

Make my post worth while...? I was asking if the "on :" part was not there for people besides me. You need to stop being so offensive Jethro_

More
 Respond  
Jethro   -  Aug 23, 2011

on :TEXT:!ADD:#: { tokenize 32 $strip($1-)

just add the bold line under the text event, remove $strip(), and keep the rest.

More
 Respond  
Xavia   -  Aug 23, 2011

so i sould do what?

More
 Respond  
Jethro   -  Aug 23, 2011

lol I was gonna ask Xavia to add a $strip to $3, but I was in a rush being somewhere...then I forgot it completely. :P I was offering the suggestion off the top of my head. Yes, the tokenize stuff you mentioned should be added under the text event to make sure everything gets stripped out of control codes.

More
 Respond  
napa182   -  Aug 23, 2011

Jethro_ you may as well use tokenize 32 $strip($1-) under the text event cuz in ur example of

elseif (!$istok(voice halfop op admin owner,$strip($2),32)) && ($3 !ison $chan) {

what if $3 has color? as well if $1 has color? oh an yes as Matcou stated they are missing " on " at the start of their text event

More
 Respond  
Jethro   -  Aug 22, 2011

I admit this snippet could use a little work to refine further.

Matcou, why not post a code example that meets your expectations rather than post something, like, "that's missing or should add or change this and that?" Make your comment worth your while.

More
 Respond  
Matcou   -  Aug 22, 2011

Is it just me or is the on : part missing from the text event.

More
 Respond  
Xavia   -  Aug 22, 2011

I'll do :)

More
 Respond  
Jethro   -  Aug 22, 2011

Pleas reedit it. This is supposed to be correct:

elseif (!$istok(voice halfop op admin owner,$strip($2),32)) && ($3 !ison $chan) {
More
 Respond  
Xavia   -  Aug 22, 2011

I just edit'ed the snippet :)

More
 Respond  
Jethro   -  Aug 22, 2011

You can shorten this line:

(voice !isin $strip($2)) && (halfop !isin $strip($2)) && (op !isin $strip($2)) && (admin !isin $strip($2)) && (owner !isin $strip($2)) {

to:

elseif (!$istok(voice halfop op admin owner,$strip($2),32)) && ($3 !ison $chan)  {

And add the -n switch after the writeini command:

writeinin -n autojoin.ini ...

This way mIRC will attempt to write the ini command if it's over the size limit allowed...your ini will surely get bigger over time.

More
 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.