mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
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.

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
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 =)

Last edited by sparta; 08/11/08 10:23 PM.

if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2007
Posts: 214
B
Fjord artisan
Offline
Fjord artisan
B
Joined: Oct 2007
Posts: 214
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 #
}

}



Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
cool!

Thanks!

Joined: Nov 2006
Posts: 1,559
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
@ prefix = you're opped.
($nick == $me) in on text events? ... smile

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
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.

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
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.

Joined: Oct 2005
Posts: 1,741
G
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
$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

Joined: Jul 2007
Posts: 1,129
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Unless of course you want to do this:

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


But that's besides the point.

Joined: Oct 2008
Posts: 167
S
Vogon poet
OP Offline
Vogon poet
S
Joined: Oct 2008
Posts: 167
I have my chatting nick (seanturner70) and my bot (no-nick) and the scripts work fine smile


Link Copied to Clipboard