mIRC Homepage
I currently have this:
Code:
on @*:text:+i:#:{
  if ($me == no-nick) {
    mode $chan +i
    msg $chan $nick set "Invite Only" on $chan 
  }
} 
}

but it seams to be allowing everyone to activate it.
Code:
on @*:text:+i:#:{
   if ($nick isop $chan) {
   mode $chan +i
   msg $chan $nick set "Invite Only" on $chan 
 } 
}

or if only a specified nick can/should trigger it
Code:
on @*:text:+i:#:{
  if ($nick isop $chan) && ($nick == no-nick) {
    mode $chan +i
    msg $chan $nick set "Invite Only" on $chan 
  }
} 

;------------

Edited :P $me replaced with $nick =)
Use this then,

Im not sure why its not picking up the @ part on the on text event

Code:
On *:text:+i:#: {
If ($nick isop #) && ($nick == $me) {
Mode # +i
Msg # $nick set "invite only" on #
}

}


cool!

Thanks!
@ prefix = you're opped.
($nick == $me) in on text events? ... smile
Quote:
on *:TEXT:&:#: {
if ($nick == no-nick) && ($regex($1,^((?:\+)|(?:\-))([imst])$)) {
mode $chan $+($regml(1),$regml(2)) | msg $chan $nick set "Invite Only" on $chan
}
}


You can use regex to add more channel modes and use +m, +s +i ..-m -s -i..etc.. to get the job done.
This would never get activated as you can't activate your own on text events, therefore $nick can never be equal to $me in an ON TEXT event.
$nick == $me is valid for onTEXT events that respond to PMs. You can /msg yourself, and your scripts will respond.

Obviously, this doesn't apply to the scripts in this thread.

-genius_at_work
Unless of course you want to do this:

Code:
on *:TEXT:*:#: {
  if ($me ison $chan) {
    echo -a $v1
  }
}


But that's besides the point.
I have my chatting nick (seanturner70) and my bot (no-nick) and the scripts work fine smile
© mIRC Discussion Forums